From 6b835b53b96da196883ba1f45b2efe22f65ec75e Mon Sep 17 00:00:00 2001 From: filip mertens Date: Sat, 13 Nov 2021 11:28:05 +0100 Subject: [PATCH] starting with groups --- apps/remix-ide-e2e/nightwatch.ts | 2 +- .../src/helpers/buildgrouptest.ts | 12 ++++++++++ apps/remix-ide-e2e/src/tests/debugger.spec.ts | 24 +++++++++---------- .../src/tests/debugger_group_1.spec.ts | 6 +++++ .../src/tests/debugger_group_2.spec.ts | 6 +++++ package.json | 2 ++ 6 files changed, 39 insertions(+), 13 deletions(-) create mode 100644 apps/remix-ide-e2e/src/helpers/buildgrouptest.ts create mode 100644 apps/remix-ide-e2e/src/tests/debugger_group_1.spec.ts create mode 100644 apps/remix-ide-e2e/src/tests/debugger_group_2.spec.ts diff --git a/apps/remix-ide-e2e/nightwatch.ts b/apps/remix-ide-e2e/nightwatch.ts index 80c03010e7..bd791ba62a 100644 --- a/apps/remix-ide-e2e/nightwatch.ts +++ b/apps/remix-ide-e2e/nightwatch.ts @@ -42,7 +42,7 @@ module.exports = { javascriptEnabled: true, acceptSslCerts: true, 'goog:chromeOptions': { - args: ['window-size=2560,1440', 'start-fullscreen', '--no-sandbox', '--headless'] + args: ['window-size=2560,1440', 'start-fullscreen', '--no-sandbox'] } } }, diff --git a/apps/remix-ide-e2e/src/helpers/buildgrouptest.ts b/apps/remix-ide-e2e/src/helpers/buildgrouptest.ts new file mode 100644 index 0000000000..f1ebfe9cb0 --- /dev/null +++ b/apps/remix-ide-e2e/src/helpers/buildgrouptest.ts @@ -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 +} diff --git a/apps/remix-ide-e2e/src/tests/debugger.spec.ts b/apps/remix-ide-e2e/src/tests/debugger.spec.ts index 81df25d21b..8b27a6f6d1 100644 --- a/apps/remix-ide-e2e/src/tests/debugger.spec.ts +++ b/apps/remix-ide-e2e/src/tests/debugger.spec.ts @@ -3,7 +3,7 @@ import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' module.exports = { - + '@disabled': true, before: function (browser: NightwatchBrowser, done: VoidFunction) { init(browser, done) }, @@ -12,7 +12,7 @@ module.exports = { return sources }, - 'Should launch debugger': function (browser: NightwatchBrowser) { + 'Should launch debugger #group1': function (browser: NightwatchBrowser) { browser.addFile('blah.sol', sources[0]['blah.sol']) .clickLaunchIcon('udapp') .waitForElementPresent('*[title="Deploy - transact (not payable)"]', 65000) @@ -21,7 +21,7 @@ module.exports = { .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"]') .clickLaunchIcon('udapp') .waitForElementPresent('*[data-id="universalDappUiTitleExpander"]') @@ -36,7 +36,7 @@ module.exports = { .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"]') .waitForElementVisible('*[data-id="slider"]') // eslint-disable-next-line dot-notation @@ -48,7 +48,7 @@ module.exports = { .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"]') .waitForElementPresent('*[data-id="buttonNavigatorIntoBack"]') .scrollAndClick('*[data-id="buttonNavigatorIntoBack"]') @@ -61,7 +61,7 @@ module.exports = { .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') .execute(() => { (window as any).addRemixBreakpoint(11) @@ -80,7 +80,7 @@ module.exports = { .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 .clickLaunchIcon('solidity') .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 still contains unwanted values (related to decoding calldata types) @@ -142,7 +142,7 @@ module.exports = { .clickInstance(2) }, - 'Should load more solidity locals array': function (browser: NightwatchBrowser) { + 'Should load more solidity locals array #group2': function (browser: NightwatchBrowser) { browser .clickLaunchIcon('solidity') .testContracts('locals.sol', sources[3]['locals.sol'], ['testLocals']) @@ -166,7 +166,7 @@ module.exports = { .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 .clickLaunchIcon('solidity') .pause(2000) @@ -187,7 +187,7 @@ module.exports = { .click('*[data-id="debuggerTransactionStartButton"]') }, - 'Should call the debugger api: getTrace': function (browser: NightwatchBrowser) { + 'Should call the debugger api: getTrace #group2': function (browser: NightwatchBrowser) { browser .addFile('test_jsGetTrace.js', { content: jsGetTrace }) .executeScript('remix.exeCurrent()') @@ -195,7 +195,7 @@ module.exports = { .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 .addFile('test_jsDebug.js', { content: jsDebug }) .executeScript('remix.exeCurrent()') diff --git a/apps/remix-ide-e2e/src/tests/debugger_group_1.spec.ts b/apps/remix-ide-e2e/src/tests/debugger_group_1.spec.ts new file mode 100644 index 0000000000..b92d8eb51a --- /dev/null +++ b/apps/remix-ide-e2e/src/tests/debugger_group_1.spec.ts @@ -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) diff --git a/apps/remix-ide-e2e/src/tests/debugger_group_2.spec.ts b/apps/remix-ide-e2e/src/tests/debugger_group_2.spec.ts new file mode 100644 index 0000000000..06146869b3 --- /dev/null +++ b/apps/remix-ide-e2e/src/tests/debugger_group_2.spec.ts @@ -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) diff --git a/package.json b/package.json index c9e2ac940d..330f879da6 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,8 @@ "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_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_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",