-
Notifications
You must be signed in to change notification settings - Fork 515
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
1,231 additions
and
1,089 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,52 @@ | ||
# Best Practices | ||
|
||
## Test Independence | ||
|
||
- Each test should be independent and isolated | ||
- Clean up test data after tests | ||
- Don't rely on the state from other tests | ||
|
||
## API Testing | ||
|
||
- Use cy.intercept() for API verification | ||
- Use waitUntil() for API completion | ||
- Avoid cy.wait() except for API responses | ||
|
||
## Element Interaction | ||
|
||
- Always verify element state before interaction | ||
- Use data-cy attributes for selectors | ||
- Verify button text before clicking | ||
- Always verify loading states before and after interactions | ||
|
||
## Code Organization | ||
|
||
- Keep tests focused and concise | ||
- Follow AAA pattern (Arrange, Act, Assert) | ||
- Use meaningful test descriptions | ||
|
||
## Common Pitfalls to Avoid | ||
|
||
- Redundant visibility checks with verifyAndClickElement | ||
- Hardcoded values in page objects | ||
- Unnecessary waits | ||
- Test interdependencies | ||
- Skipping API verifications | ||
- Using arbitrary timeouts instead of proper waits | ||
|
||
## Performance Considerations | ||
|
||
- Minimize unnecessary API calls | ||
- Use efficient selectors | ||
- Batch similar operations | ||
- Batch similar operations | ||
|
||
## Testing Checklist | ||
|
||
Before submitting your test, verify: | ||
|
||
- [ ] All API calls are intercepted and verified | ||
- [ ] Loading states are handled properly | ||
- [ ] Success/error states are verified | ||
- [ ] No arbitrary timeouts used | ||
- [ ] Search operations include debounce handling | ||
- [ ] Form submissions verify both request and response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.