-
Notifications
You must be signed in to change notification settings - Fork 365
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
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);
});
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.
PR with selector commands for common form elements: #9537
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.
dca3967
to
0b9cb2e
Compare
Requires #9531 to be merged for further refactor |
DONE, feel free to continue on with this one. |
@asirvadAbrahamVarghese can you look at the failing test in the collect logs tests? |
0b9cb2e
to
a3e98c3
Compare
Todo in a follow up 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.
LGTM. I always notice how things are named. We might want different names for some of these specific functions for collect logs but since I don't have better suggestions, let's just go forward and rename if we find better ideas.
…s-form-cypress-refactor Follow up works from #9516
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