From 60360112f86be430bfa68ca66e51e0b7a6c1905c Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 21 Sep 2022 12:09:52 +0200 Subject: [PATCH] reset add file --- apps/remix-ide-e2e/src/commands/addFile.ts | 5 ++++- apps/remix-ide-e2e/src/tests/ballot.test.ts | 2 +- apps/remix-ide-e2e/src/tests/usingWebWorker.test.ts | 1 + apps/remix-ide/ci/browser_test.sh | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/addFile.ts b/apps/remix-ide-e2e/src/commands/addFile.ts index 86b92988c0..dbc18f9ce0 100644 --- a/apps/remix-ide-e2e/src/commands/addFile.ts +++ b/apps/remix-ide-e2e/src/commands/addFile.ts @@ -36,6 +36,7 @@ function addFile(browser: NightwatchBrowser, name: string, content: NightwatchCo timeout: 2000 }, (okVisible) => { // @ts-ignore + // status === -1 means the element is not visible, 0 means it is visible if (okVisible.status === 0) { browser.openFile(name) .perform(function () { @@ -46,8 +47,10 @@ function addFile(browser: NightwatchBrowser, name: string, content: NightwatchCo .waitForElementContainsText('*[data-id$="/blank"]', '', 60000) .sendKeys('*[data-id$="/blank"] .remixui_items', name) .sendKeys('*[data-id$="/blank"] .remixui_items', browser.Keys.ENTER) - .waitForElementVisible({ + .isVisible({ selector: `li[data-id="treeViewLitreeViewItem${name}"]`, + abortOnFailure: false, + suppressNotFoundErrors: true, timeout: 60000 }) .setEditorValue(content.content) diff --git a/apps/remix-ide-e2e/src/tests/ballot.test.ts b/apps/remix-ide-e2e/src/tests/ballot.test.ts index 7c76ae2c57..af23e3a4e0 100644 --- a/apps/remix-ide-e2e/src/tests/ballot.test.ts +++ b/apps/remix-ide-e2e/src/tests/ballot.test.ts @@ -131,7 +131,7 @@ module.exports = { .click('*[data-id="scConfigExpander"]') .waitForElementVisible('*[data-id="scFileConfiguration"]', 10000) .click('*[data-id="scFileConfiguration"]') - + // the input field behaves badly, it would often not receive the value, so retrying it a few times for now is the best thing to do .waitForElementVisible({ selector: '*[data-id="scConfigChangeFilePath"]', abortOnFailure: false diff --git a/apps/remix-ide-e2e/src/tests/usingWebWorker.test.ts b/apps/remix-ide-e2e/src/tests/usingWebWorker.test.ts index d9e0689bb2..f7b51487a6 100644 --- a/apps/remix-ide-e2e/src/tests/usingWebWorker.test.ts +++ b/apps/remix-ide-e2e/src/tests/usingWebWorker.test.ts @@ -29,6 +29,7 @@ module.exports = { }, 'Using Web Worker #group1': function (browser: NightwatchBrowser) { browser + // using autocompile when switching compilers quickly confuses the process and results in a wrong compiler version being used or results displayed .waitForElementVisible('[for="autoCompile"]') .click('[for="autoCompile"]') .waitForElementVisible('[data-id="compilerNightliesBuild"]') diff --git a/apps/remix-ide/ci/browser_test.sh b/apps/remix-ide/ci/browser_test.sh index 4149f4fda7..ec2b9144cb 100755 --- a/apps/remix-ide/ci/browser_test.sh +++ b/apps/remix-ide/ci/browser_test.sh @@ -21,7 +21,7 @@ yarn run build:e2e node apps/remix-ide/ci/splice_tests.js $2 $3 TESTFILES=$(node apps/remix-ide/ci/splice_tests.js $2 $3 | circleci tests split --split-by=timings) for TESTFILE in $TESTFILES; do - npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/${TESTFILE}.js --env=$1 || TEST_EXITCODE=1 + npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js ${TESTFILE}.js --env=$1 || TEST_EXITCODE=1 done echo "$TEST_EXITCODE"