From e6d4bd0f40fd91cb4fb2c2c2e90b708b85316451 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Fri, 17 Mar 2023 15:02:06 +0530 Subject: [PATCH] use data-id for rename ws e2e --- apps/remix-ide-e2e/src/tests/workspace.test.ts | 8 ++------ .../helper/src/lib/components/custom-dropdown.tsx | 3 ++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/workspace.test.ts b/apps/remix-ide-e2e/src/tests/workspace.test.ts index 21e929bea4..4c92ad6be3 100644 --- a/apps/remix-ide-e2e/src/tests/workspace.test.ts +++ b/apps/remix-ide-e2e/src/tests/workspace.test.ts @@ -408,12 +408,8 @@ module.exports = { 'Should rename a workspace #group1': function (browser: NightwatchBrowser) { browser - .useXpath() - .waitForElementPresent({ - selector: '//i[@data-id="workspaceDropdownMenuIcon"]', - locateStrategy: 'xpath', - }) - .click('*[data-id="workspacesMenuDropdown"]') + .waitForElementPresent('*[data-id="workspaceDropdownMenuIcon"]') + .click('*[data-id="workspaceDropdownMenuIcon"]') .waitForElementVisible('*[data-id="wsdropdownMenu"]') .click('*[data-id="workspacerename"]') // rename workspace_name .useCss() diff --git a/libs/remix-ui/helper/src/lib/components/custom-dropdown.tsx b/libs/remix-ui/helper/src/lib/components/custom-dropdown.tsx index 5322b4c61a..c6f9462bc2 100644 --- a/libs/remix-ui/helper/src/lib/components/custom-dropdown.tsx +++ b/libs/remix-ui/helper/src/lib/components/custom-dropdown.tsx @@ -37,7 +37,7 @@ export const CustomIconsToggle = React.forwardRef(({ onClick, icon, className = // forwardRef again here! // Dropdown needs access to the DOM of the Menu to measure it export const CustomMenu = React.forwardRef( - ({ children, style, className, 'aria-labelledby': labeledBy }: { children: React.ReactNode, style?: React.CSSProperties, className: string, 'aria-labelledby'?: string }, ref: Ref) => { + ({ children, style, 'data-id': dataId, className, 'aria-labelledby': labeledBy }: { children: React.ReactNode, style?: React.CSSProperties, 'data-id'?: string, className: string, 'aria-labelledby'?: string }, ref: Ref) => { const height = window.innerHeight * 0.6 return (
    {