starting with groups

pull/5370/head
filip mertens 3 years ago
parent e555acdea9
commit 6b835b53b9
  1. 2
      apps/remix-ide-e2e/nightwatch.ts
  2. 12
      apps/remix-ide-e2e/src/helpers/buildgrouptest.ts
  3. 24
      apps/remix-ide-e2e/src/tests/debugger.spec.ts
  4. 6
      apps/remix-ide-e2e/src/tests/debugger_group_1.spec.ts
  5. 6
      apps/remix-ide-e2e/src/tests/debugger_group_2.spec.ts
  6. 2
      package.json

@ -42,7 +42,7 @@ module.exports = {
javascriptEnabled: true, javascriptEnabled: true,
acceptSslCerts: true, acceptSslCerts: true,
'goog:chromeOptions': { 'goog:chromeOptions': {
args: ['window-size=2560,1440', 'start-fullscreen', '--no-sandbox', '--headless'] args: ['window-size=2560,1440', 'start-fullscreen', '--no-sandbox']
} }
} }
}, },

@ -0,0 +1,12 @@
export default function buildGroupTest (group: string, test: any) {
const ob = {}
// eslint-disable-next-line dot-notation
const defaults = test['default']
for (const key of Object.keys(defaults)) {
if (typeof defaults[key] === 'function' && (key.indexOf(`#${group}`) > -1 || key.indexOf('#group') === -1)) {
ob[key.replace(`#${group}`, '')] = defaults[key]
}
}
console.log(ob)
return ob
}

