We have instances where testIDs are not consistently stored in variables. This lack of uniformity can lead to redundant testID declarations throughout the codebase, resulting in code that is harder to maintain and prone to errors.
For instance, consider the following code snippet: testID={'request-qrcode-button'}. This line directly specifies a testID value within the code, and similar declarations may be scattered throughout the codebase.
A more effective and best-practice approach is to store the testID value as a variable and then reference that variable when defining the testID property. By doing so, we centralize the testID values, reducing redundancy and making it easier to manage and maintain these identifiers throughout the codebase. This approach enhances code consistency and reduces the likelihood of introducing errors, ultimately contributing to a more robust and maintainable codebase.
Technical details:
Replace all string definitions used for testIDs. For example: testID={BrowserUrlModalSelectorsIDs.CONTAINER}
All variables should be group by the file where they're being call
All variables should be group in a JSON
File structure should follow a similar structure as the main app structure
Acceptance Criteria
[ ] pr_regression_e2e_pipeline and pr_smoke_e2e_pipeline in bitrise should have passing tests
[ ] These files should no longer selector strings in the TestID prop:
app/component-library/components/Icons/Icon/Icon.test.tsx
app/components/UI/AccountOverview/index.js
app/components/UI/AccountRightButton/index.tsx
app/components/UI/AddCustomCollectible/index.tsx
app/components/UI/AddressInputs/index.js
app/components/UI/ApproveTransactionReview/index.js
app/components/UI/AssetList/index.js
Description
We have instances where testIDs are not consistently stored in variables. This lack of uniformity can lead to redundant testID declarations throughout the codebase, resulting in code that is harder to maintain and prone to errors.
For instance, consider the following code snippet:
testID={'request-qrcode-button'}.
This line directly specifies a testID value within the code, and similar declarations may be scattered throughout the codebase.A more effective and best-practice approach is to store the testID value as a variable and then reference that variable when defining the testID property. By doing so, we centralize the testID values, reducing redundancy and making it easier to manage and maintain these identifiers throughout the codebase. This approach enhances code consistency and reduces the likelihood of introducing errors, ultimately contributing to a more robust and maintainable codebase.
Technical details:
Replace all string definitions used for testIDs. For example:
testID={BrowserUrlModalSelectorsIDs.CONTAINER}
All variables should be group by the file where they're being call All variables should be group in a JSON File structure should follow a similar structure as the main app structureAcceptance Criteria
[ ] pr_regression_e2e_pipeline and pr_smoke_e2e_pipeline in bitrise should have passing tests
[ ] These files should no longer selector strings in the TestID prop: app/component-library/components/Icons/Icon/Icon.test.tsx app/components/UI/AccountOverview/index.js app/components/UI/AccountRightButton/index.tsx app/components/UI/AddCustomCollectible/index.tsx app/components/UI/AddressInputs/index.js app/components/UI/ApproveTransactionReview/index.js app/components/UI/AssetList/index.js