Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Duplicate Test-Ids] Same test-ids are used in multiple elements #28

Closed
Ryun1 opened this issue Dec 18, 2023 · 6 comments · Fixed by #103
Closed

[Duplicate Test-Ids] Same test-ids are used in multiple elements #28

Ryun1 opened this issue Dec 18, 2023 · 6 comments · Fixed by #103
Assignees
Labels
🖥 Frontend Frontend related

Comments

@Ryun1
Copy link
Member

Ryun1 commented Dec 18, 2023

This issue makes it difficult to interact with the elements.

  1. demos-wallet-button: There are 2 demos-wallet-button test-ids

  2. confirm-modal-button

@Ryun1 Ryun1 added the 🖥 Frontend Frontend related label Dec 18, 2023
@Thomas-Upfield
Copy link

Jan needs to contact the DQuadrant team.

@Thomas-Upfield
Copy link

@IntersectMBO/govtool-test DQuad can you please add more details. Please get in contact with @JanJaroszczak.

@NabinKawan
Copy link
Contributor

Here, multiple elements share the same test-ids for both 'demos-wallet-button' and 'confirm-modal-button', causing confusion in identifying the correct element to interact with during testing. Additionally, the element intended for interaction is obscured by another element.

This issue is addressed through the following Cypress commands:

cy.getBySel("demos-wallet-button").eq(1).click({ force: true });
cy.getBySel("confirm-modal-button").first().click({ force: true });

In these commands, 'force: true' is employed to forcefully click the intended element within the list.

@JanJaroszczak
Copy link
Contributor

I might have overlooked something, but when i look at the code i see only once test ids like 'demos-wallet-button' and 'confirm-modal-button'. @NabinKawan, I'll contact you on Slack - it will be easier to discuss it there.

@JanJaroszczak
Copy link
Contributor

We've discussed it with @NabinKawan. I know where's the issue - solving in progress.

@pmbinapps
Copy link
Contributor

pmbinapps commented Feb 16, 2024

Current data-test-id in test branch for above ids:
govtool % egrep -R 'data-testid.*confirm-modal-button' * govtool/frontend/src/components/organisms/StatusModal.tsx: data-testid={"confirm-modal-button"} govtool % egrep -R 'data-testid.*demos-wallet-button' * %

No other data-test-id occurred.
Ready to merge to stage.

All usage:
% grep -R demos-wallet-button * tests/govtool-frontend/cypress/e2e/actions/commonActions.ts: cy.getBySel("demos-wallet-button").eq(1).click({ force: true }); tests/govtool-frontend/cypress/e2e/actions/commonActions.ts: cy.getBySel("demos-wallet-button").eq(1).click({ force: true }); tests/govtool-frontend/cypress/e2e/actions/commonActions.ts: // cy.getBySel("demos-wallet-button").click(); tests/govtool-frontend/cypress/e2e/actions/commonActions.ts: cy.getBySel("demos-wallet-button").eq(1).click({ force: true }); % grep -R confirm-modal-button * govtool/frontend/src/components/organisms/StatusModal.tsx: data-testid={"confirm-modal-button"} govtool/frontend/src/stories/modals/StatusWithLink.stories.tsx: await userEvent.click(modalCanvas.getByTestId("confirm-modal-button")); govtool/frontend/src/stories/modals/StatusModal.stories.tsx: await userEvent.click(modalCanvas.getByTestId("confirm-modal-button")); tests/govtool-frontend/cypress/e2e/2_user_story_delegate_to_drep.cy.ts: cy.getBySel("confirm-modal-button").first().click({ force: true }); tests/govtool-frontend/cypress/e2e/6_user_story_miscellaneous.cy.ts: cy.getBySel("confirm-modal-button").first().click({ force: true }); tests/govtool-frontend/cypress/e2e/actions/delegateActions.ts: cy.getBySel("confirm-modal-button").first().click({ force: true }); tests/govtool-frontend/cypress/e2e/actions/dRepActions.ts: cy.getBySel("confirm-modal-button").first().click({ force: true }); tests/govtool-frontend/cypress/e2e/actions/dRepActions.ts: cy.getBySel("confirm-modal-button").first().click({ force: true }); tests/govtool-frontend/cypress/e2e/actions/commonActions.ts: cy.getBySel("confirm-modal-button").first().click({ force: true }); // accept the info about sancho net}; tests/govtool-frontend/cypress/e2e/actions/commonActions.ts: cy.getBySel("confirm-modal-button").first().click({ force: true }); // accept the info about sancho net tests/govtool-frontend/cypress/e2e/actions/commonActions.ts: cy.getBySel("confirm-modal-button").first().click({ force: true }); // accept the info about sancho net};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🖥 Frontend Frontend related
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants