Skip to content

Instantly share code, notes, and snippets.

@jimode
Last active August 24, 2018 10:20
Show Gist options
  • Save jimode/e23cbe1fb1ac74626ef2b4ffc4e87239 to your computer and use it in GitHub Desktop.
Save jimode/e23cbe1fb1ac74626ef2b4ffc4e87239 to your computer and use it in GitHub Desktop.
checking list of elements using tables
Then(/^I should see the following dropdown options$/, (table) => {
const expectedOptions = [].concat(...table.raw()); // this array is from the table in the scenario
const availableOptions = PaymentDetailsFormComponent.billingCountryOptions // this array will come from the collection of DOM elements
.map(option => option.getText());
expect(availableOptions).to.deep.eq(expectedOptions);
});
Scenario: Display of billing country dropdown
# ...
And the billing country dropdown should be displayed
And I should see the following dropdown options
| Please select option |
| Germany |
| Austria |
| Switzerland |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment