-
Notifications
You must be signed in to change notification settings - Fork 75
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
test/README: add checklists #1149
Conversation
86223a2
to
c026b98
Compare
Readt for review, the actual change is c026b98?short_path=5de36ac#diff-5de36acd90308dc62abf7855a686ee7052ffb6e762c756fd735fb0c9fbd9595d :) |
|
||
`it` + UI helpers: | ||
* always make sure to wait for the last thing that happens automatically when initiating a user action | ||
* for example, when adding a user, waiting for the API response is not enough, since the UI then redirects to the user list screen => wait for the Users list screen to finish loading |
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.
I would like to also add one thing - when you are waiting for API response, that may not be enough, because items must be then rendered and this may cause sporadic failure in situation when you are looking for something that should not exist (for example using contains). Because cypress may (or may not, depends on randomized timing) run before rendering and it then sees that element dont exist, however element may appear after rendering. When you are testing that element do exist, this problem does not appear, because if the contains is not valid (element is not rendered yet), cypres test it several times after several seconds until the element is rendered (to ensure page is in valid state). In this situation, test may fail only if rendering last more than several seconds, which will happen only in rare occasion. So to ensure correct and stable tests, you should use some contains for waiting for some element to be rendered (so it will wait for page render) before you do some test for 'should not exist' element. For example when testing elements in the list, first test the element that should be in the list, then element that should not be in the list.
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.
The readme already says just waiting for the API is not enough, so this sounds like it's solved?
Or is there something I should change here?
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.
(Also, this is not coming from this PR.)
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.
I just wanted to point one problem that may be dangerous, when you "wait" for the render using contains(something).should.not.exists, this will not actualy wait for render, because it will not see the element in the current page state and return true immideately, then element appear in render. Whereas positive contains always wait several seconds if it not sees the element until element eventualy appear in render.
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.
good point, adding a note about should.not.exist
specifically 👍
c026b98
to
662e2c9
Compare
I'll just merge this, it's a README change only, we can always update these later. |
Fixes AAH-1004
This tries to set up checklist for list views, detail views, shared actions, and new/edit forms.