Merge pull request #2928 from ethereum/fixdebugtransaction

fix command
pull/5370/head
bunsenstraat 2 years ago committed by GitHub
commit e90745de81
  1. 13
      .circleci/config.yml
  2. 19
      apps/remix-ide-e2e/src/commands/debugTransaction.ts
  3. 17
      apps/remix-ide-e2e/src/tests/solidityImport.test.ts

@ -90,12 +90,6 @@ jobs:
firefox --version
geckodriver --version
chromedriver --version
java -jar /usr/local/bin/selenium.jar --version
- run:
name: Check out previous test metadata
command: |
cat "${CIRCLE_INTERNAL_TASK_DATA}/circle-test-results/results.json" | jq .
ls -la "${CIRCLE_INTERNAL_TASK_DATA}/"
- checkout
- attach_workspace:
at: .
@ -107,9 +101,10 @@ jobs:
- run: yarn
- run: yarn run downloadsolc_assets_e2e && yarn run downloadsolc_assets_dist
- run: ls -la ./dist/apps/remix-ide/assets/js
- run: yarn run selenium-install
- run:
name: Start Selenium
command: java -jar /usr/local/bin/selenium.jar
command: yarn run selenium
background: true
- run: ./apps/remix-ide/ci/<< parameters.script >> << parameters.browser >> << parameters.jobsize >> << parameters.job >>
- store_test_results:
@ -141,7 +136,6 @@ jobs:
firefox --version
geckodriver --version
chromedriver --version
java -jar /usr/local/bin/selenium.jar --version
name: Check install
- checkout
- attach_workspace:
@ -153,9 +147,10 @@ jobs:
- run: yarn
- run: unzip ./persist/dist.zip
- run: yarn run downloadsolc_assets_e2e && yarn run downloadsolc_assets_dist
- run: yarn run selenium-install
- run:
name: Start Selenium
command: java -jar /usr/local/bin/selenium.jar
command: yarn run selenium
background: true
- run: ./apps/remix-ide/ci/<< parameters.script >>
- store_test_results:

@ -2,7 +2,7 @@ import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from 'events'
class debugTransaction extends EventEmitter {
command (this: NightwatchBrowser, index = 0): NightwatchBrowser {
command(this: NightwatchBrowser, index = 0): NightwatchBrowser {
this.api.perform((done) => {
checkStyle(this.api, index, () => {
done()
@ -13,14 +13,27 @@ class debugTransaction extends EventEmitter {
}
}
function checkStyle (browser: NightwatchBrowser, index: number, callback: VoidFunction) {
browser.pause(5000).execute(function (index: number) {
function checkStyle(browser: NightwatchBrowser, index: number, callback: VoidFunction) {
let elementsFound = 0
browser.waitUntil(() => {
browser.findElements({
selector: '*[data-shared="txLoggerDebugButton"]',
timeout: 60000,
}, (result) => {
if (Array.isArray(result.value) && result.value.length > 0) {
elementsFound = result.value.length
}
})
return elementsFound > index
}, 60000)
.execute(function (index: number) {
const debugBtn = document.querySelectorAll('*[data-shared="txLoggerDebugButton"]')[index] as HTMLInputElement
debugBtn && debugBtn.click()
}, [index], function () {
browser.waitForElementVisible('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]', 60000).perform(() => callback())
})
}
module.exports = debugTransaction

@ -104,10 +104,27 @@ module.exports = {
'Test NPM Import (with unpkg.com) #group3': function (browser: NightwatchBrowser) {
browser
.setSolidityCompilerVersion('soljson-v0.8.7+commit.e28d00a7.js')
.waitForElementPresent({
selector: `//*[@data-id='compilerloaded' and @data-version='soljson-v0.8.7+commit.e28d00a7.js']`,
locateStrategy: 'xpath',
timeout: 120000
})
.clickLaunchIcon('filePanel')
.click('li[data-id="treeViewLitreeViewItemREADME.txt"')
.addFile('Untitled9.sol', sources[8]['Untitled9.sol'])
// avoid invalid source issues
.isVisible({
selector: '*[data-id="treeViewLitreeViewItem.deps/npm/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"]',
timeout: 120000,
suppressNotFoundErrors: true
})
.clickLaunchIcon('solidity')
.click('[data-id="compilerContainerCompileBtn"]')
.clickLaunchIcon('filePanel')
.isVisible({
selector: '*[data-id="treeViewLitreeViewItem.deps/npm/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"]',
timeout: 120000,
})
.verifyContracts(['test13', 'ERC20'], { wait: 30000 })
.end()
}

Loading…
Cancel
Save