From ff9e9c6cc4085cfc09eb67d259b4315a89b8bfaf Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 17 Jul 2024 07:46:46 +0200 Subject: [PATCH] pin chain command --- .circleci/config.yml | 4 ++-- apps/remix-ide-e2e/src/commands/pinChain.ts | 20 +++++++++++++++++++ apps/remix-ide-e2e/src/tests/terminal.test.ts | 3 ++- apps/remix-ide-e2e/src/types/index.d.ts | 1 + .../grid-view/src/lib/remix-ui-grid-cell.tsx | 1 + 5 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 apps/remix-ide-e2e/src/commands/pinChain.ts diff --git a/.circleci/config.yml b/.circleci/config.yml index d5a065c41d..acb23d4e1f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2.1 parameters: run_flaky_tests: type: boolean - default: false + default: true orbs: browser-tools: circleci/browser-tools@1.4.4 win: circleci/windows@5.0 @@ -355,7 +355,7 @@ jobs: type: string jobsize: type: string - parallelism: 10 + parallelism: 1 steps: - checkout - attach_workspace: diff --git a/apps/remix-ide-e2e/src/commands/pinChain.ts b/apps/remix-ide-e2e/src/commands/pinChain.ts new file mode 100644 index 0000000000..9c049b9068 --- /dev/null +++ b/apps/remix-ide-e2e/src/commands/pinChain.ts @@ -0,0 +1,20 @@ +import { NightwatchBrowser } from 'nightwatch' +import EventEmitter from 'events' + +class pinChain extends EventEmitter { + command (this: NightwatchBrowser, provider: string): NightwatchBrowser { + this.api.useCss().waitForElementVisible('[data-id="settingsSelectEnvOptions"]') + .click('[data-id="settingsSelectEnvOptions"] button') + .waitForElementVisible(`[data-id="dropdown-item-another-chain"]`) + .click(`[data-id="dropdown-item-another-chain"]`) + .waitForElementVisible(`[data-id="${provider}-unpinned"]`) + .click(`[data-id="${provider}-unpinned"]`) + .perform((done) => { + done() + this.emit('complete') + }) + return this + } +} + +module.exports = pinChain diff --git a/apps/remix-ide-e2e/src/tests/terminal.test.ts b/apps/remix-ide-e2e/src/tests/terminal.test.ts index e1335c856d..4bac5df5e7 100644 --- a/apps/remix-ide-e2e/src/tests/terminal.test.ts +++ b/apps/remix-ide-e2e/src/tests/terminal.test.ts @@ -310,9 +310,10 @@ module.exports = { .click('*[data-id="terminalClearConsole"]') }, - 'Should connect to the sepolia fork and run web3.eth.getCode in the terminal #group9': function (browser: NightwatchBrowser) { + 'Should connect to the sepolia fork and run web3.eth.getCode in the terminal #flaky #group9': function (browser: NightwatchBrowser) { if (runMasterTests) browser + .pinChain('vm-custom-fork') .switchEnvironment('vm-custom-fork') .waitForElementVisible('[data-id="vm-custom-fork-modal-footer-ok-react"]') .execute(() => { diff --git a/apps/remix-ide-e2e/src/types/index.d.ts b/apps/remix-ide-e2e/src/types/index.d.ts index 7538ed5b07..a1a39f2d92 100644 --- a/apps/remix-ide-e2e/src/types/index.d.ts +++ b/apps/remix-ide-e2e/src/types/index.d.ts @@ -70,6 +70,7 @@ declare module 'nightwatch' { currentSelectedFileIs(name: string): NightwatchBrowser switchWorkspace: (workspaceName: string) => NightwatchBrowser switchEnvironment: (provider: string) => NightwatchBrowser + pinChain: (provider: string) => NightwatchBrowser connectToExternalHttpProvider: (url: string, identifier: string) => NightwatchBrowser waitForElementNotContainsText: (id: string, value: string, timeout: number = 10000) => NightwatchBrowser hideToolTips: (this: NightwatchBrowser) => NightwatchBrowser diff --git a/libs/remix-ui/grid-view/src/lib/remix-ui-grid-cell.tsx b/libs/remix-ui/grid-view/src/lib/remix-ui-grid-cell.tsx index cbbe269603..147bb40b00 100644 --- a/libs/remix-ui/grid-view/src/lib/remix-ui-grid-cell.tsx +++ b/libs/remix-ui/grid-view/src/lib/remix-ui-grid-cell.tsx @@ -78,6 +78,7 @@ export const RemixUIGridCell = (props: RemixUIGridCellProps) => { { filterCon.showPin &&