-
Notifications
You must be signed in to change notification settings - Fork 365
Add miq data table commands #9691
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?
Add miq data table commands #9691
Conversation
cypress/support/commands/gtl.js
Outdated
|
|
||
| Cypress.Commands.add('gtl_no_record', () => { | ||
| return cy.get('#miq-gtl-view > div.no-record').should('be.visible'); | ||
| Cypress.Commands.add('verify_gtl_no_records_text', ({ containsText = 'No records' } = {}) => { |
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.
Not sure if this might be better under assertion commands(cypress/support/assertions/)
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 idea.... looks like it follows expect_* convention. Maybe expect_gtl_no_records_with_text or having_text... I think you use with text more commonly elsewhere.
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.
Going with expect_gtl_no_records_with_text 👍
aec3e33 to
acf0295
Compare
| if (columnIndex || columnIndex === 0) { | ||
| cy.contains(`.miq-data-table table tbody tr td:nth-child(${columnIndex + 1})`, text).click(); | ||
| } else { | ||
| cy.contains('.miq-data-table table tbody tr td', text).click(); |
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.
👍 It's good to be case sensitive here and expect exact text since we'll be creating the objects with the right text so it should be easy to ensure we match it correctly.
It will be interesting to see if this miq-data-table structure holds for all pages containing the data table. I hope so but we'll see as we do more pages.
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, I had the same doubt, that’s why I’m keeping the selector minimal(without including classes) for now. Let’s see how it goes....
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.
Looks good so far. I agree with the rename/move to the assertions directory.
acf0295 to
3ffa5fc
Compare
PR to:
no-recordclass as selector, but here ⬇️ it usesno-records-found. To make the assertion more reliable, I removed the class from the selector and switched to asserting based on the visible text instead.Also not sure if this might be better under assertion commands(
cypress/support/assertions/)@miq-bot add-label cypress
@miq-bot add-label enhancement
@miq-bot assign @jrafanie