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

How do I access a checkbox with ruby capybara/selenium

My usual method of obtaining a checkbox doesn't appear to be working here... Basically I have a table with some data in it but the first td is a checkbox. What I am trying to do is click on that checkbox, yet no mater what I do, it seems to not be…
Zack
  • 2,377
  • 4
  • 25
  • 51
0
votes
1 answer

How to dynamically load a page in Site Prism

I have an article page, a news page and a comment page which have some shared elements. At the moment I have different steps for loading and testing the shared elements as follows. article_page.feature Given I visit the Article page "Article…
margo
  • 2,927
  • 1
  • 14
  • 31
0
votes
2 answers

How to test one page where its content differs with permissions user has in Capybara, SitePrism

Creating tests in Ruby, Capybara using SitePrism. I have faced situation, where I have one site but content of the site depends on permissions the user has. For example element "admin" in menu is visible only for admins e.t.c. One major difference…
Jakub Smolar
  • 81
  • 10
0
votes
3 answers

Recursively check if nested elements exist

Just to give you a background, I'm using Ruby for creating automated tests along with Selenium, Cucumber, Capybara and SitePrism. I have some tests that need to check the text of a certain element on the page, for example: def get_section_id …
Andrew Allison
  • 1,122
  • 2
  • 13
  • 30
0
votes
1 answer

Siteprism section won't respond to has_element

I'm trying to use SitePrism with my ruby/capybara/selenium test suite and I continue to get an error around expecting an element to respond to has_? The last line of the spec is what is failing. It is giving me an error…
Zack
  • 2,377
  • 4
  • 25
  • 51
0
votes
1 answer

How to attach a file with Capybara/SitePrism/Ruby when there's no input element when the page loads?

I'm using a test framework with Ruby, Capybara and SitePrism mainly and up until now I was using the 'attach_file(input_element, File.path)' method successfully. I've now moved to a different project and they've got this page where there's an…
mickael
  • 2,033
  • 7
  • 25
  • 38
0
votes
2 answers

Check if section in Site Prism has class of specific type

Using Capybara in ruby and creating page objects with Site Prism. Http element looks like this:
...
Jakub Smolar
  • 81
  • 10
0
votes
1 answer

Firefox and Chrome Selenium webdrivers differ in behaviour with Capybara and SitePrism

I have a Sign In page that contains 2 text fields and a submit button. The submit button is only enabled upon the text fields being filled correctly.
jimjamz
  • 59
  • 6
0
votes
2 answers

'undefined local variable or method' for expects exported to method in helper

Goal: Trying to submit empty register form fails due to validation errors. Expects are present in scenario as single line (method). Errors are being checked very precisely in terms of their placement. I don't want to use classical counting until…
Zelka
  • 1
  • 2
0
votes
1 answer

Undefined Method for send_keys with a valid Capybara element

I'm trying to call .send_keys on a Capybara element I retrieved using a siteprism page model. Relevant section of page model: class SearchPage < SitePrism::Page element :omnisearch_input, "input.db-search__input" In the rails console I can…
James
  • 25
  • 1
  • 6
0
votes
2 answers

Is it possible to use "steps" inside SitePrism pages?

I'm working in a cucumber-ruby framework and we're using Capybara and SitePrism to drive the browser. I've got a situation where I want to retry a bunch of steps if an error happens, so I was putting a method with logic to cover this within a…
mickael
  • 2,033
  • 7
  • 25
  • 38
0
votes
1 answer

Unable to use RSpec::Matchers with binding.pry

I'm working with Cucumber, Ruby and SitePrism classes. I was trying to make assertions inside the SitePrism classes and I manage to use the 'expectation' methods when including RSpec::Matchers, however, I was using 'binding.pry' for debugging and…
mickael
  • 2,033
  • 7
  • 25
  • 38
0
votes
1 answer

Is it possible to use a class variable with a SitePrism module

I'm writing a test step and I need to give Capybara's page.check() method the name value for my checkbox with the name of checkbox_name. I wanted to save that as a class variable in my page object model like so: #class_name_page.rb class…
James
  • 25
  • 1
  • 6
0
votes
1 answer

Capybara and Siteprism: Ignore element from loading

We have some tests written in Capybara (Ruby) + SitePrism + ChromeDriver. In some of those test, there is a page involved which has some very slow-loading iframes and which is causing the tests to fail with Net::ReadTimeout exceptions. I know that I…
Alex Ntousias
  • 8,962
  • 8
  • 39
  • 47
0
votes
1 answer

Is it possible to use siteprism variables to define new variables when defining the page object?

I'm working on a cucumber, ruby, capybara, siteprism project and we're defining most UK variables in a siteprism page object. Is there a way for me to use the siteprism variables that I create as part of the definition for new variables? For…
mickael
  • 2,033
  • 7
  • 25
  • 38