diff --git a/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts b/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts index cbce263705..37e9c325b2 100644 --- a/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts +++ b/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts @@ -1,8 +1,7 @@ import { NightwatchBrowser } from 'nightwatch' +import EventEmitter from "events" -const EventEmitter = require('events') - -export class addAtAddressInstance extends EventEmitter { +class addAtAddressInstance extends EventEmitter { command (this: NightwatchBrowser, address: string, isValidFormat: boolean, isValidChecksum: boolean): NightwatchBrowser { this.api.perform((done) => { addInstance(this.api, address, isValidFormat, isValidChecksum, () => { @@ -33,3 +32,5 @@ function addInstance (browser: NightwatchBrowser, address: string, isValidFormat }) }) } + +module.exports = addAtAddressInstance diff --git a/apps/remix-ide-e2e/src/commands/addFile.ts b/apps/remix-ide-e2e/src/commands/addFile.ts index 93de493c12..149d0fa43b 100644 --- a/apps/remix-ide-e2e/src/commands/addFile.ts +++ b/apps/remix-ide-e2e/src/commands/addFile.ts @@ -1,8 +1,7 @@ import { NightwatchBrowser, NightwatchContractContent } from 'nightwatch' +import EventEmitter from "events" -const EventEmitter = require('events') - -export class AddFile extends EventEmitter { +class AddFile extends EventEmitter { command (this: NightwatchBrowser, name: string, content: NightwatchContractContent): NightwatchBrowser { this.api.perform((done) => { addFile(this.api, name, content, () => { @@ -36,3 +35,5 @@ function addFile (browser: NightwatchBrowser, name: string, content: NightwatchC done() }) } + +module.exports = AddFile diff --git a/apps/remix-ide-e2e/src/commands/checkVariableDebug.ts b/apps/remix-ide-e2e/src/commands/checkVariableDebug.ts index b74a780f22..f899c6f013 100644 --- a/apps/remix-ide-e2e/src/commands/checkVariableDebug.ts +++ b/apps/remix-ide-e2e/src/commands/checkVariableDebug.ts @@ -1,9 +1,9 @@ import { NightwatchBrowser, NightwatchCheckVariableDebugValue } from 'nightwatch' +import EventEmitter from "events" -const EventEmitter = require('events') const deepequal = require('deep-equal') -export class CheckVariableDebug extends EventEmitter { +class CheckVariableDebug extends EventEmitter { command (this: NightwatchBrowser, id: string, debugValue: NightwatchCheckVariableDebugValue): NightwatchBrowser { this.api.perform((done) => { checkDebug(this.api, id, debugValue, () => { @@ -38,3 +38,5 @@ function checkDebug (browser: NightwatchBrowser, id: string, debugValue: Nightwa done() }) } + +module.exports = CheckVariableDebug diff --git a/apps/remix-ide-e2e/src/commands/clickFunction.ts b/apps/remix-ide-e2e/src/commands/clickFunction.ts index 648030bb74..20e44766d4 100644 --- a/apps/remix-ide-e2e/src/commands/clickFunction.ts +++ b/apps/remix-ide-e2e/src/commands/clickFunction.ts @@ -1,8 +1,7 @@ import { NightwatchBrowser, NightwatchClickFunctionExpectedInput } from 'nightwatch' +import EventEmitter from "events" -const EventEmitter = require('events') - -export class ClickFunction extends EventEmitter { +class ClickFunction extends EventEmitter { command (this: NightwatchBrowser, fnFullName: string, expectedInput?: NightwatchClickFunctionExpectedInput): NightwatchBrowser { this.api.waitForElementPresent('.instance button[title="' + fnFullName + '"]') .perform(function (client, done) { @@ -23,3 +22,5 @@ export class ClickFunction extends EventEmitter { return this } } + +module.exports = ClickFunction diff --git a/apps/remix-ide-e2e/src/commands/clickInstance.ts b/apps/remix-ide-e2e/src/commands/clickInstance.ts index d910cc284c..3d92144966 100644 --- a/apps/remix-ide-e2e/src/commands/clickInstance.ts +++ b/apps/remix-ide-e2e/src/commands/clickInstance.ts @@ -1,8 +1,7 @@ import { NightwatchBrowser } from 'nightwatch' +import EventEmitter from "events" -const EventEmitter = require('events') - -export class ClickInstance extends EventEmitter { +class ClickInstance extends EventEmitter { command (this: NightwatchBrowser, index: number): NightwatchBrowser { index = index + 2 const selector = '.instance:nth-of-type(' + index + ') > div > button' @@ -11,3 +10,5 @@ export class ClickInstance extends EventEmitter { return this } } + +module.exports = ClickInstance diff --git a/apps/remix-ide-e2e/src/commands/clickLaunchIcon.ts b/apps/remix-ide-e2e/src/commands/clickLaunchIcon.ts index 95c9037bfc..4ffcd23ca0 100644 --- a/apps/remix-ide-e2e/src/commands/clickLaunchIcon.ts +++ b/apps/remix-ide-e2e/src/commands/clickLaunchIcon.ts @@ -1,8 +1,7 @@ import { NightwatchBrowser } from "nightwatch" +import EventEmitter from "events" -const EventEmitter = require('events') - -export class ClickLaunchIcon extends EventEmitter { +class ClickLaunchIcon extends EventEmitter { command (this: NightwatchBrowser, icon: string): NightwatchBrowser { this.api.waitForElementVisible('#icon-panel div[plugin="' + icon + '"]').click('#icon-panel div[plugin="' + icon + '"]').perform((done) => { done() @@ -11,3 +10,5 @@ export class ClickLaunchIcon extends EventEmitter { return this } } + +module.exports = ClickLaunchIcon \ No newline at end of file diff --git a/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts b/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts index 3ce98a3b05..274abb15e7 100644 --- a/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts +++ b/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts @@ -1,8 +1,6 @@ import { NightwatchBrowser } from 'nightwatch' - -const EventEmitter = require('events') - -export class GoToVmTraceStep extends EventEmitter { +import EventEmitter from "events" +class GoToVmTraceStep extends EventEmitter { command (this: NightwatchBrowser, step: number, incr?: number): NightwatchBrowser { this.api.perform((done) => { goToVMtraceStep(this.api, step, incr, () => { @@ -35,3 +33,5 @@ function goToVMtraceStep (browser: NightwatchBrowser, step: number, incr: number } }) } + +module.exports = GoToVmTraceStep diff --git a/apps/remix-ide-e2e/src/commands/journalLastChildIncludes.ts b/apps/remix-ide-e2e/src/commands/journalLastChildIncludes.ts index 6e70499f5b..e215e6c24d 100644 --- a/apps/remix-ide-e2e/src/commands/journalLastChildIncludes.ts +++ b/apps/remix-ide-e2e/src/commands/journalLastChildIncludes.ts @@ -1,11 +1,10 @@ import { NightwatchBrowser } from 'nightwatch' - -const EventEmitter = require('events') +import EventEmitter from "events" /* Check if the last log in the console contains a specific text */ -export class JournalLastChildIncludes extends EventEmitter { +class JournalLastChildIncludes extends EventEmitter { command (this: NightwatchBrowser, val: string): NightwatchBrowser { this.api .waitForElementVisible('*[data-id="terminalJournal"] > div:last-child', 10000) @@ -18,3 +17,5 @@ export class JournalLastChildIncludes extends EventEmitter { return this } } + +module.exports = JournalLastChildIncludes diff --git a/apps/remix-ide-e2e/src/commands/modalFooterOKClick.ts b/apps/remix-ide-e2e/src/commands/modalFooterOKClick.ts index ba61e2f5ca..1f78ff2248 100644 --- a/apps/remix-ide-e2e/src/commands/modalFooterOKClick.ts +++ b/apps/remix-ide-e2e/src/commands/modalFooterOKClick.ts @@ -1,8 +1,7 @@ import { NightwatchBrowser } from "nightwatch" +import EventEmitter from "events" -const EventEmitter = require('events') - -export class ModalFooterOKClick extends EventEmitter { +class ModalFooterOKClick extends EventEmitter { command (this: NightwatchBrowser): NightwatchBrowser { this.api.waitForElementVisible('#modal-footer-ok').perform((client, done) => { this.api.execute(function () { @@ -17,3 +16,5 @@ export class ModalFooterOKClick extends EventEmitter { return this } } + +module.exports = ModalFooterOKClick diff --git a/apps/remix-ide-e2e/src/commands/scrollAndClick.ts b/apps/remix-ide-e2e/src/commands/scrollAndClick.ts index d360dd4839..cfcf8a016d 100644 --- a/apps/remix-ide-e2e/src/commands/scrollAndClick.ts +++ b/apps/remix-ide-e2e/src/commands/scrollAndClick.ts @@ -1,8 +1,7 @@ import { NightwatchBrowser } from 'nightwatch' +import EventEmitter from "events" -const EventEmitter = require('events') - -export class scrollAndClick extends EventEmitter { +class scrollAndClick extends EventEmitter { command (this: NightwatchBrowser, target: string): NightwatchBrowser { this.api .scrollInto(target) @@ -13,3 +12,5 @@ export class scrollAndClick extends EventEmitter { return this } } + +module.exports = scrollAndClick diff --git a/apps/remix-ide-e2e/src/commands/scrollInto.ts b/apps/remix-ide-e2e/src/commands/scrollInto.ts index d10214da96..7ccab49cc8 100644 --- a/apps/remix-ide-e2e/src/commands/scrollInto.ts +++ b/apps/remix-ide-e2e/src/commands/scrollInto.ts @@ -1,8 +1,7 @@ import { NightwatchBrowser } from 'nightwatch' +import EventEmitter from "events" -const EventEmitter = require('events') - -export class ScrollInto extends EventEmitter { +class ScrollInto extends EventEmitter { command (this: NightwatchBrowser, target: string): NightwatchBrowser { this.api.perform((client, done) => { _scrollInto(this.api, target, () => { @@ -21,3 +20,5 @@ function _scrollInto (browser: NightwatchBrowser, target: string, cb: VoidFuncti cb() }) } + +module.exports = ScrollInto diff --git a/apps/remix-ide-e2e/src/commands/selectAccount.ts b/apps/remix-ide-e2e/src/commands/selectAccount.ts index 64bbff680d..413012acdd 100644 --- a/apps/remix-ide-e2e/src/commands/selectAccount.ts +++ b/apps/remix-ide-e2e/src/commands/selectAccount.ts @@ -1,8 +1,7 @@ import { NightwatchBrowser } from 'nightwatch' +import EventEmitter from "events" -const EventEmitter = require('events') - -export class SelectAccount extends EventEmitter { +class SelectAccount extends EventEmitter { command (this: NightwatchBrowser, account?: string): NightwatchBrowser { if (account) { this.api @@ -14,3 +13,5 @@ export class SelectAccount extends EventEmitter { return this } } + +module.exports = SelectAccount diff --git a/apps/remix-ide-e2e/src/commands/setEditorValue.ts b/apps/remix-ide-e2e/src/commands/setEditorValue.ts index d718c1172f..f7bd5d8144 100644 --- a/apps/remix-ide-e2e/src/commands/setEditorValue.ts +++ b/apps/remix-ide-e2e/src/commands/setEditorValue.ts @@ -1,12 +1,11 @@ import { NightwatchBrowser } from 'nightwatch' +import EventEmitter from "events" -const EventEmitter = require('events') - -export class SetEditorValue extends EventEmitter { +class SetEditorValue extends EventEmitter { command (this: NightwatchBrowser, value: string, callback?: VoidFunction): NightwatchBrowser { this.api.perform((client, done) => { this.api.execute(function (value) { - const elem: any = document.querySelector('#modal-footer-ok') + const elem: any = document.getElementById('input') elem.editor.session.setValue(value) }, [value], () => { @@ -20,3 +19,5 @@ export class SetEditorValue extends EventEmitter { return this } } + +module.exports = SetEditorValue diff --git a/apps/remix-ide-e2e/src/commands/switchBrowserTab.ts b/apps/remix-ide-e2e/src/commands/switchBrowserTab.ts index 25c05249c0..c3e2a62ac0 100644 --- a/apps/remix-ide-e2e/src/commands/switchBrowserTab.ts +++ b/apps/remix-ide-e2e/src/commands/switchBrowserTab.ts @@ -1,12 +1,11 @@ import { NightwatchBrowser } from "nightwatch" - -const EventEmitter = require('events') +import EventEmitter from "events" /* Switches between browser tabs */ -export class SwitchBrowserTab extends EventEmitter { +class SwitchBrowserTab extends EventEmitter { command (this: NightwatchBrowser, index: number): NightwatchBrowser { this.api.perform((browser: NightwatchBrowser, done) => { browser.windowHandles((result) => { @@ -18,3 +17,5 @@ export class SwitchBrowserTab extends EventEmitter { return this } } + +module.exports = SwitchBrowserTab diff --git a/apps/remix-ide-e2e/src/commands/testContracts.ts b/apps/remix-ide-e2e/src/commands/testContracts.ts index c89aa58808..7b7192348e 100644 --- a/apps/remix-ide-e2e/src/commands/testContracts.ts +++ b/apps/remix-ide-e2e/src/commands/testContracts.ts @@ -1,8 +1,7 @@ import { NightwatchBrowser, NightwatchContractContent } from 'nightwatch' +import EventEmitter from "events" -const EventEmitter = require('events') - -export class TestContracts extends EventEmitter { +class TestContracts extends EventEmitter { command (this: NightwatchBrowser,fileName: string, contractCode: NightwatchContractContent, compiledContractNames: string[]): NightwatchBrowser { this.api.perform((done) => { testContracts(this.api, fileName, contractCode, compiledContractNames, () => { @@ -24,3 +23,5 @@ function testContracts (browser: NightwatchBrowser, fileName: string, contractCo callback() }) } + +module.exports = TestContracts diff --git a/apps/remix-ide-e2e/src/commands/testFunction.ts b/apps/remix-ide-e2e/src/commands/testFunction.ts index 3dc49a7b6c..0993f49f99 100644 --- a/apps/remix-ide-e2e/src/commands/testFunction.ts +++ b/apps/remix-ide-e2e/src/commands/testFunction.ts @@ -1,9 +1,9 @@ import { NightwatchBrowser, NightwatchTestFunctionExpectedInput } from 'nightwatch' +import EventEmitter from "events" -const EventEmitter = require('events') const deepequal = require('deep-equal') -export class TestFunction extends EventEmitter { +class TestFunction extends EventEmitter { command (this: NightwatchBrowser, txHash: string, expectedValue: NightwatchTestFunctionExpectedInput): NightwatchBrowser { const browser = this.api const logs = {} @@ -58,3 +58,5 @@ export class TestFunction extends EventEmitter { return this } } + +module.exports = TestFunction diff --git a/apps/remix-ide-e2e/src/commands/verifyContracts.ts b/apps/remix-ide-e2e/src/commands/verifyContracts.ts index 9a51aa710b..8cab02424f 100644 --- a/apps/remix-ide-e2e/src/commands/verifyContracts.ts +++ b/apps/remix-ide-e2e/src/commands/verifyContracts.ts @@ -1,8 +1,7 @@ import { NightwatchBrowser, NightwatchVerifyContractOpts, NightwatchCallbackResult } from 'nightwatch' +import EventEmitter from "events" -const EventEmitter = require('events') - -export class VerifyContracts extends EventEmitter { +class VerifyContracts extends EventEmitter { command (this: NightwatchBrowser,compiledContractNames: string[], opts = { wait: 1000, version: null }): NightwatchBrowser { this.api.perform((done) => { verifyContracts(this.api, compiledContractNames, opts, () => { @@ -68,3 +67,5 @@ function verifyContracts (browser: NightwatchBrowser, compiledContractNames: str callback() }) } + +module.exports = VerifyContracts diff --git a/apps/remix-ide-e2e/tsconfig.json b/apps/remix-ide-e2e/tsconfig.json index a99835019c..00194881f7 100644 --- a/apps/remix-ide-e2e/tsconfig.json +++ b/apps/remix-ide-e2e/tsconfig.json @@ -1,7 +1,8 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "types": ["node", "nightwatch"] + "types": ["node", "nightwatch"], + "esModuleInterop": true, }, "include": ["**/*.ts", "**/*.js"] }