From 1ce0bbb31ad6a155ba45ad8187d6312636917d53 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 22 Dec 2021 12:52:25 +0100 Subject: [PATCH] fix E2E --- .../src/tests/importFromGithub.test.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/importFromGithub.test.ts b/apps/remix-ide-e2e/src/tests/importFromGithub.test.ts index 8c8830c067..3fc73c2430 100644 --- a/apps/remix-ide-e2e/src/tests/importFromGithub.test.ts +++ b/apps/remix-ide-e2e/src/tests/importFromGithub.test.ts @@ -34,9 +34,13 @@ module.exports = { .clickLaunchIcon('settings') .clickLaunchIcon('filePanel') .scrollAndClick('*[data-id="landingPageImportFromGitHubButton"]') - .waitForElementVisible('*[data-id="homeTabModalDialogCustomPromptText"]') - .clearValue('*[data-id="homeTabModalDialogCustomPromptText"]') - .setValue('*[data-id="homeTabModalDialogCustomPromptText"]', testData.invalidURL) + .waitForElementVisible('input[data-id="homeTabModalDialogCustomPromptText"]') + .execute(() => { + // browser.setValue(query, content) is not working in this context for chrome. + // so we focus on it and use browser.keys() + (document.querySelector('input[data-id="homeTabModalDialogCustomPromptText"]') as any).focus() + }, [], () => {}) + .keys(testData.invalidURL) .waitForElementVisible('*[data-id="homeTab-modal-footer-ok-react"]') .scrollAndClick('[data-id="homeTab-modal-footer-ok-react"]') // submitted .waitForElementVisible('*[data-shared="tooltipPopup"]') @@ -51,7 +55,12 @@ module.exports = { .scrollAndClick('*[data-id="landingPageImportFromGitHubButton"]') .waitForElementVisible('*[data-id="homeTabModalDialogCustomPromptText"]') .clearValue('*[data-id="homeTabModalDialogCustomPromptText"]') - .setValue('*[data-id="homeTabModalDialogCustomPromptText"]', testData.validURL) + .execute(() => { + // browser.setValue(query, content) is not working in this context for chrome. + // so we focus on it and use browser.keys() + (document.querySelector('input[data-id="homeTabModalDialogCustomPromptText"]') as any).focus() + }, [], () => {}) + .keys(testData.validURL) .waitForElementVisible('*[data-id="homeTab-modal-footer-ok-react"]') .scrollAndClick('[data-id="homeTab-modal-footer-ok-react"]') .openFile('github/OpenZeppelin/openzeppelin-solidity/contracts/access/Roles.sol')