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

Does site_prism allow using other selectors than CSS?

I'm researching gems that allow me to use Page Object Pattern along Capybara. I found out site_prism and looks very promising. My question is, is there a way to define elements with selectors other than css? Like Xpath, Dom, maybe just the id's of…
adids
  • 137
  • 12
0
votes
1 answer

unable to click on checkbox within shadowroot

I am writing a test to go through a test flow of a monetary registration. The registration has Add-ons that appear in different steps that flow. My goal is to be able to select the checkboxes in the add-on shadow root, so I can get to the next…
rgorowsky
  • 105
  • 1
  • 12
0
votes
0 answers

Scenario outline does not work when run directly in class with Ruby

When I run my Outline Scenario directly from step_definition it works but if I implement it in the class it doesn't. When I run the class method I get the following error: undefined local variable or method _email' for…
Tadeu
  • 67
  • 6
0
votes
1 answer

How to map an element that changes id and has several in capybara/siteprism

I'm trying to find an element, its id will always change, as it is a register. Exexample: https://i.stack.imgur.com/Bql94.png I would like to click on 'Edit' but the id of this class will always be different. How do I map and click on 'Edit' using…
0
votes
1 answer

How to add or get the {github.sha} to cucumber url in ruby

I have the following code: def index_page visit 'https://www.company.com/?&ui_version=912c739e8450c9fc0705eeae12715656716f42c3' end I need to replace the rest of the path with the {github.sha} that generates github actions in my project where I…
0
votes
1 answer

I have doubts about two mappings on the site-prism

I don't want to use xpath on the elements below. element :img_login, :xpath, '//[@id="main-wrapper"]/div/section/div/div[2]/div/div/div[1]/img' element :msg_login_senha_invalidos, :xpath, …
stasilvio
  • 17
  • 3
0
votes
1 answer

I don't want to use Xpath to map the Label element

I don't want to use xpath to map these elements, as we can see the class is the same for everyone. How to do please?
sabnola
  • 5
  • 3
0
votes
0 answers

Mapping element with site prism with repeated correspondences

I have the following problem: I want to map these elements but there are repeated correspondences. I don't want to use xpath!. IF I map using input name or class there will be repeated matches class CriaScreenCadastro < SitePrism::Page set_url…
sabnola
  • 5
  • 3
0
votes
2 answers

How to create and use variables dynamically named by string values in Ruby?

I'm using SitePrism to create some POM tests. One of my page classes looks like this: class HomePage < SitePrism::Page set_url '/index.html' element :red_colour_cell, "div[id='colour-cell-red']" element :green_colour_cell,…
jimjamz
  • 59
  • 6
0
votes
1 answer

How to differentiate the test cases based on its tags?

I have one test case which runs for different countries but when I run the entire suite it overrides the test name in allure report. I want to know which test get passed or failed based on its tags. I am using rspec and allure combination. My Test…
0
votes
1 answer

Is there a way to have a method to iterate through a collection of sections and then call an element in that specfic section?

I'm setting up my page object model and I have sections that have the same name but with an added index at the end of each. I want to be able to have a collection of sections that I can iterate through based on the index and then call an element in…
aross
  • 1
0
votes
1 answer

cannot run anymore single SitePrism feature specs

something happened, old tests that used to run fine on master are not running anymore If I run the whole spec suite (with $ rspec), everything is in the green. I have several feature specs that use SitePrism, I use to call them separately to write…
Salomanuel
  • 897
  • 10
  • 22
0
votes
1 answer

Using site_prism with dynamically loaded fields

I’m wrestling to get a test running where I am adding elements dynamically to a page. The adding is done with javascript using the cocoon gem. Here’s a picture of the page. Setting the ‘title’ and the ‘bijbelstudie’ and the ‘perikoop 1’ all works…
andreheijstek
  • 71
  • 1
  • 9
0
votes
1 answer

SitePrism - Dynamically Define Element Based on Current Edit ID

Please note I'm new to SitePrism. I'm putting together a Capybara feature test case for editing data. The form's ID is "edit_bears_1", where you can imagine the #1 changes based on the current object's ID.
nmadoug
  • 47
  • 4
0
votes
1 answer

Site_Prism not finding POM elements when page.find used

So I have setup a Capybara, Cucumber project with SitePrism for POM and for the most part it works. When I use: Then('Find object name') do expect(@page).to have_object_name end it works just fine but when I come to use: Then('Assign object names…