Refactor to use "data-e2e" attributes in code to make selecting fields/buttons easier in e2e tests

This commit is contained in:
Tim Donohue
2022-01-07 15:11:12 -06:00
parent cb91ccbc33
commit 794aa33c8f
12 changed files with 94 additions and 54 deletions

View File

@@ -16,8 +16,8 @@ describe('Homepage', () => {
it('should have a working search box', () => {
const queryString = 'test';
cy.get('ds-search-form input[name="query"]').type(queryString);
cy.get('ds-search-form button.search-button').click();
cy.get('[data-e2e="search-box"]').type(queryString);
cy.get('[data-e2e="search-button"]').click();
cy.url().should('include', '/search');
cy.url().should('include', 'query=' + encodeURI(queryString));
});