site-prism

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

余生长醉 提交于 2019-12-25 06:53:44
问题 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 example, if I've got a siteprim page that looks like: sections :user_container, "#user_container" do sections :address_module, "#address" do element :house_number, "#house_number" end end Can I somehow define new variables on the same pageobject

Does site_prism allow using other selectors than CSS?

让人想犯罪 __ 提交于 2019-12-24 13:13:52
问题 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 the elements, etc. Thanks and Regards! 回答1: UPDATE: It is possible, as of SitePrism 2.1 to use XPath expressions to find elements and sections, as well as CSS selectors. ===== CSS only at the moment. I may change that in the future though. 来源: https

How to add a section to a SitePrism page object dynamically?

China☆狼群 提交于 2019-12-10 08:40:09
问题 I'm using SitePrism to test my web application. I have a number of classes that extend SitePrism::Page and a number of often-used HTML snippets are represented by matching classes extending SitePrism::Section class Login < SitePrism::Section element :username, "#username" element :password, "#password" element :sign_in, "button" end class Home < SitePrism::Page section :login, Login, "div.login" end The problem is, the application I'm working on is based on a CMS, in which a page can be

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

扶醉桌前 提交于 2019-12-08 01:57:10
问题 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 = DashboardPage.new # Dashboardpage is inheritor of SitePrism::Page @page.load @page.login_form.login_field.set 'admin' @page.login_form.password_field.set 'test' @page.login_form.signin_button.click @page.title.include? 'Dashboard' end This is my features

How to add a section to a SitePrism page object dynamically?

对着背影说爱祢 提交于 2019-12-05 16:42:26
I'm using SitePrism to test my web application. I have a number of classes that extend SitePrism::Page and a number of often-used HTML snippets are represented by matching classes extending SitePrism::Section class Login < SitePrism::Section element :username, "#username" element :password, "#password" element :sign_in, "button" end class Home < SitePrism::Page section :login, Login, "div.login" end The problem is, the application I'm working on is based on a CMS, in which a page can be assembled by selecting a Template based on pre-defined content and then drag-and-dropping any number of