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: Avoid failing tests due to page reload conditions causing exceptions #1908

Merged
merged 1 commit into from
Oct 25, 2021

Conversation

juliusknorr
Copy link
Member

This should hopefully avoid failures like in https://github.com/nextcloud/text/runs/3961812279 where the page navigation in the after all hook caused an exception that is thrown which then marks a test as failed. Instead we just ignore that since the page is navigating away.

@juliusknorr juliusknorr added tests If you write them we ♥ you 3. to review labels Oct 21, 2021
@juliusknorr juliusknorr changed the title Avoid failing tests due to page reload conditions causing exceptions Cypress: Avoid failing tests due to page reload conditions causing exceptions Oct 21, 2021
Copy link
Contributor

@azul azul left a comment

Choose a reason for hiding this comment

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

Looks good to me.

I don't think there are any exceptions during these steps that we would miss.
We need to make sure to check the actual test is done before running the after step. So tests should end with an assertion that checks if the last step has really completed and succeeded. But i think that's something we want independently of this change.

@azul azul self-requested a review October 25, 2021 06:57
Copy link
Contributor

@azul azul left a comment

Choose a reason for hiding this comment

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

removed duplicate

@azul azul self-requested a review October 25, 2021 07:01
Copy link
Contributor

@azul azul left a comment

Choose a reason for hiding this comment

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

So I had a look at the tests to check if they actually check things are done. All tests follow the share link to test it and make sure the editor renders fine. So that's cool.

But turns out that one test logs out already in order to test the public share link. This seems to be the only test that blows up in the after function. I suspect that's because we attempt to logout twice.

Catching the exception created by the duplicate logout attempt does not seem like the right approach to me. I think we should refactor the test instead to only loggout when needed.

@azul azul self-requested a review October 25, 2021 07:09
Copy link
Contributor

@azul azul left a comment

Choose a reason for hiding this comment

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

Ah... i was confused. it is a different test that does the logout. so that's not what's failing here. Sorry for the noise.

Signed-off-by: Julius Härtl <jus@bitgrid.net>
@azul azul force-pushed the tests/noid/cypress-stabilizing branch from 246ae8b to 44f29af Compare October 25, 2021 07:42
@juliusknorr juliusknorr merged commit d7f10f4 into master Oct 25, 2021
@juliusknorr juliusknorr deleted the tests/noid/cypress-stabilizing branch October 25, 2021 08:19
@skjnldsv skjnldsv mentioned this pull request Oct 25, 2021
25 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review tests If you write them we ♥ you
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants