Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Fix broken tests (#85)" because the PR actually breaks tests #88

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cypress/fixtures/globalSelectors.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"successMessage": ".message.success",
"successMessage": ".message-success.success",
"errorMessage": ".message-error",
"pageTitle": "h1.page-title .base"
}
2 changes: 1 addition & 1 deletion cypress/fixtures/hyva/selectors/search.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"headerSearchIcon": "#menu-search-icon",
"searchResults": ".search.results .products .card.card-interactive",
"noResultsMessage": ".message.notice",
"searchSuggestions": "[x-text=\"searchResult.title\"]"
"searchSuggestions": "[x-text=\"suggestion.title\"]"
}
3 changes: 3 additions & 0 deletions cypress/integration/hyva/catalog/category.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ describe("Category page tests", () => {
});

it("Can visit the category page and filters on color red", () => {
cy.get(selectors.shopByColorFilter).contains('Color').click();
cy.get(selectors.selectColorRed).click();

cy.get(selectors.shopByColorFilter).contains('Color').should("not.exist")
cy.get(selectors.activeFilterLabel).should("contain.text", "Color")
cy.get(selectors.activeFilterValue).should("contain.text", "Red")
});
Expand Down
6 changes: 3 additions & 3 deletions cypress/integration/hyva/search/product-searches.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Search } from '../../../page-objects/hyva/search';
import search from '../../../fixtures/hyva/search.json';
import globalSelectors from '../../../fixtures/globalSelectors.json'
import selectors from '../../../fixtures/hyva/selectors/search.json';
import homepageSelectors from '../../../fixtures/hyva/selectors/homepage.json';

Expand All @@ -20,10 +19,11 @@ describe('Perform searches', () => {

it('Can find a single product', () => {
Search.search(search.singleProduct);
cy.get(globalSelectors.successMessage).should(
cy.get(homepageSelectors.mainHeading).should(
'contain.text',
`is the only product matching your '${search.singleProduct}' search.`
`Search results for: '${search.singleProduct}'`
);
cy.get(selectors.searchResults).should('have.lengthOf', 1)
});

it('Can perform search with no search results', () => {
Expand Down