Skip to content

Commit

Permalink
[Table] Stabilize split.spec.js opensearch-project#699
Browse files Browse the repository at this point in the history
Signed-off-by: Arpit Jaswal <iamarpitjaswal@gmail.com>
  • Loading branch information
arpitjaswal committed Aug 10, 2023
1 parent 14892a0 commit c831ff9
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions cypress/utils/dashboards/vis_type_table/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ Cypress.Commands.add('tbGetAllTableDataFromVisualization', (total) => {
let data = [];
for (let i = 0; i < total; i++) {
data.push([]);
cy.get('[class="visTable__group"]')
.eq(i)
cy.get(`[data-test-subj="visTableGroup${i}"]`)
.find('[data-test-subj="dataGridWrapper"]')
.find('[data-test-subj="dataGridRowCell"]')
.find('[class="euiDataGridRowCell__truncate"]')
Expand Down Expand Up @@ -44,8 +43,7 @@ Cypress.Commands.add('tbGetTotalValueFromTable', () => {
Cypress.Commands.add('tbSelectSortColumn', (tableIndex, colIndex, dir) => {
expect(dir).to.be.oneOf(['asc', 'desc']);
const dirIndex = dir == 'asc' ? 0 : 1;
cy.get('[class="visTable__group"]')
.eq(tableIndex)
cy.get(`[data-test-subj="visTableGroup${tableIndex}"]`)
.find('[class="euiDataGridHeaderCell"]')
.eq(colIndex)
.find('[class="euiDataGridHeaderCell__button"]')
Expand All @@ -54,8 +52,7 @@ Cypress.Commands.add('tbSelectSortColumn', (tableIndex, colIndex, dir) => {
});

Cypress.Commands.add('tbGetColumnWidth', (tableIndex, colIndex, name) => {
cy.get('[class="visTable__group"]')
.eq(tableIndex)
cy.get(`[data-test-subj="visTableGroup${tableIndex}"]`)
.find('[data-test-subj="dataGridHeader"]')
.find('[class="euiDataGridHeaderCell"]')
.eq(colIndex)
Expand Down Expand Up @@ -100,8 +97,7 @@ Cypress.Commands.add(
.find(actionButton)
.click({ force: true });
} else {
cy.get('[class="visTable__group"]')
.eq(tableIndex)
cy.get(`[data-test-subj="visTableGroup${tableIndex}"]`)
.find('[data-test-subj="dataGridWrapper"]')
.find('[data-test-subj="dataGridRowCell"]')
.eq(rowIndex * totalColumn + colIndex)
Expand Down

0 comments on commit c831ff9

Please sign in to comment.