feat(Cypress): add test for breadcrumbs (#42878)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
32
cypress/integration/learn/redirects/breadcrumbs.js
Normal file
32
cypress/integration/learn/redirects/breadcrumbs.js
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
/* global cy */
|
||||||
|
|
||||||
|
const challengeUrl =
|
||||||
|
'/learn/responsive-web-design/basic-html-and-html5/say-hello-to-html-elements';
|
||||||
|
|
||||||
|
const superBlockUrl = '/learn/responsive-web-design';
|
||||||
|
const courseUrl = '/learn/responsive-web-design/#basic-html-and-html5';
|
||||||
|
|
||||||
|
describe('The breadcumbs should work corectly', () => {
|
||||||
|
it('It should have a superblock and a course', () => {
|
||||||
|
cy.visit(challengeUrl);
|
||||||
|
cy.get('.ellipsis').contains('Responsive Web Design').and('be.visible');
|
||||||
|
cy.get('.breadcrumb-left')
|
||||||
|
.should('have.attr', 'href')
|
||||||
|
.and('include', superBlockUrl);
|
||||||
|
cy.get('.breadcrumb-right')
|
||||||
|
.contains('Basic HTML and HTML5')
|
||||||
|
.and('be.visible');
|
||||||
|
cy.get('.breadcrumb-right')
|
||||||
|
.should('have.attr', 'href')
|
||||||
|
.and('include', courseUrl);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should redirect to the right url', () => {
|
||||||
|
cy.visit(challengeUrl);
|
||||||
|
cy.get('.breadcrumb-left').click();
|
||||||
|
cy.url().should('include', '/responsive-web-design');
|
||||||
|
cy.visit(challengeUrl);
|
||||||
|
cy.get('.breadcrumb-right').click();
|
||||||
|
cy.url().should('include', '/responsive-web-design/#basic-html-and-html5');
|
||||||
|
});
|
||||||
|
});
|
Reference in New Issue
Block a user