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

SNOW-142: Adjusting MonkeyTestingOptions #211

Merged
merged 12 commits into from
Oct 27, 2022
Merged

SNOW-142: Adjusting MonkeyTestingOptions #211

merged 12 commits into from
Oct 27, 2022

Conversation

Psichorex
Copy link
Contributor

Comment on lines 56 to 58
if (element.getAttribute('action') === '/Users/LogOff') {
return false;
}
Copy link
Member

Choose a reason for hiding this comment

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

This shouldn't be there in general. By default, we want monkey testing to also be able to log out the user.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

By the behavior of the test if it logs out, how would it log back again? The problem was it logged out and tried to navigate back to a link which was not available for anonymous users

Copy link
Member

Choose a reason for hiding this comment

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

Logging back in isn't necessarily desired. The point of monkey testing is to do random interactions. If that leads to logout, then that's fine, and the application should keep working as designed even after that.

That behavior should result in the login screen being shown, and that should be accepted by the test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is understandable. My question is then how is that possible that after logging out it tried to navigate to /RequestDemo/Success or something like that needs permission. Is it intended functionality?

Copy link
Member

Choose a reason for hiding this comment

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

I suppose even after logout, there was a UI element that when interacted with, brought the browser to /RequestDemo/Success.

Copy link
Member

Choose a reason for hiding this comment

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

Monkey tests don't navigate back unless there's a UI element in the app for it. And if there is, then the app should still keep on working, as that's something that any user can do. (Even if you e.g. log out in one tab and click on something in another tab that only an authenticated user would see, the app should still not break.) So again, I don't see why preventing monkey tests from logging out would make sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason of fail is RequestDemo/Success will be a 404 unless you are submitting a legit request for a demo.
If you go back to /Success there will be problems in the controller and it will return NotFound() which is legit and the app should work and it is working just because you got a 404 for a route. But a 404 will fail a UITest and that is a problem.

Copy link
Member

Choose a reason for hiding this comment

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

You can configure the test with a custom browser log assertion that excludes that page from the 404 fail. You can BTW also change GremlinsSpecies from the test if you want to prevent logout in your app, but it's not suitable as a blanket configuration for everyone.

Copy link
Contributor Author

@Psichorex Psichorex Oct 21, 2022

Choose a reason for hiding this comment

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

@Piedone Should n't this code do the same as in the Javascript? Cause I believe it should thus we can save the JS magic.
germ

Copy link
Member

Choose a reason for hiding this comment

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

Please check it out in the code and you should get a definitive answer.

@barthamark barthamark merged commit 07885bb into dev Oct 27, 2022
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