fix(e2e): wait for editor before running tests (#39465)
This commit is contained in:
committed by
GitHub
parent
fb77d48d13
commit
6579b502fd
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
const selectors = {
|
const selectors = {
|
||||||
defaultOutput: '.output-text',
|
defaultOutput: '.output-text',
|
||||||
|
editor: '.monaco-editor',
|
||||||
hotkeys: '.default-layout > div',
|
hotkeys: '.default-layout > div',
|
||||||
runTestsButton: 'button:contains("Run the Tests")'
|
runTestsButton: 'button:contains("Run the Tests")'
|
||||||
};
|
};
|
||||||
@ -38,6 +39,8 @@ describe('Classic challenge', function() {
|
|||||||
|
|
||||||
it('shows test output when the tests are run', () => {
|
it('shows test output when the tests are run', () => {
|
||||||
cy.visit(locations.index);
|
cy.visit(locations.index);
|
||||||
|
// first wait for the editor to load
|
||||||
|
cy.get(selectors.editor, { timeout: 10000 });
|
||||||
cy.get(selectors.runTestsButton)
|
cy.get(selectors.runTestsButton)
|
||||||
.click()
|
.click()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@ -49,6 +52,8 @@ describe('Classic challenge', function() {
|
|||||||
|
|
||||||
it('shows test output when the tests are triggered by the keyboard', () => {
|
it('shows test output when the tests are triggered by the keyboard', () => {
|
||||||
cy.visit(locations.index);
|
cy.visit(locations.index);
|
||||||
|
// first wait for the editor to load
|
||||||
|
cy.get(selectors.editor, { timeout: 10000 });
|
||||||
cy.get(selectors.hotkeys)
|
cy.get(selectors.hotkeys)
|
||||||
.focus()
|
.focus()
|
||||||
.type('{ctrl}{enter}')
|
.type('{ctrl}{enter}')
|
||||||
|
Reference in New Issue
Block a user