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

Cypress: Improve request token handling, attachments test #5129

Merged
merged 5 commits into from
Dec 13, 2023

Conversation

max-nextcloud
Copy link
Collaborator

📝 Summary

Make sure to reuse the same token as long as its valid and clear it when it does not match the current session anymore (login, visit).

Also make the cypress logs less verbose and easier to parse.

🖼️ Screenshots

🏚️ Before 🏡 After
Bildschirmfoto vom 2023-12-13 12-57-28 Bildschirmfoto vom 2023-12-13 12-56-20

🚧 TODO

  • see if this fixes the tests in CI

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • this PR improves tests
  • no need for docs

* Use `this.requesttoken` rather than `cy.get(@requesttoken)`
  to use the same value rather than re-evaluating the query.
* After visit `this.requesttoken` will be set.
  No need to attempt to load the token from the window
  if it is not.
* Use a simple `if` statement instead of `cypress-if`.
* This also cleans up the cypress logs significantly.

Signed-off-by: Max <[email protected]>
* call `cy.showHiddenfiles()` before loading the page.
* Clear `requesttoken` in `cy.login()`.

Signed-off-by: Max <[email protected]>
@max-nextcloud max-nextcloud requested a review from mejo- December 13, 2023 12:55
Copy link
Member

@mejo- mejo- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into this! Changes look sensible, and great to get rid of cypress-if again 🎉

@max-nextcloud
Copy link
Collaborator Author

/backport to stable28

@max-nextcloud max-nextcloud merged commit b083963 into main Dec 13, 2023
45 of 47 checks passed
@max-nextcloud max-nextcloud deleted the test/better-cy-logs branch December 13, 2023 16:18
@juliusknorr
Copy link
Member

/backport to stable28

@backportbot-nextcloud
Copy link

The backport to stable28 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable28
git pull origin stable28

# Create the new backport branch
git checkout -b fix/foo-stable28

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123

# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable28

Error: Unknown error

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants