From 999819ab4fc073531f3ecd882f5a849dee230b6a Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Mon, 28 Oct 2024 09:54:05 +0100 Subject: [PATCH 1/3] test flaky hover --- .circleci/config.yml | 2 +- apps/remix-ide-e2e/src/tests/editorHoverContext.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a02ab093d2..b415615e72 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/editorHoverContext.test.ts b/apps/remix-ide-e2e/src/tests/editorHoverContext.test.ts index 2b130875e3..68100dd154 100644 --- a/apps/remix-ide-e2e/src/tests/editorHoverContext.test.ts +++ b/apps/remix-ide-e2e/src/tests/editorHoverContext.test.ts @@ -25,7 +25,7 @@ module.exports = { .pause(4000) // wait for the compiler to finish .scrollToLine(37) }, - 'Should show hover over contract in editor #group1': function (browser: NightwatchBrowser) { + 'Should show hover over contract in editor #group1 #flaky': function (browser: NightwatchBrowser) { const path = "//*[contains(text(),'BallotHoverTest')]" checkEditorHoverContent(browser, path, 'contract BallotHoverTest is BallotHoverTest') checkEditorHoverContent(browser, path, 'contracts/3_Ballot.sol 10:0') From 835ab82382e93010e844f4468ab0f0735140ce9a Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Mon, 28 Oct 2024 10:30:10 +0100 Subject: [PATCH 2/3] fix --- .../src/tests/editorHoverContext.test.ts | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/editorHoverContext.test.ts b/apps/remix-ide-e2e/src/tests/editorHoverContext.test.ts index 68100dd154..94c6b85663 100644 --- a/apps/remix-ide-e2e/src/tests/editorHoverContext.test.ts +++ b/apps/remix-ide-e2e/src/tests/editorHoverContext.test.ts @@ -19,16 +19,17 @@ module.exports = { }, 'Should load the test file #group1': function (browser: NightwatchBrowser) { browser.openFile('contracts') - .openFile('contracts/3_Ballot.sol') - .waitForElementVisible('#editorView') - .setEditorValue(BallotWithARefToOwner) - .pause(4000) // wait for the compiler to finish + .addFile('contracts/3_BallotHover.sol', { + content: BallotWithARefToOwner + }) .scrollToLine(37) + .useXpath().waitForElementVisible("//*[@class='view-line' and contains(.,'gas')]") + }, 'Should show hover over contract in editor #group1 #flaky': function (browser: NightwatchBrowser) { const path = "//*[contains(text(),'BallotHoverTest')]" checkEditorHoverContent(browser, path, 'contract BallotHoverTest is BallotHoverTest') - checkEditorHoverContent(browser, path, 'contracts/3_Ballot.sol 10:0') + checkEditorHoverContent(browser, path, 'contracts/3_BallotHover.sol 10:0') checkEditorHoverContent(browser, path, '@title Ballot') }, 'Should show hover over var definition in editor #group1': function (browser: NightwatchBrowser) { @@ -88,13 +89,13 @@ module.exports = { }, 'Add token file #group1': function (browser: NightwatchBrowser) { browser - .clickLaunchIcon('solidity') - .setSolidityCompilerVersion('soljson-v0.8.20+commit.a1b79de6.js') - .click('*[data-id="scConfigExpander"]') - .setValue('#evmVersionSelector', 'berlin') // set target EVM for parser to berlin - .addFile('contracts/mytoken.sol', { - content: myToken - }).useXpath().waitForElementVisible("//*[@class='view-line' and contains(.,'gas')]") + .clickLaunchIcon('solidity') + .setSolidityCompilerVersion('soljson-v0.8.20+commit.a1b79de6.js') + .click('*[data-id="scConfigExpander"]') + .setValue('#evmVersionSelector', 'berlin') // set target EVM for parser to berlin + .addFile('contracts/mytoken.sol', { + content: myToken + }).useXpath().waitForElementVisible("//*[@class='view-line' and contains(.,'gas')]") }, // here we change quickly between files to test the files being parsed correctly when switching between them 'Should show ERC20 hover over contract in editor #group1': function (browser: NightwatchBrowser) { @@ -103,8 +104,12 @@ module.exports = { const expectedContent = 'contract ERC20Burnable is ERC20Burnable, ERC20, IERC20Errors, IERC20Metadata, IERC20, Context' checkEditorHoverContent(browser, path, expectedContent, 25) }, - 'Go back to ballot file': function (browser: NightwatchBrowser) { - browser.openFile('contracts/3_Ballot.sol') + 'Go back to ballot file #group1': function (browser: NightwatchBrowser) { + browser + .waitForElementVisible('*[data-id="treeViewDivDraggableItem.deps"]') + .click('*[data-id="treeViewDivDraggableItem.deps"]') + .openFile('contracts/3_BallotHover.sol') + .scrollToLine(37) .useXpath().waitForElementVisible("//*[@class='view-line' and contains(.,'gas')]") }, 'Should show hover over function in editor again #group1': function (browser: NightwatchBrowser) { From d8283e1035ac54641a2f9c36f8d11dd2a0b1c9e8 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Mon, 28 Oct 2024 10:45:20 +0100 Subject: [PATCH 3/3] turn off flaky --- .circleci/config.yml | 2 +- apps/remix-ide-e2e/src/tests/editorHoverContext.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b415615e72..a02ab093d2 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/editorHoverContext.test.ts b/apps/remix-ide-e2e/src/tests/editorHoverContext.test.ts index 94c6b85663..dc52bcf307 100644 --- a/apps/remix-ide-e2e/src/tests/editorHoverContext.test.ts +++ b/apps/remix-ide-e2e/src/tests/editorHoverContext.test.ts @@ -26,7 +26,7 @@ module.exports = { .useXpath().waitForElementVisible("//*[@class='view-line' and contains(.,'gas')]") }, - 'Should show hover over contract in editor #group1 #flaky': function (browser: NightwatchBrowser) { + 'Should show hover over contract in editor #group1': function (browser: NightwatchBrowser) { const path = "//*[contains(text(),'BallotHoverTest')]" checkEditorHoverContent(browser, path, 'contract BallotHoverTest is BallotHoverTest') checkEditorHoverContent(browser, path, 'contracts/3_BallotHover.sol 10:0')