From 91d9a736a1ec1a95bc7ba3c7719a79a0117026e5 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 28 Aug 2024 15:48:40 +0200 Subject: [PATCH 01/18] drag drop flaky test --- .circleci/config.yml | 2 +- apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index afe5c5576b..55755e31e6 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.4 win: circleci/windows@5.0 diff --git a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts index 214217af38..08d1c3ccbc 100644 --- a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts +++ b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts @@ -56,7 +56,7 @@ module.exports = { }) } }, - 'should drag and drop multiple files and folders in file explorer to contracts folder #group3': function (browser: NightwatchBrowser) { + 'should drag and drop multiple files and folders in file explorer to contracts folder #flaky #group3': function (browser: NightwatchBrowser) { const selectedElements = [] if (browser.options.desiredCapabilities?.browserName === 'firefox') { console.log('Skipping test for firefox') From ffa295c58c59ccb2120ceec87524d194d1782db1 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 28 Aug 2024 18:33:47 +0200 Subject: [PATCH 02/18] done when error --- .../tests/file_explorer_multiselect.test.ts | 60 ++++++++++++------- 1 file changed, 37 insertions(+), 23 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts index 08d1c3ccbc..99db771ca5 100644 --- a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts +++ b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts @@ -41,17 +41,24 @@ module.exports = { .perform((done) => { browser.findElement({ selector: '//*[@data-id="treeViewLitreeViewItemtests"]', locateStrategy: 'xpath' }, (el: any) => { - const id = (el as any).value.getId() - browser - .waitForElementVisible('li[data-id="treeViewLitreeViewItemtests"]') - .dragAndDrop('li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]', id) - .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') - .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) - .waitForElementVisible('li[data-id="treeViewLitreeViewItemtests/1_Storage.sol"]') - .waitForElementVisible('li[data-id="treeViewLitreeViewItemtests/2_Owner.sol"]') - .waitForElementNotPresent('li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]') - .waitForElementNotPresent('li[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]') - .perform(() => done()) + try { + const id = (el as any).value.getId(); + browser + .waitForElementVisible('li[data-id="treeViewLitreeViewItemtests"]') + .dragAndDrop('li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]', id) + .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') + .execute(function () { + (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click(); + }) + .waitForElementVisible('li[data-id="treeViewLitreeViewItemtests/1_Storage.sol"]') + .waitForElementVisible('li[data-id="treeViewLitreeViewItemtests/2_Owner.sol"]') + .waitForElementNotPresent('li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]') + .waitForElementNotPresent('li[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]') + .perform(() => done()) + } catch (error) { + console.error('An error occurred:', error) + done(error); + } }) }) } @@ -77,18 +84,25 @@ module.exports = { .perform((done) => { browser.findElement({ selector: '//*[@data-id="treeViewLitreeViewItemcontracts"]', locateStrategy: 'xpath' }, (el: any) => { - const id = (el as any).value.getId() - browser - .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts"]') - .dragAndDrop('li[data-id="treeViewLitreeViewItemtests"]', id) - .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') - .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) - .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/tests"]', 5000) - .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/README.txt"]', 5000) - .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/scripts"]', 5000) - .waitForElementNotPresent('li[data-id="treeViewLitreeViewItemtests"]') - .waitForElementNotPresent('li[data-id="treeViewLitreeViewItemREADME.txt"]') - .perform(() => done()) + try { + const id = (el as any).value.getId(); + browser + .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts"]') + .dragAndDrop('li[data-id="treeViewLitreeViewItemtests"]', id) + .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') + .execute(function () { + (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click(); + }) + .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/tests"]', 5000) + .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/README.txt"]', 5000) + .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/scripts"]', 5000) + .waitForElementNotPresent('li[data-id="treeViewLitreeViewItemtests"]') + .waitForElementNotPresent('li[data-id="treeViewLitreeViewItemREADME.txt"]') + .perform(() => done()) + } catch (error) { + console.error('An error occurred:', error) + done(error) + } }) }) } From e6af6de59c9e27a3992b1e96a96cb353955b1549 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Thu, 29 Aug 2024 07:40:25 +0200 Subject: [PATCH 03/18] perform --- .../remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts index 99db771ca5..67e84a1bd8 100644 --- a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts +++ b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts @@ -57,7 +57,7 @@ module.exports = { .perform(() => done()) } catch (error) { console.error('An error occurred:', error) - done(error); + browser.perform(() =>done(error)) } }) }) @@ -101,7 +101,7 @@ module.exports = { .perform(() => done()) } catch (error) { console.error('An error occurred:', error) - done(error) + browser.perform(() =>done(error)) } }) }) From 1df97b707b77e4c466a5ad477bf028377cd403d9 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Thu, 29 Aug 2024 08:10:21 +0200 Subject: [PATCH 04/18] abort on failure false --- .../tests/file_explorer_multiselect.test.ts | 72 ++++++++----------- 1 file changed, 30 insertions(+), 42 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts index 67e84a1bd8..16851ab337 100644 --- a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts +++ b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts @@ -7,7 +7,7 @@ module.exports = { init(browser, done) }, - 'Should select multiple items in file explorer #group1': function (browser: NightwatchBrowser) { + 'Should select multiple items in file explorer #flaky #group1': function (browser: NightwatchBrowser) { const selectedElements = [] browser .openFile('contracts') @@ -20,10 +20,11 @@ module.exports = { selectedElements.push(el) }) browser.selectFiles(selectedElements) - .assert.visible('.bg-secondary[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]') - .assert.visible('.bg-secondary[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]') - .assert.visible('.bg-secondary[data-id="treeViewLitreeViewItemtests"]') + .assert.visible({ selector: '.bg-secondary[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]', abortOnFailure: false }) + .assert.visible({ selector: '.bg-secondary[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]', abortOnFailure: false }) + .assert.visible({ selector: '.bg-secondary[data-id="treeViewLitreeViewItemtests"]', abortOnFailure: false }) }, + 'Should drag and drop multiple files in file explorer to tests folder #group1': function (browser: NightwatchBrowser) { const selectedElements = [] if (browser.options.desiredCapabilities?.browserName === 'firefox') { @@ -41,29 +42,23 @@ module.exports = { .perform((done) => { browser.findElement({ selector: '//*[@data-id="treeViewLitreeViewItemtests"]', locateStrategy: 'xpath' }, (el: any) => { - try { - const id = (el as any).value.getId(); - browser - .waitForElementVisible('li[data-id="treeViewLitreeViewItemtests"]') - .dragAndDrop('li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]', id) - .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') - .execute(function () { - (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click(); - }) - .waitForElementVisible('li[data-id="treeViewLitreeViewItemtests/1_Storage.sol"]') - .waitForElementVisible('li[data-id="treeViewLitreeViewItemtests/2_Owner.sol"]') - .waitForElementNotPresent('li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]') - .waitForElementNotPresent('li[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]') - .perform(() => done()) - } catch (error) { - console.error('An error occurred:', error) - browser.perform(() =>done(error)) - } + const id = (el as any).value.getId() + browser + .waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemtests"]', abortOnFailure: false }) + .dragAndDrop('li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]', id) + .waitForElementPresent({ selector: '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok', abortOnFailure: false }) + .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) + .waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemtests/1_Storage.sol"]', abortOnFailure: false }) + .waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemtests/2_Owner.sol"]', abortOnFailure: false }) + .waitForElementNotPresent({ selector: 'li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]', abortOnFailure: false }) + .waitForElementNotPresent({ selector: 'li[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]', abortOnFailure: false }) + .perform(() => done()) }) }) } }, - 'should drag and drop multiple files and folders in file explorer to contracts folder #flaky #group3': function (browser: NightwatchBrowser) { + + 'should drag and drop multiple files and folders in file explorer to contracts folder #group3': function (browser: NightwatchBrowser) { const selectedElements = [] if (browser.options.desiredCapabilities?.browserName === 'firefox') { console.log('Skipping test for firefox') @@ -84,25 +79,18 @@ module.exports = { .perform((done) => { browser.findElement({ selector: '//*[@data-id="treeViewLitreeViewItemcontracts"]', locateStrategy: 'xpath' }, (el: any) => { - try { - const id = (el as any).value.getId(); - browser - .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts"]') - .dragAndDrop('li[data-id="treeViewLitreeViewItemtests"]', id) - .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') - .execute(function () { - (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click(); - }) - .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/tests"]', 5000) - .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/README.txt"]', 5000) - .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/scripts"]', 5000) - .waitForElementNotPresent('li[data-id="treeViewLitreeViewItemtests"]') - .waitForElementNotPresent('li[data-id="treeViewLitreeViewItemREADME.txt"]') - .perform(() => done()) - } catch (error) { - console.error('An error occurred:', error) - browser.perform(() =>done(error)) - } + const id = (el as any).value.getId() + browser + .waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemcontracts"]', abortOnFailure: false }) + .dragAndDrop('li[data-id="treeViewLitreeViewItemtests"]', id) + .waitForElementPresent({ selector: '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok', abortOnFailure: false }) + .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) + .waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemcontracts/tests"]', abortOnFailure: false }) + .waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemcontracts/README.txt"]', abortOnFailure: false }) + .waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemcontracts/scripts"]', abortOnFailure: false }) + .waitForElementNotPresent({ selector: 'li[data-id="treeViewLitreeViewItemtests"]', abortOnFailure: false }) + .waitForElementNotPresent({ selector: 'li[data-id="treeViewLitreeViewItemREADME.txt"]', abortOnFailure: false }) + .perform(() => done()) }) }) } From ad39c7cd01b0bade9055c5ae537de32c099e0695 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Thu, 29 Aug 2024 08:12:07 +0200 Subject: [PATCH 05/18] restore --- .../src/tests/file_explorer_multiselect.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts index 16851ab337..75cc1b4d88 100644 --- a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts +++ b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts @@ -20,9 +20,9 @@ module.exports = { selectedElements.push(el) }) browser.selectFiles(selectedElements) - .assert.visible({ selector: '.bg-secondary[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]', abortOnFailure: false }) - .assert.visible({ selector: '.bg-secondary[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]', abortOnFailure: false }) - .assert.visible({ selector: '.bg-secondary[data-id="treeViewLitreeViewItemtests"]', abortOnFailure: false }) + .assert.visible('.bg-secondary[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]') + .assert.visible('.bg-secondary[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]') + .assert.visible('.bg-secondary[data-id="treeViewLitreeViewItemtests"]') }, 'Should drag and drop multiple files in file explorer to tests folder #group1': function (browser: NightwatchBrowser) { From c98d8ea4c44d817dd49fbe433aab1b4fa96db85b Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Thu, 29 Aug 2024 08:22:13 +0200 Subject: [PATCH 06/18] error on purpose --- apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts index 75cc1b4d88..1ec8e38e56 100644 --- a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts +++ b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts @@ -45,7 +45,7 @@ module.exports = { const id = (el as any).value.getId() browser .waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemtests"]', abortOnFailure: false }) - .dragAndDrop('li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]', id) + .dragAndDrop('li[data-id="treeViewLitreeViewItemcontracts/2_Storage.sol"]', id) .waitForElementPresent({ selector: '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok', abortOnFailure: false }) .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) .waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemtests/1_Storage.sol"]', abortOnFailure: false }) From 00857cdde09c5c0f381a3a5109454873e4b9a44b Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Thu, 29 Aug 2024 08:47:34 +0200 Subject: [PATCH 07/18] group3 --- .../remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts index 1ec8e38e56..3f09a92899 100644 --- a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts +++ b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts @@ -45,7 +45,7 @@ module.exports = { const id = (el as any).value.getId() browser .waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemtests"]', abortOnFailure: false }) - .dragAndDrop('li[data-id="treeViewLitreeViewItemcontracts/2_Storage.sol"]', id) + .dragAndDrop('li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]', id) .waitForElementPresent({ selector: '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok', abortOnFailure: false }) .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) .waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemtests/1_Storage.sol"]', abortOnFailure: false }) @@ -58,7 +58,7 @@ module.exports = { } }, - 'should drag and drop multiple files and folders in file explorer to contracts folder #group3': function (browser: NightwatchBrowser) { + 'should drag and drop multiple files and folders in file explorer to contracts folder #flaky #group3': function (browser: NightwatchBrowser) { const selectedElements = [] if (browser.options.desiredCapabilities?.browserName === 'firefox') { console.log('Skipping test for firefox') From 7ed6cf211db39ee9578daaec58e76cd5a1ce46ac Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Thu, 29 Aug 2024 09:09:00 +0200 Subject: [PATCH 08/18] unflaky --- .circleci/config.yml | 2 +- .../remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 55755e31e6..afe5c5576b 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.4 win: circleci/windows@5.0 diff --git a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts index 3f09a92899..aee00e1410 100644 --- a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts +++ b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts @@ -7,7 +7,7 @@ module.exports = { init(browser, done) }, - 'Should select multiple items in file explorer #flaky #group1': function (browser: NightwatchBrowser) { + 'Should select multiple items in file explorer #group1': function (browser: NightwatchBrowser) { const selectedElements = [] browser .openFile('contracts') @@ -58,7 +58,7 @@ module.exports = { } }, - 'should drag and drop multiple files and folders in file explorer to contracts folder #flaky #group3': function (browser: NightwatchBrowser) { + 'should drag and drop multiple files and folders in file explorer to contracts folder #group3': function (browser: NightwatchBrowser) { const selectedElements = [] if (browser.options.desiredCapabilities?.browserName === 'firefox') { console.log('Skipping test for firefox') From 9825f8b11dc0711379169091683d31d6cec4aa63 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 28 Aug 2024 15:48:40 +0200 Subject: [PATCH 09/18] drag drop flaky test --- .circleci/config.yml | 2 +- apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index afe5c5576b..55755e31e6 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.4 win: circleci/windows@5.0 diff --git a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts index 214217af38..08d1c3ccbc 100644 --- a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts +++ b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts @@ -56,7 +56,7 @@ module.exports = { }) } }, - 'should drag and drop multiple files and folders in file explorer to contracts folder #group3': function (browser: NightwatchBrowser) { + 'should drag and drop multiple files and folders in file explorer to contracts folder #flaky #group3': function (browser: NightwatchBrowser) { const selectedElements = [] if (browser.options.desiredCapabilities?.browserName === 'firefox') { console.log('Skipping test for firefox') From b94b850391dd39fc2d7b89a47344e355f6644770 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 28 Aug 2024 18:33:47 +0200 Subject: [PATCH 10/18] done when error --- .../tests/file_explorer_multiselect.test.ts | 60 ++++++++++++------- 1 file changed, 37 insertions(+), 23 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts index 08d1c3ccbc..99db771ca5 100644 --- a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts +++ b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts @@ -41,17 +41,24 @@ module.exports = { .perform((done) => { browser.findElement({ selector: '//*[@data-id="treeViewLitreeViewItemtests"]', locateStrategy: 'xpath' }, (el: any) => { - const id = (el as any).value.getId() - browser - .waitForElementVisible('li[data-id="treeViewLitreeViewItemtests"]') - .dragAndDrop('li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]', id) - .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') - .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) - .waitForElementVisible('li[data-id="treeViewLitreeViewItemtests/1_Storage.sol"]') - .waitForElementVisible('li[data-id="treeViewLitreeViewItemtests/2_Owner.sol"]') - .waitForElementNotPresent('li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]') - .waitForElementNotPresent('li[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]') - .perform(() => done()) + try { + const id = (el as any).value.getId(); + browser + .waitForElementVisible('li[data-id="treeViewLitreeViewItemtests"]') + .dragAndDrop('li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]', id) + .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') + .execute(function () { + (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click(); + }) + .waitForElementVisible('li[data-id="treeViewLitreeViewItemtests/1_Storage.sol"]') + .waitForElementVisible('li[data-id="treeViewLitreeViewItemtests/2_Owner.sol"]') + .waitForElementNotPresent('li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]') + .waitForElementNotPresent('li[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]') + .perform(() => done()) + } catch (error) { + console.error('An error occurred:', error) + done(error); + } }) }) } @@ -77,18 +84,25 @@ module.exports = { .perform((done) => { browser.findElement({ selector: '//*[@data-id="treeViewLitreeViewItemcontracts"]', locateStrategy: 'xpath' }, (el: any) => { - const id = (el as any).value.getId() - browser - .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts"]') - .dragAndDrop('li[data-id="treeViewLitreeViewItemtests"]', id) - .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') - .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) - .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/tests"]', 5000) - .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/README.txt"]', 5000) - .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/scripts"]', 5000) - .waitForElementNotPresent('li[data-id="treeViewLitreeViewItemtests"]') - .waitForElementNotPresent('li[data-id="treeViewLitreeViewItemREADME.txt"]') - .perform(() => done()) + try { + const id = (el as any).value.getId(); + browser + .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts"]') + .dragAndDrop('li[data-id="treeViewLitreeViewItemtests"]', id) + .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') + .execute(function () { + (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click(); + }) + .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/tests"]', 5000) + .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/README.txt"]', 5000) + .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/scripts"]', 5000) + .waitForElementNotPresent('li[data-id="treeViewLitreeViewItemtests"]') + .waitForElementNotPresent('li[data-id="treeViewLitreeViewItemREADME.txt"]') + .perform(() => done()) + } catch (error) { + console.error('An error occurred:', error) + done(error) + } }) }) } From 17b218bf7a50e639673350370aa84a7e6d6455f6 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Thu, 29 Aug 2024 07:40:25 +0200 Subject: [PATCH 11/18] perform --- .../remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts index 99db771ca5..67e84a1bd8 100644 --- a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts +++ b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts @@ -57,7 +57,7 @@ module.exports = { .perform(() => done()) } catch (error) { console.error('An error occurred:', error) - done(error); + browser.perform(() =>done(error)) } }) }) @@ -101,7 +101,7 @@ module.exports = { .perform(() => done()) } catch (error) { console.error('An error occurred:', error) - done(error) + browser.perform(() =>done(error)) } }) }) From 12d1d375a130d5ec1a3a39b74fcc84b619a22df2 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Thu, 29 Aug 2024 08:10:21 +0200 Subject: [PATCH 12/18] abort on failure false --- .../tests/file_explorer_multiselect.test.ts | 72 ++++++++----------- 1 file changed, 30 insertions(+), 42 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts index 67e84a1bd8..16851ab337 100644 --- a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts +++ b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts @@ -7,7 +7,7 @@ module.exports = { init(browser, done) }, - 'Should select multiple items in file explorer #group1': function (browser: NightwatchBrowser) { + 'Should select multiple items in file explorer #flaky #group1': function (browser: NightwatchBrowser) { const selectedElements = [] browser .openFile('contracts') @@ -20,10 +20,11 @@ module.exports = { selectedElements.push(el) }) browser.selectFiles(selectedElements) - .assert.visible('.bg-secondary[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]') - .assert.visible('.bg-secondary[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]') - .assert.visible('.bg-secondary[data-id="treeViewLitreeViewItemtests"]') + .assert.visible({ selector: '.bg-secondary[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]', abortOnFailure: false }) + .assert.visible({ selector: '.bg-secondary[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]', abortOnFailure: false }) + .assert.visible({ selector: '.bg-secondary[data-id="treeViewLitreeViewItemtests"]', abortOnFailure: false }) }, + 'Should drag and drop multiple files in file explorer to tests folder #group1': function (browser: NightwatchBrowser) { const selectedElements = [] if (browser.options.desiredCapabilities?.browserName === 'firefox') { @@ -41,29 +42,23 @@ module.exports = { .perform((done) => { browser.findElement({ selector: '//*[@data-id="treeViewLitreeViewItemtests"]', locateStrategy: 'xpath' }, (el: any) => { - try { - const id = (el as any).value.getId(); - browser - .waitForElementVisible('li[data-id="treeViewLitreeViewItemtests"]') - .dragAndDrop('li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]', id) - .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') - .execute(function () { - (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click(); - }) - .waitForElementVisible('li[data-id="treeViewLitreeViewItemtests/1_Storage.sol"]') - .waitForElementVisible('li[data-id="treeViewLitreeViewItemtests/2_Owner.sol"]') - .waitForElementNotPresent('li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]') - .waitForElementNotPresent('li[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]') - .perform(() => done()) - } catch (error) { - console.error('An error occurred:', error) - browser.perform(() =>done(error)) - } + const id = (el as any).value.getId() + browser + .waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemtests"]', abortOnFailure: false }) + .dragAndDrop('li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]', id) + .waitForElementPresent({ selector: '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok', abortOnFailure: false }) + .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) + .waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemtests/1_Storage.sol"]', abortOnFailure: false }) + .waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemtests/2_Owner.sol"]', abortOnFailure: false }) + .waitForElementNotPresent({ selector: 'li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]', abortOnFailure: false }) + .waitForElementNotPresent({ selector: 'li[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]', abortOnFailure: false }) + .perform(() => done()) }) }) } }, - 'should drag and drop multiple files and folders in file explorer to contracts folder #flaky #group3': function (browser: NightwatchBrowser) { + + 'should drag and drop multiple files and folders in file explorer to contracts folder #group3': function (browser: NightwatchBrowser) { const selectedElements = [] if (browser.options.desiredCapabilities?.browserName === 'firefox') { console.log('Skipping test for firefox') @@ -84,25 +79,18 @@ module.exports = { .perform((done) => { browser.findElement({ selector: '//*[@data-id="treeViewLitreeViewItemcontracts"]', locateStrategy: 'xpath' }, (el: any) => { - try { - const id = (el as any).value.getId(); - browser - .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts"]') - .dragAndDrop('li[data-id="treeViewLitreeViewItemtests"]', id) - .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') - .execute(function () { - (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click(); - }) - .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/tests"]', 5000) - .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/README.txt"]', 5000) - .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/scripts"]', 5000) - .waitForElementNotPresent('li[data-id="treeViewLitreeViewItemtests"]') - .waitForElementNotPresent('li[data-id="treeViewLitreeViewItemREADME.txt"]') - .perform(() => done()) - } catch (error) { - console.error('An error occurred:', error) - browser.perform(() =>done(error)) - } + const id = (el as any).value.getId() + browser + .waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemcontracts"]', abortOnFailure: false }) + .dragAndDrop('li[data-id="treeViewLitreeViewItemtests"]', id) + .waitForElementPresent({ selector: '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok', abortOnFailure: false }) + .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) + .waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemcontracts/tests"]', abortOnFailure: false }) + .waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemcontracts/README.txt"]', abortOnFailure: false }) + .waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemcontracts/scripts"]', abortOnFailure: false }) + .waitForElementNotPresent({ selector: 'li[data-id="treeViewLitreeViewItemtests"]', abortOnFailure: false }) + .waitForElementNotPresent({ selector: 'li[data-id="treeViewLitreeViewItemREADME.txt"]', abortOnFailure: false }) + .perform(() => done()) }) }) } From 6c95b2543031e4b1aace5876fc071bcb6e6411d9 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Thu, 29 Aug 2024 08:12:07 +0200 Subject: [PATCH 13/18] restore --- .../src/tests/file_explorer_multiselect.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts index 16851ab337..75cc1b4d88 100644 --- a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts +++ b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts @@ -20,9 +20,9 @@ module.exports = { selectedElements.push(el) }) browser.selectFiles(selectedElements) - .assert.visible({ selector: '.bg-secondary[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]', abortOnFailure: false }) - .assert.visible({ selector: '.bg-secondary[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]', abortOnFailure: false }) - .assert.visible({ selector: '.bg-secondary[data-id="treeViewLitreeViewItemtests"]', abortOnFailure: false }) + .assert.visible('.bg-secondary[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]') + .assert.visible('.bg-secondary[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]') + .assert.visible('.bg-secondary[data-id="treeViewLitreeViewItemtests"]') }, 'Should drag and drop multiple files in file explorer to tests folder #group1': function (browser: NightwatchBrowser) { From cd02c1b29e83081140dd7f4b973b8bf5e81253a3 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Thu, 29 Aug 2024 08:22:13 +0200 Subject: [PATCH 14/18] error on purpose --- apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts index 75cc1b4d88..1ec8e38e56 100644 --- a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts +++ b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts @@ -45,7 +45,7 @@ module.exports = { const id = (el as any).value.getId() browser .waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemtests"]', abortOnFailure: false }) - .dragAndDrop('li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]', id) + .dragAndDrop('li[data-id="treeViewLitreeViewItemcontracts/2_Storage.sol"]', id) .waitForElementPresent({ selector: '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok', abortOnFailure: false }) .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) .waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemtests/1_Storage.sol"]', abortOnFailure: false }) From daffeeb33def572e09103191cc330428ae558785 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Thu, 29 Aug 2024 08:47:34 +0200 Subject: [PATCH 15/18] group3 --- .../remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts index 1ec8e38e56..3f09a92899 100644 --- a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts +++ b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts @@ -45,7 +45,7 @@ module.exports = { const id = (el as any).value.getId() browser .waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemtests"]', abortOnFailure: false }) - .dragAndDrop('li[data-id="treeViewLitreeViewItemcontracts/2_Storage.sol"]', id) + .dragAndDrop('li[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]', id) .waitForElementPresent({ selector: '[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok', abortOnFailure: false }) .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) .waitForElementVisible({ selector: 'li[data-id="treeViewLitreeViewItemtests/1_Storage.sol"]', abortOnFailure: false }) @@ -58,7 +58,7 @@ module.exports = { } }, - 'should drag and drop multiple files and folders in file explorer to contracts folder #group3': function (browser: NightwatchBrowser) { + 'should drag and drop multiple files and folders in file explorer to contracts folder #flaky #group3': function (browser: NightwatchBrowser) { const selectedElements = [] if (browser.options.desiredCapabilities?.browserName === 'firefox') { console.log('Skipping test for firefox') From f8c5e47b4b173d59ef9ab8beb293358daf1a727e Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Thu, 29 Aug 2024 09:09:00 +0200 Subject: [PATCH 16/18] unflaky --- .circleci/config.yml | 2 +- .../remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 55755e31e6..afe5c5576b 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.4 win: circleci/windows@5.0 diff --git a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts index 3f09a92899..aee00e1410 100644 --- a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts +++ b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts @@ -7,7 +7,7 @@ module.exports = { init(browser, done) }, - 'Should select multiple items in file explorer #flaky #group1': function (browser: NightwatchBrowser) { + 'Should select multiple items in file explorer #group1': function (browser: NightwatchBrowser) { const selectedElements = [] browser .openFile('contracts') @@ -58,7 +58,7 @@ module.exports = { } }, - 'should drag and drop multiple files and folders in file explorer to contracts folder #flaky #group3': function (browser: NightwatchBrowser) { + 'should drag and drop multiple files and folders in file explorer to contracts folder #group3': function (browser: NightwatchBrowser) { const selectedElements = [] if (browser.options.desiredCapabilities?.browserName === 'firefox') { console.log('Skipping test for firefox') From be93f41b27b97b2d01a66d63712c7d4e6bfdb0d4 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Thu, 29 Aug 2024 09:09:41 +0200 Subject: [PATCH 17/18] rm space --- .../remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts index aee00e1410..f809a4930c 100644 --- a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts +++ b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts @@ -7,7 +7,7 @@ module.exports = { init(browser, done) }, - 'Should select multiple items in file explorer #group1': function (browser: NightwatchBrowser) { + 'Should select multiple items in file explorer #group1': function (browser: NightwatchBrowser) { const selectedElements = [] browser .openFile('contracts') @@ -58,7 +58,7 @@ module.exports = { } }, - 'should drag and drop multiple files and folders in file explorer to contracts folder #group3': function (browser: NightwatchBrowser) { + 'should drag and drop multiple files and folders in file explorer to contracts folder #group3': function (browser: NightwatchBrowser) { const selectedElements = [] if (browser.options.desiredCapabilities?.browserName === 'firefox') { console.log('Skipping test for firefox') From a268b333d3481c92d718838b6d05bbfbce1c2158 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Thu, 29 Aug 2024 09:10:38 +0200 Subject: [PATCH 18/18] rm space --- apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts index 3a38619c67..6b07aa123b 100644 --- a/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts +++ b/apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts @@ -7,7 +7,7 @@ module.exports = { init(browser, done) }, - 'Should select multiple items in file explorer #group1': function (browser: NightwatchBrowser) { + 'Should select multiple items in file explorer #group1': function (browser: NightwatchBrowser) { const selectedElements = [] browser .openFile('contracts') @@ -24,7 +24,6 @@ module.exports = { .assert.visible('.bg-secondary[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]') .assert.visible('.bg-secondary[data-id="treeViewLitreeViewItemtests"]') }, - 'Should drag and drop multiple files in file explorer to tests folder #group1': function (browser: NightwatchBrowser) { const selectedElements = [] if (browser.options.desiredCapabilities?.browserName === 'firefox') {