From d26b83541a9d304c991176b371d522199a16423a Mon Sep 17 00:00:00 2001 From: lianahus Date: Mon, 20 Mar 2023 15:27:15 +0100 Subject: [PATCH] e2e --- apps/remix-ide-e2e/src/commands/addFile.ts | 2 +- apps/remix-ide-e2e/src/commands/currentSelectedFileIs.ts | 2 +- apps/remix-ide-e2e/src/tests/importFromGithub.test.ts | 2 +- libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/addFile.ts b/apps/remix-ide-e2e/src/commands/addFile.ts index 192dbff665..a5ac8cdcf9 100644 --- a/apps/remix-ide-e2e/src/commands/addFile.ts +++ b/apps/remix-ide-e2e/src/commands/addFile.ts @@ -55,7 +55,7 @@ function addFile(browser: NightwatchBrowser, name: string, content: NightwatchCo timeout: 60000 }) .waitForElementVisible({ - selector: `//*[@data-id='activeTabTitle' and contains(., "${name}")]`, + selector: `//*[@data-id='tab-active' and @data-path="${name}"]`, locateStrategy: 'xpath' }) .setEditorValue(content.content) diff --git a/apps/remix-ide-e2e/src/commands/currentSelectedFileIs.ts b/apps/remix-ide-e2e/src/commands/currentSelectedFileIs.ts index f89f4a36ef..81164cb97a 100644 --- a/apps/remix-ide-e2e/src/commands/currentSelectedFileIs.ts +++ b/apps/remix-ide-e2e/src/commands/currentSelectedFileIs.ts @@ -4,7 +4,7 @@ import EventEmitter from 'events' class CurrentSelectedFileIs extends EventEmitter { command (this: NightwatchBrowser, value: string): NightwatchBrowser { this.api - .waitForElementContainsText('*[data-id="tabs-component"] *[data-id="activeTabTitle"]', value) + .waitForElementContainsText('*[data-id="tabs-component"] *[data-id="tab-active"]', value) .perform(() => { this.emit('complete') }) diff --git a/apps/remix-ide-e2e/src/tests/importFromGithub.test.ts b/apps/remix-ide-e2e/src/tests/importFromGithub.test.ts index e795732522..96f2027dcc 100644 --- a/apps/remix-ide-e2e/src/tests/importFromGithub.test.ts +++ b/apps/remix-ide-e2e/src/tests/importFromGithub.test.ts @@ -58,7 +58,7 @@ module.exports = { .click('[data-id="homeTab-modal-footer-ok-react"]') .openFile('github/OpenZeppelin/openzeppelin-solidity/contracts/access/Roles.sol') .waitForElementVisible({ - selector: `//*[@data-id='activeTabTitle' and contains(., "default_workspace/github/OpenZeppelin/openzeppelin-solidity/contracts/access/Roles.sol")]`, + selector: `//*[@data-id='tab-active' and @data-path="default_workspace/github/OpenZeppelin/openzeppelin-solidity/contracts/access/Roles.sol"]`, locateStrategy: 'xpath' }) .getEditorValue((content) => { diff --git a/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx b/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx index efc3f6cd8a..26640d8038 100644 --- a/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx +++ b/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx @@ -99,9 +99,10 @@ export const TabsUI = (props: TabsUIProps) => { ref={el => { tabsRef.current[index] = el }} className={classNameTab} data-id={index === currentIndexRef.current ? 'tab-active' : ''} + data-path={tab.title} > {tab.icon ? () : ()} - {tab.title} + {tab.title} {getFileDecorationIcons(tab)} { props.onClose(index); event.stopPropagation() }}>