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

Add Cypress tags to FCL repos #291

Open
codingone21 opened this issue Aug 25, 2022 · 0 comments
Open

Add Cypress tags to FCL repos #291

codingone21 opened this issue Aug 25, 2022 · 0 comments
Assignees
Labels
feature New functionality that satisfies a specific use case or set of use cases feedback

Comments

@codingone21
Copy link
Contributor

codingone21 commented Aug 25, 2022

Data tags, specifically "data-cy" is used to search and identify web components for cypress testing. This is a better practice when selecting elements - see: https://docs.cypress.io/guides/references/best-practices#Selecting-Elements.

We added data-cy tags to the repos in our control, but we could also add it to the external repositories that we 'pull' web components from. An example scenario is below, where we search for components from FCL wallet without using the data-cy tags.

// FCL wallet runs in iframe, and we can currently only access the elements by searching for its contents, rather

      // FCL wallet runs in iframe, and we can currently only access the elements by searching for its contents, rather
      // than labelling elements like data-cy=... Adding data tags would require changes in FCL
      getIframeBody().contains("Create New Account").click();
      getIframeBody().contains("button", "Create").click();
      getIframeBody().contains("Account Created").should("exist");

Eventually, it would be nice to modify web components like the above to contain data-cy tags. This means that we go into repos like 'fcl-dev-wallet' and update the source code there. For the example above, the source could would be:
https://github.com/onflow/fcl-dev-wallet/blob/1602ca26289f51908220320255092f6962335933/components/AccountsList.tsx

@codingone21 codingone21 added feature New functionality that satisfies a specific use case or set of use cases feedback labels Aug 25, 2022
@codingone21 codingone21 self-assigned this Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality that satisfies a specific use case or set of use cases feedback
Projects
None yet
Development

No branches or pull requests

1 participant