|
|
|
@ -2,7 +2,7 @@ import { NightwatchBrowser } from 'nightwatch' |
|
|
|
|
import EventEmitter from 'events' |
|
|
|
|
|
|
|
|
|
class VerifyContracts extends EventEmitter { |
|
|
|
|
command (this: NightwatchBrowser, compiledContractNames: string[], opts = { wait: 1000, version: null }): NightwatchBrowser { |
|
|
|
|
command (this: NightwatchBrowser, compiledContractNames: string[], opts = { wait: 1000, version: null, runs: '200' }): NightwatchBrowser { |
|
|
|
|
this.api.perform((done) => { |
|
|
|
|
verifyContracts(this.api, compiledContractNames, opts, () => { |
|
|
|
|
done() |
|
|
|
@ -13,7 +13,7 @@ class VerifyContracts extends EventEmitter { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function verifyContracts (browser: NightwatchBrowser, compiledContractNames: string[], opts: { wait: number, version?: string }, callback: VoidFunction) { |
|
|
|
|
function verifyContracts (browser: NightwatchBrowser, compiledContractNames: string[], opts: { wait: number, version?: string, runs?: string }, callback: VoidFunction) { |
|
|
|
|
browser |
|
|
|
|
.clickLaunchIcon('solidity') |
|
|
|
|
.pause(opts.wait) |
|
|
|
@ -36,6 +36,25 @@ function verifyContracts (browser: NightwatchBrowser, compiledContractNames: str |
|
|
|
|
done() |
|
|
|
|
callback() |
|
|
|
|
}) |
|
|
|
|
} if (opts.runs) { |
|
|
|
|
browser |
|
|
|
|
.click('*[data-id="compilation-details"]') |
|
|
|
|
.waitForElementVisible('*[data-id="remixui_treeviewitem_metadata"]') |
|
|
|
|
.pause(2000) |
|
|
|
|
.click('*[data-id="remixui_treeviewitem_metadata"]') |
|
|
|
|
.waitForElementVisible('*[data-id="treeViewDivtreeViewItemsettings"]') |
|
|
|
|
.pause(2000) |
|
|
|
|
.click('*[data-id="treeViewDivtreeViewItemsettings"]') |
|
|
|
|
.waitForElementVisible('*[data-id="treeViewDivtreeViewItemoptimizer"]') |
|
|
|
|
.click('*[data-id="treeViewDivtreeViewItemoptimizer"]') |
|
|
|
|
.waitForElementVisible('*[data-id="treeViewDivruns"]') |
|
|
|
|
|
|
|
|
|
.assert.containsText('*[data-id="treeViewDivruns"]', `${opts.runs}`) |
|
|
|
|
.click('[data-id="workspacesModalDialog-modal-footer-ok-react"]') |
|
|
|
|
.perform(() => { |
|
|
|
|
done() |
|
|
|
|
callback() |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
compiledContractNames.forEach((name) => { |
|
|
|
|
browser.waitForElementContainsText('[data-id="compiledContracts"]', name, 60000) |
|
|
|
|