-
Notifications
You must be signed in to change notification settings - Fork 364
Edit collect logs form cypress refactor #9516
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
base: master
Are you sure you want to change the base?
Edit collect logs form cypress refactor #9516
Conversation
df8d9be
to
b6be458
Compare
|
sorry, I can't read the error in the screenshot. Is that the session issue losing the tree info? |
Yes a similar one, |
b6be458
to
a5142fd
Compare
Checked commits asirvadAbrahamVarghese/manageiq-ui-classic@1d5b2a8~...a5142fd with ruby 3.1.7, rubocop 1.56.3, haml-lint 0.64.0, and yamllint |
Ok, I still have to get back to that one but I'm pretty sure it's a session race condition where one puma thread overwrites another threads session update. |
} | ||
|
||
function resetButtonValidation() { | ||
// Confirm Reset button is disabled initially | ||
cy.get('#diagnostics_collect_logs .bx--btn-set button[type="button"]') | ||
.contains('Reset') | ||
.contains(resetButton) |
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.
FYI, I just learned that cypress will retry the last query it did until the timeout. If you do cy.contains(selector, text)
, it will retry the whole thing and not just the contains
call. If we rerender things and update the DOM element, we should probably avoid doing cy.get(selector).contains(string)
as we may get the element before it's updated in the DOM. Instead, we should use cy.contains(selector+sub element, string)
https://www.youtube.com/watch?v=VSIaDbv4GyE
See also:
https://youtu.be/AhgkBjOF5Ts?t=1530
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 am thinking about making this as a new custom command, like I mentioned here
Cypress.Commands.add('getFormFooterButtonByType', (type, name) => {
return cy.contains(`#main-content .bx--btn-set button[type="${type}"]`, name);
});
flashMessageOperationCanceled, | ||
} = textConstants; | ||
|
||
function interceptAndAwaitApi({ |
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.
We might want to extract this to a custom command for use in other tests.
4491ed3
to
dca3967
Compare
dca3967
to
0b9cb2e
Compare
PR that refactors Cypress tests for Collect Logs edit form also include review comments changes from #9508
@miq-bot assign @jrafanie
@miq-bot add-label cypress
@miq-bot add-label test