Skip to content

Page element matching API #2

@bragi

Description

@bragi

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions