test(e2e): re-enable output tests (#41897)

This time visiting the page in the 'before' stage, which seems to help
with the ChunkLoadError
pull/41942/head
Oliver Eyton-Williams 2021-04-28 16:04:07 +02:00 committed by GitHub
parent 0296abbea6
commit ebe8f99345
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 30 additions and 38 deletions

View File

@ -18,55 +18,47 @@ const defaultOutput = `
* Your test output will go here
*/`;
// Disabled for https://github.com/freeCodeCamp/freeCodeCamp/issues/41009
// const runningOutput = '// running tests';
// const finishedOutput = '// tests completed';
const runningOutput = '// running tests';
const finishedOutput = '// tests completed';
describe('Classic challenge', function () {
it('renders', () => {
before(() => {
cy.visit(locations.index);
});
it('renders the default output text', () => {
cy.title().should(
'eq',
'Learn Basic HTML and HTML5: Say Hello to HTML Elements |' +
' freeCodeCamp.org'
);
});
it('renders the default output text', () => {
cy.visit(locations.index);
cy.get(selectors.defaultOutput).contains(defaultOutput);
});
// Disabled for https://github.com/freeCodeCamp/freeCodeCamp/issues/41009
it('shows test output when the tests are run', () => {
// first wait for the editor to load
cy.get(selectors.editor, { timeout: 15000 });
cy.get(selectors.runTestsButton)
.click()
.then(() => {
cy.get(selectors.defaultOutput)
.contains(runningOutput)
.contains(finishedOutput);
});
});
// it('shows test output when the tests are run', () => {
// cy.visit(locations.index);
// // first wait for the editor to load
// cy.get(selectors.editor, { timeout: 15000 });
// cy.get(selectors.runTestsButton)
// .click()
// .then(() => {
// cy.get(selectors.defaultOutput)
// .contains(runningOutput)
// .contains(finishedOutput);
// });
// });
// it('shows test output when the tests are triggered by the keyboard', () => {
// cy.visit(locations.index);
// // first wait for the editor to load
// cy.get(selectors.editor, {
// timeout: 15000
// });
// cy.get(selectors.hotkeys)
// .focus()
// .type('{ctrl}{enter}')
// .then(() => {
// cy.get(selectors.defaultOutput)
// .contains(runningOutput)
// .contains(finishedOutput);
// });
// });
it('shows test output when the tests are triggered by the keyboard', () => {
// first wait for the editor to load
cy.get(selectors.editor, {
timeout: 15000
});
cy.get(selectors.hotkeys)
.focus()
.type('{ctrl}{enter}')
.then(() => {
cy.get(selectors.defaultOutput)
.contains(runningOutput)
.contains(finishedOutput);
});
});
});