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

What's the best way to reuse your step definition in ruby siteprism

im having some issue trying to create a reusable step definition using siteprism let say feature file is Given that im on the site Then i should see a "stack over" text And i should see a "ask" text And i should see a "question" text then on my…
B_B
  • 95
  • 1
  • 9
0
votes
2 answers

how do you set the implicit wait time in site-prism?

Left to it's own devices Site-prism does not use implicit waits. On the website it shows that you can allow implicit waits by setting use_implicit_waits = true. The site does not however show how to actually set the implicit wait value and the…
adambsg
  • 131
  • 2
  • 9
0
votes
1 answer

undefined method `steps' for # (NoMethodError)

My cucumber feature file is using scenario outline like below: Scenario Outline: And user searches for item "" Then homepage is active And user selects "" Type(s) Examples: | item | type | | car | bmw | | car | honda …
ASM
  • 709
  • 2
  • 8
  • 27
0
votes
2 answers

uninitialized constant SitePrism from page declariation

I'm trying to set up a basic framework using Capybara, Cucumber and SitePrism, but I keep getting the error, "uninitialized constant SitePrism (NameError)" when I kick off a test. Gemfile: gem 'cucumber', '2.3.3' gem 'capybara', '2.6.2' gem…
mdtest
  • 1
  • 1
0
votes
2 answers

Capybara's fill_in on a Site Prism's page object doesn't work

I'm rewriting feature specs to page objects and I have a problem with fill_in method. The code is as follows: Page object: class LoginPage < SitePrism::Page set_url '/login' section :navbar, NavbarSection, '.navbar-collapse' section :drop_menu,…
anks
  • 303
  • 2
  • 12
0
votes
3 answers

How to make Cucumber/Capybara close or quit the browser session after test execution is complete?

I am having some issues in Jenkins. After test execution completes, the browser session is still alive, which is creating some other issue in the pipeline. So I want to quit the browser session after execution completed in my Test Suite. I am using…
SaeeK
  • 217
  • 1
  • 4
  • 12
0
votes
1 answer

Background step sometimes never executes before few scenarios on a cucumber feature file

I saw a wired issue recently that Background step sometimes don't executes before few scenarios in a feature file. I have no idea why this is happened. Any body saw this issue in cucumber ruby framework? Is there any limitations of scenario count on…
SaeeK
  • 217
  • 1
  • 4
  • 12
0
votes
2 answers

Capybara Screenshots doesnt take snapshot while step fails...?

Capybara screenshot doesn't take snapshot while step fails. I am using below code: Capybara.save_and_open_page_path = "/file/path" Capybara::Screenshot.register_filename_prefix_formatter(:rspec) do |example| …
SaeeK
  • 217
  • 1
  • 4
  • 12
0
votes
1 answer

SitePrism: sometimes find elements, sometimes doesn't while Capabara can

I am using Capybara and Selenium for testing my website. I also use with Site Prism for Page Object model. I can make every thing work now, however, I don't understand why sometimes actions with page elements donot work, while using "natively"…
Huy Do
  • 470
  • 1
  • 7
  • 19
0
votes
2 answers

Need to wait until the object size reaches the expected in Capybara

Currently i can use this below code to verify the object size: expect((@page.elements).size).to eq(12) But i want to use wait_for / wait_until command until those elements(collection of objects) loads. So i want to use like this…
SaeeK
  • 217
  • 1
  • 4
  • 12
0
votes
1 answer

Rspec, capybara getting started issues

I have have started with simple example of Rspec,Capybara. I have come across few issues. This issues are probably because I have experience with cucumber and page_object gem, but here I am using capybara and Site_prism gem. I have…
paul
  • 4,333
  • 16
  • 71
  • 144
0
votes
1 answer

Difference between these two gems "site_prism" and "page_object"

I have come across two projects one is with WATIR cucumber feature files and step definitions and another one is Rspec, capybara`` withoutstep definitionsandfeature files`. In WATIR project page_object was used and in capybara site_prism gem was…
paul
  • 4,333
  • 16
  • 71
  • 144
0
votes
1 answer

How to use SitePrism gem to select an option from a dropdown menu and test that the option has been selected

I have defined a SitePrism page that has a select tag with options (to create a dropdown menu on my page). In my cucumber steps, I'm trying to set it so that it selects one of the options from the dropdown menu but it seems impossible to do so. Here…
Kin
  • 1
  • 3
0
votes
2 answers

How can I workaround this capybara/rspec naming collision?

I'm writing a new rspec test case using Capybara (SitePrism actually, which uses Capybara) and I've run into an apparently known issue: https://github.com/jnicklas/capybara/issues/1396. Essentially, due to a change in one or the other, RSpec and…
James Martineau
  • 951
  • 1
  • 13
  • 29
0
votes
1 answer

Site Prism: Cannot use xpath locator strategy from an elements within sections

I am using SitePrism 2.6 and getting error Cannot use xpath locator strategy from an element. It can only be used from root element. Defined the section element using xpath. Section element is of type X, So I have X class in which I have defined…