From 564da510f1cbded7b0f0486a2db4f80353d6e843 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Fri, 16 Sep 2022 13:49:39 +0200 Subject: [PATCH] 3 times --- apps/remix-ide-e2e/src/tests/ballot.test.ts | 77 +++++++++++++++++++-- 1 file changed, 72 insertions(+), 5 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/ballot.test.ts b/apps/remix-ide-e2e/src/tests/ballot.test.ts index 9cd2f8d42b..87376c1022 100644 --- a/apps/remix-ide-e2e/src/tests/ballot.test.ts +++ b/apps/remix-ide-e2e/src/tests/ballot.test.ts @@ -138,22 +138,89 @@ module.exports = { }, 10000) .click({ selector: '*[data-id="scConfigChangeFilePath"]', - suppressNotFoundErrors: true + suppressNotFoundErrors: true, + timeout: 1000 }) .click({ selector: '*[data-id="scConfigChangeFilePath"]', - suppressNotFoundErrors: true + suppressNotFoundErrors: true, + timeout: 1000 }) .click({ selector: '*[data-id="scConfigChangeFilePath"]', - suppressNotFoundErrors: true + suppressNotFoundErrors: true, + timeout: 1000 }) .waitForElementVisible('*[data-id="scConfigFilePathInput"]', 10000) - .updateValue('*[data-id="scConfigFilePathInput"]', 'cf.json') - + .sendKeys('*[data-id="scConfigFilePathInput"]', 'compiler_config.json') .sendKeys('*[data-id="scConfigFilePathInput"]', browser.Keys.ENTER) + .isVisible({ + selector:"//*[@class='py-2 remixui_compilerConfigPath' and contains(.,'cf.json')]", + suppressNotFoundErrors: true, + locateStrategy: 'xpath' + }, (okVisible) => { + if (!okVisible.value) { + browser.waitForElementVisible({ + selector: '*[data-id="scConfigChangeFilePath"]', + abortOnFailure: false + }, 10000) + .click({ + selector: '*[data-id="scConfigChangeFilePath"]', + suppressNotFoundErrors: true, + timeout: 1000 + }) + .click({ + selector: '*[data-id="scConfigChangeFilePath"]', + suppressNotFoundErrors: true, + timeout: 1000 + }) + .click({ + selector: '*[data-id="scConfigChangeFilePath"]', + suppressNotFoundErrors: true, + timeout: 1000 + }) + + .waitForElementVisible('*[data-id="scConfigFilePathInput"]', 10000) + .sendKeys('*[data-id="scConfigFilePathInput"]', 'cf.json') + .sendKeys('*[data-id="scConfigFilePathInput"]', browser.Keys.ENTER) + } + }) + + .isVisible({ + selector:"//*[@class='py-2 remixui_compilerConfigPath' and contains(.,'cf.json')]", + suppressNotFoundErrors: true, + locateStrategy: 'xpath' + }, (okVisible) => { + if (!okVisible.value) { + browser.waitForElementVisible({ + selector: '*[data-id="scConfigChangeFilePath"]', + abortOnFailure: false + }, 10000) + .click({ + selector: '*[data-id="scConfigChangeFilePath"]', + suppressNotFoundErrors: true, + timeout: 1000 + }) + .click({ + selector: '*[data-id="scConfigChangeFilePath"]', + suppressNotFoundErrors: true, + timeout: 1000 + }) + .click({ + selector: '*[data-id="scConfigChangeFilePath"]', + suppressNotFoundErrors: true, + timeout: 1000 + }) + + .waitForElementVisible('*[data-id="scConfigFilePathInput"]', 10000) + .sendKeys('*[data-id="scConfigFilePathInput"]', 'cf.json') + .sendKeys('*[data-id="scConfigFilePathInput"]', browser.Keys.ENTER) + } + }) + + .pause(5000) .openFile('Untitled.sol') .verifyContracts(['Ballot'], { wait: 2000, runs: '300' }) },