From 3a52b176b69e288b684a8a7762d93279e6a449d7 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 5 May 2022 07:52:54 +0200 Subject: [PATCH 1/3] set flaky test --- .circleci/config.yml | 2 +- apps/remix-ide-e2e/src/tests/workspace.test.ts | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 11c6ede82b..cc732d6931 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ version: 2.1 parameters: run_flaky_tests: type: boolean - default: false + default: true orbs: browser-tools: circleci/browser-tools@1.2.3 jobs: diff --git a/apps/remix-ide-e2e/src/tests/workspace.test.ts b/apps/remix-ide-e2e/src/tests/workspace.test.ts index 15c9e34294..e9a044f2be 100644 --- a/apps/remix-ide-e2e/src/tests/workspace.test.ts +++ b/apps/remix-ide-e2e/src/tests/workspace.test.ts @@ -4,6 +4,7 @@ import init from '../helpers/init' import sauce from './sauce' module.exports = { + '@disabled': true, before: function (browser: NightwatchBrowser, done: VoidFunction) { init(browser, done, 'http://127.0.0.1:8080?activate=solidity,udapp&call=fileManager//open//contracts/3_Ballot.sol&deactivate=home', false) }, @@ -15,7 +16,7 @@ module.exports = { .clickLaunchIcon('udapp') }, - 'Editor should be focused on the 3_Ballot.sol': function (browser: NightwatchBrowser) { + 'Editor should be focused on the 3_Ballot.sol #group1': function (browser: NightwatchBrowser) { browser .pause(5000) .refresh() @@ -25,12 +26,12 @@ module.exports = { }) }, - 'Home page should be deactivated': function (browser: NightwatchBrowser) { + 'Home page should be deactivated #group1': function (browser: NightwatchBrowser) { browser .waitForElementNotPresent('[data-id="landingPageHomeContainer"]') }, - 'Should create two workspace and switch to the first one': function (browser: NightwatchBrowser) { + 'Should create two workspace and switch to the first one #group1': function (browser: NightwatchBrowser) { browser .clickLaunchIcon('filePanel') .click('*[data-id="workspaceCreate"]') // create workspace_name @@ -59,7 +60,7 @@ module.exports = { .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]') }, - 'Should rename a workspace': function (browser: NightwatchBrowser) { + 'Should rename a workspace #group1 #flaky': function (browser: NightwatchBrowser) { browser .click('*[data-id="workspaceRename"]') // rename workspace_name .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]') @@ -78,7 +79,7 @@ module.exports = { .waitForElementVisible('*[data-id="treeViewLitreeViewItemtest.sol"]') }, - 'Should delete a workspace': function (browser: NightwatchBrowser) { + 'Should delete a workspace #group1': function (browser: NightwatchBrowser) { browser .click('*[data-id="workspacesSelect"] option[value="workspace_name_1"]') .click('*[data-id="workspaceDelete"]') // delete workspace_name_1 From e030e77e3d24ed37eb2084abf5061d59bbd1e202 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 5 May 2022 08:15:00 +0200 Subject: [PATCH 2/3] rewrite tests --- .../remix-ide-e2e/src/tests/workspace.test.ts | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/workspace.test.ts b/apps/remix-ide-e2e/src/tests/workspace.test.ts index e9a044f2be..4447b0bdd9 100644 --- a/apps/remix-ide-e2e/src/tests/workspace.test.ts +++ b/apps/remix-ide-e2e/src/tests/workspace.test.ts @@ -37,10 +37,11 @@ module.exports = { .click('*[data-id="workspaceCreate"]') // create workspace_name .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') .waitForElementVisible('[data-id="fileSystemModalDialogModalFooter-react"] > span') - // eslint-disable-next-line dot-notation - .execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'workspace_name' }) + .click('*[data-id="modalDialogCustomPromptTextCreate"]') + .clearValue('*[data-id="modalDialogCustomPromptTextCreate"]') + .setValue('*[data-id="modalDialogCustomPromptTextCreate"]', 'workspace_name') .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') - .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) + .click('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]') .pause(1000) .addFile('test.sol', { content: 'test' }) @@ -48,10 +49,11 @@ module.exports = { .click('*[data-id="workspaceCreate"]') // create workspace_name_1 .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') .waitForElementVisible('[data-id="fileSystemModalDialogModalFooter-react"] > span') - // eslint-disable-next-line dot-notation - .execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'workspace_name_1' }) + .click('*[data-id="modalDialogCustomPromptTextCreate"]') + .clearValue('*[data-id="modalDialogCustomPromptTextCreate"]') + .setValue('*[data-id="modalDialogCustomPromptTextCreate"]', 'workspace_name_1') .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') - .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) + .click('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]') .pause(2000) .waitForElementNotPresent('*[data-id="treeViewLitreeViewItemtest.sol"]') @@ -65,10 +67,11 @@ module.exports = { .click('*[data-id="workspaceRename"]') // rename workspace_name .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]') .waitForElementVisible('*[data-id="modalDialogCustomPromptTextRename"]') - // eslint-disable-next-line dot-notation - .execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextRename"]')['value'] = 'workspace_name_renamed' }) + .click('*[data-id="modalDialogCustomPromptTextRename"]') + .clearValue('*[data-id="modalDialogCustomPromptTextRename"]') + .setValue('*[data-id="modalDialogCustomPromptTextRename"]', 'workspace_name_renamed') .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') - .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) + .click('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') .waitForElementPresent('*[data-id="workspacesSelect"] option[value="workspace_name_1"]') .click('*[data-id="workspacesSelect"] option[value="workspace_name_1"]') .pause(2000) @@ -84,7 +87,7 @@ module.exports = { .click('*[data-id="workspacesSelect"] option[value="workspace_name_1"]') .click('*[data-id="workspaceDelete"]') // delete workspace_name_1 .waitForElementVisible('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') - .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) + .click('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') .waitForElementNotPresent('*[data-id="workspacesSelect"] option[value="workspace_name_1"]') .end() }, From 3f235116b58141809eb07b30ea13c2f8716ac509 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 5 May 2022 08:30:28 +0200 Subject: [PATCH 3/3] turn off flaky tests --- .circleci/config.yml | 2 +- apps/remix-ide-e2e/src/tests/workspace.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cc732d6931..11c6ede82b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ version: 2.1 parameters: run_flaky_tests: type: boolean - default: true + default: false orbs: browser-tools: circleci/browser-tools@1.2.3 jobs: diff --git a/apps/remix-ide-e2e/src/tests/workspace.test.ts b/apps/remix-ide-e2e/src/tests/workspace.test.ts index 4447b0bdd9..b9daeaa543 100644 --- a/apps/remix-ide-e2e/src/tests/workspace.test.ts +++ b/apps/remix-ide-e2e/src/tests/workspace.test.ts @@ -62,7 +62,7 @@ module.exports = { .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]') }, - 'Should rename a workspace #group1 #flaky': function (browser: NightwatchBrowser) { + 'Should rename a workspace #group1': function (browser: NightwatchBrowser) { browser .click('*[data-id="workspaceRename"]') // rename workspace_name .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]')