Merge pull request #5340 from ethereum/flakyhover

Flaky hover test
pull/5345/head
bunsenstraat 3 weeks ago committed by GitHub
commit 8856fa27cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 33
      apps/remix-ide-e2e/src/tests/editorHoverContext.test.ts

@ -19,16 +19,17 @@ module.exports = {
}, },
'Should load the test file #group1': function (browser: NightwatchBrowser) { 'Should load the test file #group1': function (browser: NightwatchBrowser) {
browser.openFile('contracts') browser.openFile('contracts')
.openFile('contracts/3_Ballot.sol') .addFile('contracts/3_BallotHover.sol', {
.waitForElementVisible('#editorView') content: BallotWithARefToOwner
.setEditorValue(BallotWithARefToOwner) })
.pause(4000) // wait for the compiler to finish
.scrollToLine(37) .scrollToLine(37)
.useXpath().waitForElementVisible("//*[@class='view-line' and contains(.,'gas')]")
}, },
'Should show hover over contract in editor #group1': function (browser: NightwatchBrowser) { 'Should show hover over contract in editor #group1': function (browser: NightwatchBrowser) {
const path = "//*[contains(text(),'BallotHoverTest')]" const path = "//*[contains(text(),'BallotHoverTest')]"
checkEditorHoverContent(browser, path, 'contract BallotHoverTest is 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') checkEditorHoverContent(browser, path, '@title Ballot')
}, },
'Should show hover over var definition in editor #group1': function (browser: NightwatchBrowser) { '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) { 'Add token file #group1': function (browser: NightwatchBrowser) {
browser browser
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
.setSolidityCompilerVersion('soljson-v0.8.20+commit.a1b79de6.js') .setSolidityCompilerVersion('soljson-v0.8.20+commit.a1b79de6.js')
.click('*[data-id="scConfigExpander"]') .click('*[data-id="scConfigExpander"]')
.setValue('#evmVersionSelector', 'berlin') // set target EVM for parser to berlin .setValue('#evmVersionSelector', 'berlin') // set target EVM for parser to berlin
.addFile('contracts/mytoken.sol', { .addFile('contracts/mytoken.sol', {
content: myToken content: myToken
}).useXpath().waitForElementVisible("//*[@class='view-line' and contains(.,'gas')]") }).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 // 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) { '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' const expectedContent = 'contract ERC20Burnable is ERC20Burnable, ERC20, IERC20Errors, IERC20Metadata, IERC20, Context'
checkEditorHoverContent(browser, path, expectedContent, 25) checkEditorHoverContent(browser, path, expectedContent, 25)
}, },
'Go back to ballot file': function (browser: NightwatchBrowser) { 'Go back to ballot file #group1': function (browser: NightwatchBrowser) {
browser.openFile('contracts/3_Ballot.sol') 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')]") .useXpath().waitForElementVisible("//*[@class='view-line' and contains(.,'gas')]")
}, },
'Should show hover over function in editor again #group1': function (browser: NightwatchBrowser) { 'Should show hover over function in editor again #group1': function (browser: NightwatchBrowser) {

Loading…
Cancel
Save