|
|
@ -1,3 +1,4 @@ |
|
|
|
|
|
|
|
/* eslint-disable prefer-rest-params */ |
|
|
|
import { NightwatchBrowser } from 'nightwatch' |
|
|
|
import { NightwatchBrowser } from 'nightwatch' |
|
|
|
|
|
|
|
|
|
|
|
require('dotenv').config() |
|
|
|
require('dotenv').config() |
|
|
@ -7,6 +8,7 @@ type LoadPlugin = { |
|
|
|
url: string |
|
|
|
url: string |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
|
|
export default function (browser: NightwatchBrowser, callback: VoidFunction, url?: string, preloadPlugins = true, loadPlugin?: LoadPlugin, hideToolTips: boolean = true): void { |
|
|
|
export default function (browser: NightwatchBrowser, callback: VoidFunction, url?: string, preloadPlugins = true, loadPlugin?: LoadPlugin, hideToolTips: boolean = true): void { |
|
|
|
browser |
|
|
|
browser |
|
|
|
.url(url || 'http://127.0.0.1:8080') |
|
|
|
.url(url || 'http://127.0.0.1:8080') |
|
|
@ -26,50 +28,50 @@ export default function (browser: NightwatchBrowser, callback: VoidFunction, url |
|
|
|
.verifyLoad() |
|
|
|
.verifyLoad() |
|
|
|
.enableClipBoard() |
|
|
|
.enableClipBoard() |
|
|
|
.perform((done) => { |
|
|
|
.perform((done) => { |
|
|
|
browser.execute(function () { // hide tooltips
|
|
|
|
browser.execute(function () { // hide tooltips
|
|
|
|
function addStyle(styleString) { |
|
|
|
function addStyle(styleString) { |
|
|
|
const style = document.createElement('style'); |
|
|
|
const style = document.createElement('style'); |
|
|
|
style.textContent = styleString; |
|
|
|
style.textContent = styleString; |
|
|
|
document.head.append(style); |
|
|
|
document.head.append(style); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
addStyle(` |
|
|
|
addStyle(` |
|
|
|
.popover { |
|
|
|
.popover { |
|
|
|
display:none !important; |
|
|
|
display:none !important; |
|
|
|
} |
|
|
|
} |
|
|
|
`);
|
|
|
|
`);
|
|
|
|
}, [], done()) |
|
|
|
}, [], done()) |
|
|
|
}) |
|
|
|
}) |
|
|
|
.perform(() => { |
|
|
|
.perform(() => { |
|
|
|
browser.execute(function () {
|
|
|
|
browser.execute(function () { |
|
|
|
(window as any).logs = []; |
|
|
|
(window as any).logs = []; |
|
|
|
(console as any).browserLog = console.log; |
|
|
|
(console as any).browserLog = console.log; |
|
|
|
(console as any).browserError = console.error |
|
|
|
(console as any).browserError = console.error |
|
|
|
console.log = function () { |
|
|
|
console.log = function () { |
|
|
|
(window as any).logs.push(JSON.stringify(arguments)); |
|
|
|
(window as any).logs.push(JSON.stringify(arguments)); |
|
|
|
(console as any).browserLog(...arguments) |
|
|
|
(console as any).browserLog(...arguments) |
|
|
|
} |
|
|
|
} |
|
|
|
console.error = function () { |
|
|
|
console.error = function () { |
|
|
|
(window as any).logs.push(JSON.stringify(arguments)); |
|
|
|
(window as any).logs.push(JSON.stringify(arguments)); |
|
|
|
(console as any).browserError(...arguments) |
|
|
|
(console as any).browserError(...arguments) |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.perform(() => { |
|
|
|
|
|
|
|
if (preloadPlugins) { |
|
|
|
|
|
|
|
initModules(browser, () => { |
|
|
|
|
|
|
|
browser |
|
|
|
|
|
|
|
.pause(4000) |
|
|
|
|
|
|
|
.clickLaunchIcon('solidity') |
|
|
|
|
|
|
|
.waitForElementVisible('[for="autoCompile"]') |
|
|
|
|
|
|
|
.click('[for="autoCompile"]') |
|
|
|
|
|
|
|
.verify.elementPresent('[data-id="compilerContainerAutoCompile"]:checked') |
|
|
|
|
|
|
|
.perform(() => { callback() }) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
callback() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.perform(() => { |
|
|
|
|
|
|
|
if (preloadPlugins) { |
|
|
|
|
|
|
|
initModules(browser, () => { |
|
|
|
|
|
|
|
browser |
|
|
|
|
|
|
|
.pause(4000) |
|
|
|
|
|
|
|
.clickLaunchIcon('solidity') |
|
|
|
|
|
|
|
.waitForElementVisible('[for="autoCompile"]') |
|
|
|
|
|
|
|
.click('[for="autoCompile"]') |
|
|
|
|
|
|
|
.verify.elementPresent('[data-id="compilerContainerAutoCompile"]:checked') |
|
|
|
|
|
|
|
.perform(() => { callback() }) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
callback() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function initModules(browser: NightwatchBrowser, callback: VoidFunction) { |
|
|
|
function initModules(browser: NightwatchBrowser, callback: VoidFunction) { |
|
|
|