pull/2868/head
filip mertens 2 years ago
parent 8d970e5d7d
commit dc41649bfa
  1. 5
      apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts
  2. 8
      apps/remix-ide-e2e/src/helpers/init.ts
  3. 2
      apps/remix-ide-e2e/src/select_tests.sh
  4. 17
      apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts

@ -17,7 +17,10 @@ function goToVMtraceStep (browser: NightwatchBrowser, step: number, incr: number
.execute((step) => {
(document.querySelector('*[data-id="slider"]') as any).internal_onmouseup({ target: { value: step }})
}, [step])
.pause(10000)
.waitForElementVisible({
locateStrategy: 'xpath',
selector: `//*[@data-id="treeViewLivm trace step" and contains(.,"${step}")]")]`,
})
.perform(() => {
done()
})

@ -10,7 +10,7 @@ type LoadPlugin = {
export default function (browser: NightwatchBrowser, callback: VoidFunction, url?: string, preloadPlugins = true, loadPlugin?: LoadPlugin): void {
browser
.url(url || 'http://127.0.0.1:8080')
.pause(6000)
//.pause(6000)
.switchBrowserTab(0)
.waitForElementVisible('[id="remixTourSkipbtn"]')
.click('[id="remixTourSkipbtn"]')
@ -21,14 +21,14 @@ export default function (browser: NightwatchBrowser, callback: VoidFunction, url
localStorage.setItem('test-plugin-url', loadPlugin.url)
}, [loadPlugin])
.refresh()
.pause(6000)
.perform(done())
})
.maximizeWindow()
.fullscreenWindow(() => {
if (preloadPlugins) {
initModules(browser, () => {
browser.pause(2000).clickLaunchIcon('solidity')
browser
.clickLaunchIcon('solidity')
.waitForElementVisible('[for="autoCompile"]')
.click('[for="autoCompile"]')
.verify.elementPresent('[data-id="compilerContainerAutoCompile"]:checked')
@ -41,7 +41,7 @@ export default function (browser: NightwatchBrowser, callback: VoidFunction, url
}
function initModules (browser: NightwatchBrowser, callback: VoidFunction) {
browser.pause(5000)
browser
.click('[data-id="verticalIconsKindpluginManager"]')
.scrollAndClick('[data-id="pluginManagerComponentActivateButtonsolidityStaticAnalysis"]')
.scrollAndClick('[data-id="pluginManagerComponentActivateButtondebugger"]')

@ -31,7 +31,7 @@ do
done
yarn run build:e2e
PS3='Select a test or command: '
TESTFILES=( $(grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test\|plugin_api" | sort ) )
TESTFILES=( $(grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | sort ) )
# declare -p TESTFILES
TESTFILES+=("list")

@ -271,6 +271,7 @@ module.exports = {
'Debug tests using debugger #group7': function (browser: NightwatchBrowser) {
browser
//.pause()
.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]')
.addFile('tests/ballotFailedDebug_test.sol', sources[0]['tests/ballotFailedDebug_test.sol'])
.clickLaunchIcon('solidityUnitTesting')
@ -291,9 +292,11 @@ module.exports = {
.goToVMTraceStep(316)
.waitForElementContainsText('*[data-id="functionPanel"]', 'checkWinningProposalFailed()', 60000)
.waitForElementContainsText('*[data-id="functionPanel"]', 'vote(proposal)', 60000)
.pause(5000)
.waitForElementVisible({
locateStrategy: 'xpath',
selector: "//*[@data-id='treeViewDivtreeViewItemsender' and contains(.,'Ballot.Voter')]"
})
.checkVariableDebug('soliditylocals', locals)
.pause(5000)
.clickLaunchIcon('solidityUnitTesting').pause(2000)
.scrollAndClick('#Check_winning_proposal_passed')
.waitForElementContainsText('*[data-id="sidePanelSwapitTitle"]', 'DEBUGGER', 60000)
@ -303,17 +306,19 @@ module.exports = {
.waitForElementContainsText('*[data-id="functionPanel"]', 'checkWinningProposalPassed()', 60000)
// remix_test.sol should be opened in editor
.getEditorValue((content) => browser.assert.ok(content.indexOf('library Assert {') !== -1))
.pause(5000)
.clickLaunchIcon('solidityUnitTesting').pause(2000)
.clickLaunchIcon('solidityUnitTesting')
.waitForElementPresent('#Check_winning_proposal_again')
.scrollAndClick('#Check_winning_proposal_again')
.waitForElementContainsText('*[data-id="sidePanelSwapitTitle"]', 'DEBUGGER', 60000)
.waitForElementContainsText('*[data-id="functionPanel"]', 'checkWinningProposalAgain()', 60000)
.goToVMTraceStep(1151)
.waitForElementContainsText('*[data-id="functionPanel"]', 'equal(a, b, message)', 60000)
.waitForElementContainsText('*[data-id="functionPanel"]', 'checkWinningProposalAgain()', 60000)
//.pause(5000)
.clickLaunchIcon('solidityUnitTesting')
.pause(5000)
.scrollAndClick('#Check_winnin_proposal_with_return_value')
.pause(5000)
.clickLaunchIcon('solidityUnitTesting').pause(5000)
.scrollAndClick('#Check_winnin_proposal_with_return_value').pause(5000)
.waitForElementContainsText('*[data-id="sidePanelSwapitTitle"]', 'DEBUGGER', 60000)
.waitForElementContainsText('*[data-id="functionPanel"]', 'checkWinninProposalWithReturnValue()', 60000)
.goToVMTraceStep(321)

Loading…
Cancel
Save