Questions tagged [site-prism]

SitePrism is a simple, clean and semantic DSL for describing your site using the Page Object Model pattern, for use with ruby & Capybara in automated acceptance testing.

Introduction

SitePrism enables the use of the Page Object Model pattern when using Ruby and Capybara for browser-based acceptance testing. The API is simple and can be used to create a semantic representation of your site that aims to reduce the usual maintenance cost of maintaining a suite of browser tests.

Important Links

116 questions
1
vote
2 answers

Uninitialized Constant (NameError) using Cucumber & SitePrism

I am creating a testing automation using Cucumber and SitePrism. I got an error when running cucumber command to start the scenario and got this error: uninitialized constant HomePage::Navbar (NameError) .../features/page_object/home_page.rb:4:in…
Aranda Soedjono
  • 153
  • 1
  • 9
1
vote
1 answer

Unable to define siteprism element from a given label text

I'm using a cucumber/ruby/capybara/siteprism framework and I'm having problems identifying elements as either we're missing the ids, names, etc or they create them with a in real time. I was mainly trying to define some of those elements in a…
mickael
  • 2,033
  • 7
  • 25
  • 38
1
vote
2 answers

How to search a collection of SitePrism sections for a section matching a specific criterion

I have defined a sections element as containing a list of individual elements to model a data table. Each Section of the Sections collection corresponds to a row of the table and each element of the Sections definition corresponds to a column of the…
Craig Miles
  • 447
  • 4
  • 18
1
vote
1 answer

Performance advantage between defining Css Selector using symbols or not using symbols in Selenium Test Automation?

In Automation, while we use CSS to define page elements, We can define as below ways for a sample page element: element :fld_page_element, "#uniqueID .some-class-name" OR, element :fld_page_element, "[id='uniqueID']…
ASM
  • 709
  • 2
  • 8
  • 27
1
vote
2 answers

Need to Restart PhantomjS when it hangs

I want to restart my Phantomjs Driver when it hangs. I have an example of restarting poltergiest as below: if driver.is_a?(Capybara::Poltergeist::Driver) driver.restart end I am not using Poltergeist driver. I am using phantomjs driver object like…
SaeeK
  • 217
  • 1
  • 4
  • 12
1
vote
1 answer

Wait until element is active/enabled to perform action(like click/select) on Siteprism Capybara?

In Siteprism i need to find out to wait for an element to be enabled before performing any action like click/select. currently i am using this by Siteprism: @page.wait_for_page_element(10) But looks like that's not enough waiting. Still my script…
SaeeK
  • 217
  • 1
  • 4
  • 12
1
vote
0 answers

Do I need to .load a page when I want to interact with elements on the page?

I have a Selenium/Java background, using Ruby/Capybara/Site Prism for the first time. I would like to create an object and then interact with the elements on the page without using the .load method but after clicking on a link to get to the page…
1
vote
2 answers

With site_prism I dont know how the best practice if I want to use a variable called @current_page

You see, sometimes in my code I need to put a global variable to set the current_page (during one step) and reuse it (in other step) Then /^I open the "(.*?)" form$/ do |form_type| form_page = "#{form_type}_page" @current_page =…
Brice LALU
  • 173
  • 1
  • 7
1
vote
1 answer

SitePrism gem- how to set_url dynamically based on the environment?

I'm converting the in-browser tests for an app to use the SitePrism gem. In the gem readme, I see the following: A page usually has a URL. If you want to be able to navigate to a page, you'll need to set its URL. Here's how: class Home <…
Richie Thomas
  • 3,073
  • 4
  • 32
  • 55
1
vote
1 answer

Get page driver from inside SitePrism page

How can I get page driver from inside the SitePrism page? According to poltergeist docs all I need is to call: page.driver But it refers to the Capybara page, not SitePrism's page. The question therefore: how to get Capybara page when you are…
melekes
  • 1,880
  • 2
  • 24
  • 30
1
vote
2 answers

How to get CSS Style of section in Siteprism Page object model using Cucumber/Capybara

How to get CSS Style of section in Siteprism Page object model using Cucumber/Capybara. For an element, I use the below code to get CSS @app.page_name.element_name.css('height') For sections, When I try to use same as above…
Srikanth
  • 265
  • 2
  • 8
1
vote
1 answer

How do I handle elements and sub-sections that are technically outside a section's scope?

I am attempting to model a page which contains sections and sub-sections, and I am running into trouble with scoping. The section I am defining can be found in the DOM in a hierarchy like so: html > body > div.page-background > div#wrapper >…
user1410942
1
vote
1 answer

Can we navigate to different pages inside within loop in capybara/siteprism?

My code is like this: my_array.each do |element| within element do some_element.click #it will take me to next page some_other_element.click #it will take me to previous page for next iteration end end In siteprism page it is…
Srikanth
  • 265
  • 2
  • 8
1
vote
3 answers

Include World concept of cucumber in site-prism

How to include World concept of cucumber in site-prism? So that I can include test_site class in World and then no need to instantiate test_site class every time in step functions. Is it possible? I'm using Ruby with Capybara and site-prism; not…
Srikanth
  • 265
  • 2
  • 8
1
vote
1 answer

Is it possible to load an html file in site_prism?

I would need to load an html as a SitePrism Object. Is this possible? From what I see in the documentation, you can only navigate using certain url's. Would I need to store the html in a relative path in my app and then load that url with…
adids
  • 137
  • 12