feat(test, e2e) test suit for cypress (#42138)

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
Sem Bauke
2021-06-14 18:37:52 +02:00
committed by GitHub
parent 08fc4014c7
commit 22b45761a7
35 changed files with 367 additions and 55 deletions

View File

@ -1,41 +0,0 @@
/* global cy */
const selectors = {
firstBlock: '.block-ui > .block:nth-child(1) > .map-title'
};
describe('Certification intro page', () => {
before(() => {
cy.clearCookies();
cy.login();
cy.visit('/learn/responsive-web-design');
});
it('Should render', () => {
cy.title().should(
'eq',
'Responsive Web Design Certification | freeCodeCamp.org'
);
});
it('Should have certification intro text', () => {
cy.contains(
"In this Responsive Web Design Certification, you'll learn the languages that developers use to build webpages"
).should('be.visible');
});
it('First block should be expanded', () => {
cy.contains('Say Hello to HTML Elements').should('be.visible');
});
it('Second block should be closed', () => {
cy.contains('Change the Color of Text').should('not.exist');
});
it('Block should handle toggle clicks correctly', () => {
cy.get(selectors.firstBlock).click();
cy.contains('Say Hello to HTML Elements').should('not.exist');
cy.get(selectors.firstBlock).click();
cy.contains('Say Hello to HTML Elements').should('be.visible');
});
});