-
Notifications
You must be signed in to change notification settings - Fork 19
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
Reduce complexity of cypress commands #998
Merged
Merged
Conversation
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
1 flaky test on run #1269 ↗︎
Details:
cypress/e2e/page-list.spec.js • 1 flaky test • Nextcloud stable27
Review all test suite changes for PR #998 ↗︎ |
max-nextcloud
force-pushed
the
test/cypress-cleanup
branch
4 times, most recently
from
November 9, 2023 11:10
216f1ea
to
d5865f5
Compare
max-nextcloud
force-pushed
the
test/cypress-cleanup
branch
2 times, most recently
from
November 9, 2023 14:55
4c8f582
to
79ca16a
Compare
mejo-
approved these changes
Nov 9, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, thanks for diving so deep into improving the logic of our custom Cypress commands. Code changes look great and quite sophisticated (to an extend that I struggled a bit to follow the logic).
Signed-off-by: Max <[email protected]>
Remove the handling of an existing collective during creation as we always delete the collective first. Signed-off-by: Max <[email protected]>
`@nextcloud/axios` deals with request tokens already. If the initial request fails with a 412 it will get a request token and retry: https://github.com/nextcloud-libraries/nextcloud-axios/blob/master/lib/interceptors/csrf-token.ts The additional request is fast so we can reduce the complexity of our test here. Signed-off-by: Max <[email protected]>
Signed-off-by: Max <[email protected]>
Signed-off-by: Max <[email protected]>
Signed-off-by: Max <[email protected]>
`.findBy({ sanitizedName: name })` is the same as `.invoke(find, c => c.sanitizedName === name)`. But it will log the properties the item is selected by. Signed-off-by: Max <[email protected]>
When used as a child command expects an object to be yielded and merges it into the payload: `cy.wrap({ id: 123 }).dispatch(SOME_ACTION, { value: 'Hello' })` will dispatch `SOME_ACTION` with a payload of `{ id: 123, value: \'Hello\'}`. If null is yielded the action won't be dispatched. This is useful for cleanup commands like `deleteCollective`. Signed-off-by: Max <[email protected]>
Signed-off-by: Max <[email protected]>
Signed-off-by: Max <[email protected]>
max-nextcloud
force-pushed
the
test/cypress-cleanup
branch
from
November 9, 2023 20:42
79ca16a
to
ca288be
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📝 Summary
With time we build up quite a bit of complexity in cypress commands that is not necessary.
This PR tries to reduce it step by step, commit by commit.
Best reviewed on a per commit basis I think.
🏁 Checklist
npm run lint
/npm run stylelint
/composer run cs:check
)