Skip to content

Commit ea05ffb

Browse files
committed
fix e2e
1 parent 5666348 commit ea05ffb

File tree

1 file changed

+38
-38
lines changed

1 file changed

+38
-38
lines changed

apps/remix-ide-e2e/src/tests/terminal.test.ts

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -301,17 +301,13 @@ module.exports = {
301301
})
302302
.executeScriptInTerminal(`web3.eth.getCode('0x180587b00c8642e2c7ac3a758712d97e6f7bdcc7')`) // mainnet contract
303303
.waitForElementContainsText('*[data-id="terminalJournal"]', '0x608060405260043610601f5760003560e01c80635c60da1b14603157602b565b36602b576029605f565b005b6029605f565b348015603c57600080fd5b5060436097565b6040516001600160a01b03909116815260200160405180910390f35b609560917f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b60d1565b565b600060c97f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b90565b3660008037600080366000845af43d6000803e80801560ef573d6000f35b3d6000fdfea2646970667358221220969dbb4b1d8aec2bb348e26488dc1a33b6bcf0190f567d161312ab7ca9193d8d64736f6c63430008110033', 120000)
304+
.click('*[data-id="terminalClearConsole"]')
304305
},
305306

306307
'Should connect to the sepolia fork and run web3.eth.getCode in the terminal #group9': function (browser: NightwatchBrowser) {
307308
browser
308-
.switchEnvironment('vm-custom-fork')
309-
.waitForElementPresent({
310-
locateStrategy: 'css selector',
311-
selector: 'select[data-id="runTabSelectAccount"] option[value="0xdD870fA1b7C4700F2BD7f44238821C26f7392148"]',
312-
timeout: 240000
313-
})
314-
.waitForElementPresent('[data-id="vm-custom-fork-modal-footer-ok-react"]')
309+
.switchEnvironment('vm-custom-fork')
310+
.waitForElementVisible('[data-id="vm-custom-fork-modal-footer-ok-react"]')
315311
.execute(() => {
316312
(document.querySelector('*[data-id="vm-custom-forkModalDialogContainer-react"] input[data-id="CustomForkNodeUrl"]') as any).focus()
317313
}, [], () => { })
@@ -326,41 +322,18 @@ module.exports = {
326322
.click('*[data-id="CustomForkEvmType"] [value="merge"]')
327323
.pause(5000)
328324
.modalFooterOKClick('vm-custom-fork')
325+
.waitForElementPresent({
326+
locateStrategy: 'css selector',
327+
selector: 'select[data-id="runTabSelectAccount"] option[value="0xdD870fA1b7C4700F2BD7f44238821C26f7392148"]',
328+
timeout: 240000
329+
})
329330
.pause(5000)
330331
.executeScriptInTerminal(`web3.eth.getCode('0x75F509A4eDA030470272DfBAf99A47D587E76709')`) // sepolia contract
331332
.waitForElementContainsText('*[data-id="terminalJournal"]', byteCodeInSepolia, 120000)
332-
},
333-
334-
'Should run free function which logs in the terminal #group10': function (browser: NightwatchBrowser) {
335-
const script = `import "hardhat/console.sol";
333+
.click('*[data-id="terminalClearConsole"]')
334+
},
336335

337-
function runSomething () view {
338-
console.log("test running free function");
339-
}
340-
`
341-
browser
342-
.addFile('test.sol', { content: script })
343-
.scrollToLine(3)
344-
const path = "//*[@class='view-line' and contains(.,'runSomething') and contains(.,'view')]//span//span[contains(.,'(')]"
345-
const pathRunFunction = `//li//*[@aria-label='Run the free function "runSomething"']`
346-
browser.waitForElementVisible('#editorView')
347-
.useXpath()
348-
.click(path)
349-
.pause(3000) // the parser need to parse the code
350-
.perform(function () {
351-
const actions = this.actions({ async: true });
352-
return actions
353-
.keyDown(this.Keys.SHIFT)
354-
.keyDown(this.Keys.ALT)
355-
.sendKeys('r')
356-
})
357-
.useCss()
358-
.waitForElementContainsText('*[data-id="terminalJournal"]', 'test running free function', 120000)
359-
.waitForElementNotContainsText('*[data-id="terminalJournal"]', `test running free function
360-
test running free function`, 2000)
361-
},
362-
363-
'Should run a free function while being connected to mainnet #group11': function (browser: NightwatchBrowser) {
336+
'Should run a free function while being connected to mainnet #group9': function (browser: NightwatchBrowser) {
364337
const script = `
365338
import "https://github.com/ensdomains/ens-contracts/blob/master/contracts/utils/NameEncoder.sol";
366339
import "hardhat/console.sol";
@@ -404,6 +377,33 @@ module.exports = {
404377
})
405378
.useCss()
406379
.waitForElementContainsText('*[data-id="terminalJournal"]', '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045', 120000)
380+
},
381+
382+
'Should run free function which logs in the terminal #group10': function (browser: NightwatchBrowser) {
383+
const script = `import "hardhat/console.sol";
384+
385+
function runSomething () view {
386+
console.log("test running free function");
387+
}
388+
`
389+
browser
390+
.addFile('test.sol', { content: script })
391+
.scrollToLine(3)
392+
const path = "//*[@class='view-line' and contains(.,'runSomething') and contains(.,'view')]//span//span[contains(.,'(')]"
393+
const pathRunFunction = `//li//*[@aria-label='Run the free function "runSomething"']`
394+
browser.waitForElementVisible('#editorView')
395+
.useXpath()
396+
.click(path)
397+
.pause(3000) // the parser need to parse the code
398+
.perform(function () {
399+
const actions = this.actions({ async: true });
400+
return actions
401+
.keyDown(this.Keys.SHIFT)
402+
.keyDown(this.Keys.ALT)
403+
.sendKeys('r')
404+
})
405+
.useCss()
406+
.waitForElementContainsText('*[data-id="terminalJournal"]', 'test running free function', 120000)
407407
}
408408
}
409409

0 commit comments

Comments
 (0)