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

test/README: add checklists #1149

Merged
merged 3 commits into from
Feb 2, 2022
Merged

Conversation

himdel
Copy link
Collaborator

@himdel himdel commented Oct 30, 2021

Fixes AAH-1004

This tries to set up checklist for list views, detail views, shared actions, and new/edit forms.

@himdel
Copy link
Collaborator Author

himdel commented Dec 13, 2021

@himdel himdel marked this pull request as ready for review December 13, 2021 22:42
@himdel himdel requested review from MilanPospisil and removed request for ZitaNemeckova January 4, 2022 05:20

`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
Copy link
Contributor

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.

Copy link
Collaborator Author

@himdel himdel Jan 11, 2022

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?

Copy link
Collaborator Author

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.)

Copy link
Contributor

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.

Copy link
Collaborator Author

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 👍

@himdel
Copy link
Collaborator Author

himdel commented Feb 2, 2022

I'll just merge this, it's a README change only, we can always update these later.

@himdel himdel merged commit 3fe9fa6 into ansible:master Feb 2, 2022
@himdel himdel deleted the test-readme-checklists branch February 2, 2022 21:43
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.

None yet

2 participants