Skip to content

Instantly share code, notes, and snippets.

@njenan
Last active June 17, 2017 20:24
Show Gist options
  • Save njenan/902cd8ca14d1d67d603ed69d1925e81f to your computer and use it in GitHub Desktop.
Save njenan/902cd8ca14d1d67d603ed69d1925e81f to your computer and use it in GitHub Desktop.
BDD Specification with Embedded CSS Selectors and XPAth
Scenario: Log in successfully
Given an existing user
When they type MyUsername into the field with xpath //*[@id="username"]/input
And they type MyPassword into the field with css #password > input
And they click the button with css #login > div.edit.container > div.form-actions > button.btn.btn-default
Then they will see the welcome message
Scenario: Log in - Account does not exist
Given an non-existent user
When they type MyNonExistentUsername into the field with xpath //*[@id="username"]/input
And they type MyNonExistentPassword into the field with css #password > input
And they click the button with css #login > div.edit.container > div.form-actions > button.btn.btn-default
Then they will see the user does not exist message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment