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
2
votes
1 answer

What is the correct way to get selected option text using site_prism?

I have a site_prism element that points to a select box. Like this: class MyPageObject < SitePrism::Page element :my_select_box, '#select-box-id' end Although I have a way to get the selected option value, with…
p.matsinopoulos
  • 7,655
  • 6
  • 44
  • 92
2
votes
1 answer

Rails: Can't find assets via SCSS @import in test environment

My team is using SitePrism for feature tests in a Rails 4 app, and we're currently restructuring our CSS assets in the project. One of the asset files includes a line that @imports from a subdirectory: app/assets/stylesheets/lib/admin.scss.css: …
Duncan Malashock
  • 776
  • 10
  • 32
2
votes
2 answers

Capybara Set doesn't trigger events after changing the value

Be careful using 'set' rather than the other built-in methods, as it doesn't trigger events after changing the value, as pointed out in a comment here: How to use fill_in with find in Capybara (if possible) e.g. find(:css,…
Daryn
  • 3,394
  • 5
  • 30
  • 41
2
votes
2 answers

Can't seem to use SitePrism's element.visible? if the element doesn't exist

I have the following codes: element :header_upgrade_subscription, :xpath, "//a[text()='Upgrade subscription']" element :header_change_subscription, :xpath, "//a[text()='Change subscription']" if header_upgrade_subscription.visible? …
Jay Park
  • 43
  • 1
  • 8
2
votes
1 answer

How correctly config rails test to run it in browser? ( site_prism, cucumber, capybara, selenium webdriver )

I am writing test for rails app, I use site_prism, capybara, selenium and cucumber. How can I setup Selenium driver to run my tests in browser (firefox)? For example, it is one of features: Given /^I navigate to Dashboard page$/ do @page…
bmalets
  • 3,207
  • 7
  • 35
  • 64
2
votes
2 answers

How do i clear my capybara steps using Page Object Pattern?

I have the following step definitions with Page Object Pattern gem 'site_prism': class Main < SitePrism::Page element :login_link, "a.log-in-link" element :login_field, "input[name='userLogin']" element :pass_field,…
mef_
  • 478
  • 1
  • 12
  • 31
2
votes
1 answer

Can you find elements by id,title,link etc through site-prism or only by css selectors?

By using site-prism gem for integration testing, can I find page elements by referring to id or title or link or xpath or are they searchable only through css
bugsberry
  • 67
  • 1
  • 8
2
votes
3 answers

Site Prism, Capybara: Selector with variable

I'm mucking around with the site_prism to implement a Page Object Model in capybara. It looks very interesting. How would I specify a selector such as "[data-id='x']" where x is an integer? Something like this: class Home < SitePrism::Page set_url…
Rimian
  • 36,864
  • 16
  • 117
  • 117
1
vote
0 answers

Site-Prism nested repeating sections problem

I am having trouble limiting the matches for elements in a Section I'm writing. See the example HTML and Comment Section below. I want to be able to reply to a specific comment on the page. Comments can be nested up to X deep. I can use…
MartinP
  • 83
  • 6
1
vote
1 answer

Are there Siteprism best practices regarding the use of sections

I have used siteprism in the following manner Each page has a page object file Sections that are unique to a given page are only found in that page object file Sections that are shared across multiple pages are placed in a base page and other pages…
mgraffx
  • 51
  • 4
1
vote
1 answer

How to run a Rspec scenario with multiple tags?

I am using ruby client for web automation with selenium. I am running them parallel using parallel_rspec. I want to run the tests which has smoke and ae tags set. My scenarios looks like: scenario 'Test1', :smoke, :regression, :ae do "do…
1
vote
1 answer

How to correctly use the Site-prism URL expansion

I have a page object with the following setup: class StudynoteShowPage < SitePrism::Page set_url "/studynotes{/studynote}" end When I use that page ssp = StudynoteShowPage.new ssp.load(studynote: @s1) I get ArgumentError: wrong number of…
andreheijstek
  • 71
  • 1
  • 9
1
vote
2 answers

SitePrism how to wait for any of elements

I am testing UI flow with Capybara and SitePrism stack. Unfortunately, my UI flow is not fully deterministic and sometimes a warning message pops up in the flow. Therefore I need to have a conditional flow in the test. To wait for a single element,…
Pavel
  • 88
  • 6
1
vote
1 answer

Click on buttons on the page that has got the same class using capybara with siteprism

There are 20 different buttons to expect and needs to be clicked through to expect and verify the urls inside the code. I have tried different ways to implement my tests but they are failing. I'm trying something like: page.all(:class => 'action…
user8766450
1
vote
2 answers

Which style of assertion with Capybara and SitePrism?

I am using the PageObject pattern, which abstracts HTML details away from the top-level of the test. I am doing this using the SitePrism gem. In my example, I have a home page (HomePage.rb): class HomePage < SitePrism::Page set_url…
jimjamz
  • 59
  • 6