forked from cucumber/cucumber-ruby
-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Add a nice page element matching API.
Cucumber generates file features/step_definitions/web_steps.rb. It contains steps in form:
I should see "Hello World"
I should see "Hello World" within "table.users"
This allows to search for given text only. Second option is worse as it bleeds through HTML semantics to domain experts (not likely interested in HTML/CSS details).
Instead provide steps that allow to write:
I should see user list
To allow developers easily tell what 'user list' is in terms of HTML/CSS selectors introduce new file called features/support/page_elements.rb. In this file allow developer to match page element names to HTML/CSS selectors using syntax:
PageElement /user list/ do
have_tag("table.users")
end
PageElement /welcome text/ do
have_tag("#flash .notice", "Hello world")
end
Metadata
Metadata
Assignees
Labels
No labels