From 1c064a436373eb739d6fd41ae83ad92eaa95a25e Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 21 Sep 2022 16:06:52 +0200 Subject: [PATCH 1/6] fix command --- .../src/commands/debugTransaction.ts | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/debugTransaction.ts b/apps/remix-ide-e2e/src/commands/debugTransaction.ts index 67955ea38d..2347d8d939 100644 --- a/apps/remix-ide-e2e/src/commands/debugTransaction.ts +++ b/apps/remix-ide-e2e/src/commands/debugTransaction.ts @@ -2,7 +2,7 @@ import { NightwatchBrowser } from 'nightwatch' import EventEmitter from 'events' class debugTransaction extends EventEmitter { - command (this: NightwatchBrowser, index = 0): NightwatchBrowser { + command(this: NightwatchBrowser, index = 0): NightwatchBrowser { this.api.perform((done) => { checkStyle(this.api, index, () => { done() @@ -13,14 +13,27 @@ class debugTransaction extends EventEmitter { } } -function checkStyle (browser: NightwatchBrowser, index: number, callback: VoidFunction) { - browser.pause(5000).execute(function (index: number) { +function checkStyle(browser: NightwatchBrowser, index: number, callback: VoidFunction) { + let elementsFound = 0 + browser.waitUntil(() => { + browser.findElements({ + selector: '*[data-shared="txLoggerDebugButton"]', + timeout: 60000, + }, (result) => { + if (Array.isArray(result.value) && result.value.length > 0) { + elementsFound = result.value.length + } + }) + return elementsFound > index + }, 60000) + .execute(function (index: number) { const debugBtn = document.querySelectorAll('*[data-shared="txLoggerDebugButton"]')[index] as HTMLInputElement debugBtn && debugBtn.click() }, [index], function () { browser.waitForElementVisible('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]', 60000).perform(() => callback()) }) + } module.exports = debugTransaction From 77739b87443dfcf5b85e9143d14edad580b6371e Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 21 Sep 2022 16:35:58 +0200 Subject: [PATCH 2/6] invalid source --- .../src/tests/solidityImport.test.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/apps/remix-ide-e2e/src/tests/solidityImport.test.ts b/apps/remix-ide-e2e/src/tests/solidityImport.test.ts index 8c2d94072a..2cdd6894f6 100644 --- a/apps/remix-ide-e2e/src/tests/solidityImport.test.ts +++ b/apps/remix-ide-e2e/src/tests/solidityImport.test.ts @@ -104,10 +104,27 @@ module.exports = { 'Test NPM Import (with unpkg.com) #group3': function (browser: NightwatchBrowser) { browser .setSolidityCompilerVersion('soljson-v0.8.7+commit.e28d00a7.js') + .waitForElementPresent({ + selector: `//*[@data-id='compilerloaded' and @data-version='soljson-v0.8.7+commit.e28d00a7.js']`, + locateStrategy: 'xpath', + timeout: 120000 + }) .clickLaunchIcon('filePanel') .click('li[data-id="treeViewLitreeViewItemREADME.txt"') .addFile('Untitled9.sol', sources[8]['Untitled9.sol']) + // avoid invalid source issues + .isVisible({ + selector: '*[data-id="treeViewLitreeViewItem.deps/npm/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"]', + timeout: 120000, + suppressNotFoundErrors: true + }) + .clickLaunchIcon('solidity') + .click('[data-id="compilerContainerCompileBtn"]') .clickLaunchIcon('filePanel') + .isVisible({ + selector: '*[data-id="treeViewLitreeViewItem.deps/npm/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"]', + timeout: 120000, + }) .verifyContracts(['test13', 'ERC20'], { wait: 30000 }) .end() } From ee1a117407701ce161e4371b78ac3b9ee5a101b3 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 21 Sep 2022 17:47:31 +0200 Subject: [PATCH 3/6] fix cnf --- .circleci/config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 10197c3f8a..4109095008 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2.1 parameters: run_flaky_tests: type: boolean - default: false + default: true orbs: browser-tools: circleci/browser-tools@1.4.0 jobs: @@ -81,7 +81,7 @@ jobs: type: string jobsize: type: string - parallelism: 10 + parallelism: 50 steps: - browser-tools/install-browser-tools - run: @@ -90,7 +90,6 @@ jobs: firefox --version geckodriver --version chromedriver --version - java -jar /usr/local/bin/selenium.jar --version - run: name: Check out previous test metadata command: | @@ -107,9 +106,10 @@ jobs: - run: yarn - run: yarn run downloadsolc_assets_e2e && yarn run downloadsolc_assets_dist - run: ls -la ./dist/apps/remix-ide/assets/js + - run: yarn run selenium-install - run: name: Start Selenium - command: java -jar /usr/local/bin/selenium.jar + command: yarn run selenium background: true - run: ./apps/remix-ide/ci/<< parameters.script >> << parameters.browser >> << parameters.jobsize >> << parameters.job >> - store_test_results: @@ -141,7 +141,6 @@ jobs: firefox --version geckodriver --version chromedriver --version - java -jar /usr/local/bin/selenium.jar --version name: Check install - checkout - attach_workspace: @@ -153,9 +152,10 @@ jobs: - run: yarn - run: unzip ./persist/dist.zip - run: yarn run downloadsolc_assets_e2e && yarn run downloadsolc_assets_dist + - run: yarn run selenium-install - run: name: Start Selenium - command: java -jar /usr/local/bin/selenium.jar + command: yarn run selenium background: true - run: ./apps/remix-ide/ci/<< parameters.script >> - store_test_results: From ea4612ed251330dc61a5eeef83e30862fcccfa7b Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 21 Sep 2022 17:47:54 +0200 Subject: [PATCH 4/6] turn off flaky --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4109095008..494e0b4f7b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2.1 parameters: run_flaky_tests: type: boolean - default: true + default: false orbs: browser-tools: circleci/browser-tools@1.4.0 jobs: From fa0b544d8dde782e7c16eeb7e129ce454d6a0dd1 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 21 Sep 2022 17:48:29 +0200 Subject: [PATCH 5/6] paralel --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 494e0b4f7b..e5e94aff2f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -81,7 +81,7 @@ jobs: type: string jobsize: type: string - parallelism: 50 + parallelism: 10 steps: - browser-tools/install-browser-tools - run: From 1dca4d486d335dc4010516a156d8505255db6b87 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 21 Sep 2022 18:01:06 +0200 Subject: [PATCH 6/6] rm step --- .circleci/config.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e5e94aff2f..7db0e3a2b1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -90,11 +90,6 @@ jobs: firefox --version geckodriver --version chromedriver --version - - run: - name: Check out previous test metadata - command: | - cat "${CIRCLE_INTERNAL_TASK_DATA}/circle-test-results/results.json" | jq . - ls -la "${CIRCLE_INTERNAL_TASK_DATA}/" - checkout - attach_workspace: at: .