Skip to content

Commit

Permalink
test(recommendation.cy): reliability hardening to cypress recommendat…
Browse files Browse the repository at this point in the history
…ion test
  • Loading branch information
chrisFrazier77 committed Dec 20, 2023
1 parent 53431af commit 5fc146d
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,16 @@ describe('Recommendations', () => {

it('can click on a result and go to that page', function () {
cy.document().then((doc) => {
cy.get(config?.selectors?.recommendation.activeSlide).should('exist');
let url = doc.querySelector(`${config?.selectors?.recommendation.activeSlide} ${config?.selectors?.recommendation.result} a`).attributes?.href
?.value;
cy.get(config?.selectors?.recommendation.activeSlide)
.click({ multiple: true })
.then(() => {
cy.location('pathname').should('include', url);
});
cy.snapController(config?.selectors?.recommendation.controller).then(({ store }) => {
cy.get(config?.selectors?.recommendation.activeSlide).should('exist');
let url = doc.querySelector(`${config?.selectors?.recommendation.activeSlide} ${config?.selectors?.recommendation.result} a`).attributes
?.href?.value;
cy.get(config?.selectors?.recommendation.activeSlide)
.click({ multiple: true })
.then(() => {
cy.location('pathname').should('include', url);
});
});
});
});
});
Expand Down

0 comments on commit 5fc146d

Please sign in to comment.