@ -3,7 +3,7 @@ import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init' import init from '../helpers/init'
module.exports = { module.exports = {
'@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) { before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done) init(browser, done)
}, },
@ -12,7 +12,7 @@ module.exports = {
return sources return sources
}, },
'Should launch debugger': function (browser: NightwatchBrowser) { 'Should launch debugger #group1': function (browser: NightwatchBrowser) {
browser.addFile('blah.sol', sources[0]['blah.sol']) browser.addFile('blah.sol', sources[0]['blah.sol'])
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
.waitForElementPresent('*[title="Deploy - transact (not payable)"]', 65000) .waitForElementPresent('*[title="Deploy - transact (not payable)"]', 65000)
@ -21,7 +21,7 @@ module.exports = {
.waitForElementContainsText('*[data-id="sidePanelSwapitTitle"]', 'DEBUGGER', 60000) .waitForElementContainsText('*[data-id="sidePanelSwapitTitle"]', 'DEBUGGER', 60000)
}, },
'Should debug failing transaction': function (browser: NightwatchBrowser) { 'Should debug failing transaction #group1': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="verticalIconsKindudapp"]') browser.waitForElementVisible('*[data-id="verticalIconsKindudapp"]')
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
.waitForElementPresent('*[data-id="universalDappUiTitleExpander"]') .waitForElementPresent('*[data-id="universalDappUiTitleExpander"]')
@ -36,7 +36,7 @@ module.exports = {
.waitForElementContainsText('*[data-id="solidityLocals"]', '999', 60000) .waitForElementContainsText('*[data-id="solidityLocals"]', '999', 60000)
}, },
'Should debug transaction using slider': function (browser: NightwatchBrowser) { 'Should debug transaction using slider #group1': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="verticalIconsKindudapp"]') browser.waitForElementVisible('*[data-id="verticalIconsKindudapp"]')
.waitForElementVisible('*[data-id="slider"]') .waitForElementVisible('*[data-id="slider"]')
// eslint-disable-next-line dot-notation // eslint-disable-next-line dot-notation
@ -48,7 +48,7 @@ module.exports = {
.waitForElementContainsText('*[data-id="stepdetail"]', 'vm trace step:\n51', 60000) .waitForElementContainsText('*[data-id="stepdetail"]', 'vm trace step:\n51', 60000)
}, },
'Should step back and forward transaction': function (browser: NightwatchBrowser) { 'Should step back and forward transaction #group1': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="verticalIconsKindudapp"]') browser.waitForElementVisible('*[data-id="verticalIconsKindudapp"]')
.waitForElementPresent('*[data-id="buttonNavigatorIntoBack"]') .waitForElementPresent('*[data-id="buttonNavigatorIntoBack"]')
.scrollAndClick('*[data-id="buttonNavigatorIntoBack"]') .scrollAndClick('*[data-id="buttonNavigatorIntoBack"]')
@ -61,7 +61,7 @@ module.exports = {
.waitForElementContainsText('*[data-id="stepdetail"]', 'execution step:\n51', 60000) .waitForElementContainsText('*[data-id="stepdetail"]', 'execution step:\n51', 60000)
}, },
'Should jump through breakpoints': function (browser: NightwatchBrowser) { 'Should jump through breakpoints #group1': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('#editorView') browser.waitForElementVisible('#editorView')
.execute(() => { .execute(() => {
(window as any).addRemixBreakpoint(11) (window as any).addRemixBreakpoint(11)
@ -80,7 +80,7 @@ module.exports = {
.waitForElementContainsText('*[data-id="stepdetail"]', 'execution step:\n352', 60000) .waitForElementContainsText('*[data-id="stepdetail"]', 'execution step:\n352', 60000)
}, },
'Should display solidity imported code while debugging github import': function (browser: NightwatchBrowser) { 'Should display solidity imported code while debugging github import #group1': function (browser: NightwatchBrowser) {
browser browser
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
.testContracts('externalImport.sol', sources[1]['externalImport.sol'], ['ERC20']) .testContracts('externalImport.sol', sources[1]['externalImport.sol'], ['ERC20'])
@ -101,7 +101,7 @@ module.exports = {
}) })
}, },
'Should display correct source highlighting while debugging a contract which has ABIEncoderV2': function (browser: NightwatchBrowser) { 'Should display correct source highlighting while debugging a contract which has ABIEncoderV2 #group2': function (browser: NightwatchBrowser) {
/* /*
localVariable_step266_ABIEncoder and localVariable_step717_ABIEncoder localVariable_step266_ABIEncoder and localVariable_step717_ABIEncoder
still contains unwanted values (related to decoding calldata types) still contains unwanted values (related to decoding calldata types)
@ -142,7 +142,7 @@ module.exports = {
.clickInstance(2) .clickInstance(2)
}, },
'Should load more solidity locals array': function (browser: NightwatchBrowser) { 'Should load more solidity locals array #group2': function (browser: NightwatchBrowser) {
browser browser
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
.testContracts('locals.sol', sources[3]['locals.sol'], ['testLocals']) .testContracts('locals.sol', sources[3]['locals.sol'], ['testLocals'])
@ -166,7 +166,7 @@ module.exports = {
.notContainsText('*[data-id="solidityLocals"]', '10: 10 uint256') .notContainsText('*[data-id="solidityLocals"]', '10: 10 uint256')
}, },
'Should debug using generated sources': function (browser: NightwatchBrowser) { 'Should debug using generated sources #group2': function (browser: NightwatchBrowser) {
browser browser
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
.pause(2000) .pause(2000)
@ -187,7 +187,7 @@ module.exports = {
.click('*[data-id="debuggerTransactionStartButton"]') .click('*[data-id="debuggerTransactionStartButton"]')
}, },
'Should call the debugger api: getTrace': function (browser: NightwatchBrowser) { 'Should call the debugger api: getTrace #group2': function (browser: NightwatchBrowser) {
browser browser
.addFile('test_jsGetTrace.js', { content: jsGetTrace }) .addFile('test_jsGetTrace.js', { content: jsGetTrace })
.executeScript('remix.exeCurrent()') .executeScript('remix.exeCurrent()')
@ -195,7 +195,7 @@ module.exports = {
.waitForElementContainsText('*[data-id="terminalJournal"]', '{"gas":"0x575f","return":"0x0000000000000000000000000000000000000000000000000000000000000000","structLogs":', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', '{"gas":"0x575f","return":"0x0000000000000000000000000000000000000000000000000000000000000000","structLogs":', 60000)
}, },
'Should call the debugger api: debug': function (browser: NightwatchBrowser) { 'Should call the debugger api: debug #group2': function (browser: NightwatchBrowser) {
browser browser
.addFile('test_jsDebug.js', { content: jsDebug }) .addFile('test_jsDebug.js', { content: jsDebug })
.executeScript('remix.exeCurrent()') .executeScript('remix.exeCurrent()')

@ -0,0 +1,6 @@
'use strict'
import * as test from './debugger.spec'
import buildGroupTest from '../helpers/buildgrouptest'
const group = 'group1'
module.exports = buildGroupTest(group, test)

@ -0,0 +1,6 @@
'use strict'
import * as test from './debugger.spec'
import buildGroupTest from '../helpers/buildgrouptest'
const group = 'group2'
module.exports = buildGroupTest(group, test)

@ -62,6 +62,8 @@
"nightwatch_parallel": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=chrome,firefox", "nightwatch_parallel": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=chrome,firefox",
"nightwatch_local_firefox": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=firefox", "nightwatch_local_firefox": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=firefox",
"nightwatch_local_chrome": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=chrome", "nightwatch_local_chrome": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=chrome",
"debugger_group_2": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/debugger_group_2.spec.js --env=chrome",
"debugger_group_1": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/debugger_group_1.spec.js --env=chrome",
"nightwatch_local_ballot": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot.test.js --env=chrome", "nightwatch_local_ballot": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot.test.js --env=chrome",
"nightwatch_local_ballot_0_4_11": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.js --env=chrome", "nightwatch_local_ballot_0_4_11": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.js --env=chrome",
"nightwatch_local_usingWorker": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/usingWebWorker.test.js --env=chrome", "nightwatch_local_usingWorker": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/usingWebWorker.test.js --env=chrome",

Loading…
Cancel
Save