This step asserts that an element identified by a CSS selector, ID, class, or other attribute contains a specific text value. You provide an attribute value (such as an ID like uname, a CSS selector like #price-box, or a class like pwordcss) and the expected text. The step waits up to 10 seconds for the element to appear before reading its text content.
When no explicit attribute name is supplied, the buildSelector helper infers the selector type from the value itself. Supply an attribute name such as "id" with the by its "id" attr form when the value alone is ambiguous. This step is complementary to the plain element form that locates elements by visible label text; use the by-attr form when you need to target an element with a specific DOM attribute rather than its display text.
Accepted phrasings
Then I should see "value" in the "attrValue" element by its "attrName" attr
Then I should see "value" in the "attrValue" element by attr
Then we should see "value" in the "attrValue" element by its "attrName" attr
Then we should see "value" in the "attrValue" element by attr
Examples
Then I should see "John Smith" in the "uname" element by its "id" attr
Then I should see "1234" in the "pwordcss" element by attr
Then we should see "admin@example.org" in the "#current-user" element by attr
Then I should see "Active" in the ".status-badge" element by attr
In a real scenario
Scenario: Verify the user profile panel shows the correct account name
Given I am a logged in user with the "editor" user
When I go to "/account/profile"
And wait
Then I should see "editor" in the "username-display" element by its "id" attr
And I should see "editor@example.org" in the "account-email" element by its "id" attr
And I should see "Active" in the ".account-status" element by attr