From 65f4b086ac3a72ec9d401150529d224b2ff31ee3 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 6 Jan 2022 10:02:27 +0100 Subject: [PATCH] fix E2E --- apps/remix-ide-e2e/src/tests/gist.test.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/gist.test.ts b/apps/remix-ide-e2e/src/tests/gist.test.ts index 3761ae362c..0dcf77c5b5 100644 --- a/apps/remix-ide-e2e/src/tests/gist.test.ts +++ b/apps/remix-ide-e2e/src/tests/gist.test.ts @@ -91,6 +91,9 @@ module.exports = { .clickLaunchIcon('filePanel') .scrollAndClick('*[data-id="landingPageImportFromGistButton"]') .waitForElementVisible('*[data-id="gisthandlerModalDialogModalBody-react"] input[data-id="modalDialogCustomPromp"]') + .execute(() => { + (document.querySelector('*[data-id="gisthandlerModalDialogModalBody-react"] input[data-id="modalDialogCustomPromp"]') as any).focus() + }, [], () => {}) .setValue('*[data-id="gisthandlerModalDialogModalBody-react"] input[data-id="modalDialogCustomPromp"]', testData.invalidGistId) .modalFooterOKClick('gisthandler') .waitForElementVisible('*[data-id="gisthandlerModalDialogModalBody-react"]') @@ -131,9 +134,12 @@ module.exports = { .click('[data-id="settingsTabSaveGistToken"]') .clickLaunchIcon('filePanel') .scrollAndClick('*[data-id="landingPageImportFromGistButton"]') - .waitForElementVisible('*[data-id="modalDialogCustomPromptText"]') - .setValue('*[data-id="modalDialogCustomPromptText"]', testData.validGistId) - .modalFooterOKClick() + .waitForElementVisible('*[data-id="gisthandlerModalDialogModalBody-react"] input[data-id="modalDialogCustomPromp"]') + .execute(() => { + (document.querySelector('*[data-id="gisthandlerModalDialogModalBody-react"] input[data-id="modalDialogCustomPromp"]') as any).focus() + }, [], () => {}) + .setValue('*[data-id="gisthandlerModalDialogModalBody-react"] input[data-id="modalDialogCustomPromp"]', testData.validGistId) + .modalFooterOKClick('gisthandler') .openFile(`gist-${testData.validGistId}/README.txt`) .waitForElementVisible(`div[title='default_workspace/gist-${testData.validGistId}/README.txt']`) .assert.containsText(`div[title='default_workspace/gist-${testData.validGistId}/README.txt'] > span`, 'README.txt')