-
Notifications
You must be signed in to change notification settings - Fork 366
Fixed gtl cypress functions and refactor rates.cy.js #9028
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
Conversation
cypress/README.md
Outdated
| * `cy.gtl_no_record` - check that `No data` message is present | ||
| * `cy.gtl_click('Name')` - click on a GTL | ||
| * `cy.gtlGetTable` - return GTL table | ||
| * `cy.gtlGetRows(columns)` - return GTL table row data in an array. columns: Array of ints of columns to read. Example: [1,2,3] will return all row data from columns 1,2 and 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.
Is this index value 0-based or 1-based?
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.
Assuming it's 0-based, I think this might be a nice way to present that:
| * `cy.gtlGetRows(columns)` - return GTL table row data in an array. columns: Array of ints of columns to read. Example: [1,2,3] will return all row data from columns 1,2 and 3. | |
| * `cy.gtlGetRows(columns)` - return GTL table row data in an array. columns: Array of 0-based indexes of the columns to read (e.g. [1, 2, 3] will return all row data from columns 1, 2, and 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.
I also noticed getRows can be called without the parameter, so we may want to add something like "Default value for columns is to return all columns."
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.
Default value right now is column 1 (usually the name/description column). Should I change that?
EDIT: Actually would it make more sense to just remove the default parameter and just always have the user input the columns they want to read? This might be better since we wouldn't have to find the number of columns for the table
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 index value 0-based or 1-based?
@Fryguy It is 0 based but 0 is the checkbox column for this table. Tables without the checkbox would have the first column as 0 still
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.
Ok, then I think we should still say 0-based in the 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.
Actually would it make more sense to just remove the default parameter and just always have the user input the columns they want to read? This might be better since we wouldn't have to find the number of columns for the table
Yeah that's better, because the caller (the test) is really the only one that knows the "correct" column
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.
Sounds good, made the fix and re-pushed
3adb75a to
0a5f28d
Compare
cypress/support/commands/gtl.js
Outdated
| return cy.get('#miq-gtl-view > .miq-data-table > .miq-data-table > .bx--data-table-content > table'); | ||
| }); | ||
|
|
||
| // columns: Array of ints of columns to read. Example: [1,2,3] will return all row data from columns 1,2 and 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.
Once we've worked out the README text, these comments should be updated to match (same with the other method below)
0a5f28d to
4e2aeb7
Compare
4e2aeb7 to
6cf843e
Compare
|
Checked commit GilbertCherrie@6cf843e with ruby 2.7.8, rubocop 1.56.3, haml-lint 0.51.0, and yamllint |
Fixed the gtl cypress helper functions and updated their documentation. Also refactored rates.cy.js to use these new gtl helper functions.