Skip to content

Commit

Permalink
fix: Cypress tests reliability improvements (#19800)
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomedina248 committed Apr 22, 2022
1 parent 4dc1934 commit 3f0413b
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ import { CHART_LIST } from './chart_list.helper';
describe('chart list view', () => {
beforeEach(() => {
cy.login();
cy.visit(CHART_LIST);
cy.get('[aria-label="list-view"]').click();
});

it('should load rows', () => {
cy.visit(CHART_LIST);
cy.get('[aria-label="list-view"]').click();

cy.get('[data-test="listview-table"]').should('be.visible');
// check chart list view header
cy.get('[data-test="sort-header"]').eq(1).contains('Chart');
Expand All @@ -49,6 +50,17 @@ describe('chart list view', () => {
});

it('should bulk delete correctly', () => {
// Load the chart list order by name asc.
// This will ensure the tests stay consistent, and the
// same charts get deleted every time
cy.visit(CHART_LIST, {
qs: {
sortColumn: 'slice_name',
sortOrder: 'asc',
},
});
cy.get('[aria-label="list-view"]').click();

cy.get('[data-test="listview-table"]').should('be.visible');
cy.get('[data-test="bulk-select"]').eq(0).click();
cy.get('[aria-label="checkbox-off"]').eq(1).siblings('input').click();
Expand Down

0 comments on commit 3f0413b

Please sign in to comment.