diff --git a/apps/remix-ide-e2e/src/commands/rightClick.ts b/apps/remix-ide-e2e/src/commands/rightClickCustom.ts similarity index 80% rename from apps/remix-ide-e2e/src/commands/rightClick.ts rename to apps/remix-ide-e2e/src/commands/rightClickCustom.ts index 09fa8643b1..f98ff7ea93 100644 --- a/apps/remix-ide-e2e/src/commands/rightClick.ts +++ b/apps/remix-ide-e2e/src/commands/rightClickCustom.ts @@ -1,10 +1,10 @@ import EventEmitter from 'events' import { NightwatchBrowser } from 'nightwatch' -class RightClick extends EventEmitter { +class RightClickCustom extends EventEmitter { command (this: NightwatchBrowser, cssSelector: string) { this.api.perform((done) => { - rightClick(this.api, cssSelector, () => { + rightClickCustom(this.api, cssSelector, () => { done() this.emit('complete') }) @@ -13,7 +13,7 @@ class RightClick extends EventEmitter { } } -function rightClick (browser: NightwatchBrowser, cssSelector: string, callback: VoidFunction) { +function rightClickCustom (browser: NightwatchBrowser, cssSelector: string, callback: VoidFunction) { browser.execute(function (cssSelector: string) { const element: any = document.querySelector(cssSelector) const evt = element.ownerDocument.createEvent('MouseEvents') @@ -34,4 +34,4 @@ function rightClick (browser: NightwatchBrowser, cssSelector: string, callback: }) } -module.exports = RightClick +module.exports = RightClickCustom diff --git a/apps/remix-ide-e2e/src/tests/fileExplorer.test.ts b/apps/remix-ide-e2e/src/tests/fileExplorer.test.ts index 7b26d84679..56a616b617 100644 --- a/apps/remix-ide-e2e/src/tests/fileExplorer.test.ts +++ b/apps/remix-ide-e2e/src/tests/fileExplorer.test.ts @@ -66,7 +66,7 @@ module.exports = { 'Should delete Browser_E2E_Tests folder': function (browser: NightwatchBrowser) { browser .waitForElementVisible('*[data-id="treeViewLitreeViewItemBrowser_E2E_Tests"]') - .rightClick('[data-path="Browser_E2E_Tests"]') + .rightClickCustom('[data-path="Browser_E2E_Tests"]') .click('*[id="menuitemdelete"]') .waitForElementVisible('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok', 60000) .pause(2000) diff --git a/apps/remix-ide-e2e/src/tests/plugin_api.ts b/apps/remix-ide-e2e/src/tests/plugin_api.ts index 3e05cfd6be..7cf8cc9598 100644 --- a/apps/remix-ide-e2e/src/tests/plugin_api.ts +++ b/apps/remix-ide-e2e/src/tests/plugin_api.ts @@ -214,7 +214,7 @@ module.exports = { } }) .waitForElementVisible('[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]') - .rightClick('[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]').useXpath().waitForElementVisible('//*[@id="menuitemtestcommand"]').click('//*[@id="menuitemtestcommand"]', async () => { + .rightClickCustom('[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]').useXpath().waitForElementVisible('//*[@id="menuitemtestcommand"]').click('//*[@id="menuitemtestcommand"]', async () => { // @ts-ignore browser.click('//*[@data-id="verticalIconsKindlocalPlugin"]').frame(0, async () => { await clickAndCheckLog(browser, null, { id: 'localPlugin', name: 'testCommand', label: 'testCommand', type: [], extension: ['.sol'], path: ['contracts/1_Storage.sol'], pattern: [] }, null, null) diff --git a/apps/remix-ide-e2e/src/tests/verticalIconsPanel.test.ts b/apps/remix-ide-e2e/src/tests/verticalIconsPanel.test.ts index 63a98743a6..3cbe497dd7 100644 --- a/apps/remix-ide-e2e/src/tests/verticalIconsPanel.test.ts +++ b/apps/remix-ide-e2e/src/tests/verticalIconsPanel.test.ts @@ -13,7 +13,7 @@ module.exports = { .click('*[data-id="verticalIconsKindpluginManager"]') .scrollAndClick('*[data-id="pluginManagerComponentActivateButtondebugger"]') .waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtondebugger"]', 7000) - .rightClick('[data-id="verticalIconsKinddebugger"]') + .rightClickCustom('[data-id="verticalIconsKinddebugger"]') .waitForElementVisible('*[id="menuitemdeactivate"]') .waitForElementVisible('*[id="menuitemdocumentation"]') .click('*[data-id="remixIdeIconPanel"]') @@ -23,7 +23,7 @@ module.exports = { browser.waitForElementVisible('div[data-id="remixIdeIconPanel"]', 10000) .waitForElementVisible('*[data-id="verticalIconsKinddebugger"]', 7000) .pause(5000) - .rightClick('[data-id="verticalIconsKinddebugger"]') + .rightClickCustom('[data-id="verticalIconsKinddebugger"]') .click('*[id="menuitemdeactivate"]') .click('*[data-id="verticalIconsKindsettings"]') .click('*[data-id="verticalIconsKindpluginManager"]') diff --git a/apps/remix-ide-e2e/src/types/index.d.ts b/apps/remix-ide-e2e/src/types/index.d.ts index 43750a58a9..0e2b394cc5 100644 --- a/apps/remix-ide-e2e/src/types/index.d.ts +++ b/apps/remix-ide-e2e/src/types/index.d.ts @@ -28,7 +28,7 @@ declare module 'nightwatch' { checkElementStyle(cssSelector: string, styleProperty: string, expectedResult: string): NightwatchBrowser, openFile(name: string): NightwatchBrowser, renamePath(path: string, newFileName: string, renamedPath: string): NightwatchBrowser, - rightClick(cssSelector: string): NightwatchBrowser, + rightClickCustom(cssSelector: string): NightwatchBrowser, scrollToLine(line: number): NightwatchBrowser, waitForElementContainsText(id: string, value: string, timeout?: number): NightwatchBrowser, getModalBody(callback: (value: string, cb: VoidFunction) => void): NightwatchBrowser,