-
Notifications
You must be signed in to change notification settings - Fork 367
Added automated tests with cypress for Service Requests form #9692
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
Added automated tests with cypress for Service Requests form #9692
Conversation
0ac63bc to
20b1181
Compare
b7b7b84 to
4cf95df
Compare
fc56d7a to
e38467e
Compare
e38467e to
c4e6f6f
Compare
c4e6f6f to
08fc52a
Compare
08fc52a to
d14b54b
Compare
| cy.menu(SERVICES_MENU_OPTION, REQUESTS_MENU_OPTION); | ||
| /* Reset */ | ||
| cy.getFormSelectFieldById({ selectId: 'selectedUser' }).select( | ||
| 'Test User 1' |
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.
Is this a user we created or a hardcoded value? The name of the user is curious. If it's coming from the factory, the number is not required to be 1:
spec/factories/user.rb: sequence(:name) { |s| "Test User #{s}" }
Maybe a more generic grep like select would grab the first "Test User" from the select.
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.
Yeah this user is created by factory
Changed the logic to pick any option by value except "all", so that if the username changes later from “Test User” to something else, the test won’t fail
| }).click(); | ||
| cy.gtlGetRows([0]).then((data) => { | ||
| expect(data.length).to.equal(3); | ||
| }); |
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.
Does it make sense to make this a function? It feels like the different filter sections are doing similar things and verifying their results.
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.
Yeah that makes sense
dae33e5 to
296a7a8
Compare
f3a3d62 to
77e1133
Compare
77e1133 to
260fb76
Compare
jrafanie
left a comment
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.
LGTM
CP4AIOPS-18932:
Add test to cover:
- Validate form elements
- Validate reset and apply functionalities
@miq-bot add-label cypress
@miq-bot add-label test
@miq-bot assign @jrafanie