Skip to content
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

fix: Fix Cypress test broken by extra dashboards #21915

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import { CHART_LIST } from 'cypress/utils/urls';
import { CHART_LIST, DASHBOARD_LIST } from 'cypress/utils/urls';
import { setGridMode, toggleBulkSelect } from 'cypress/utils';
import {
setFilter,
Expand Down Expand Up @@ -68,6 +68,20 @@ describe('Charts list', () => {
cy.createSampleCharts([0]);
});

after(() => {
cy.visit(DASHBOARD_LIST);
cy.wait(1000);
toggleBulkSelect();
cy.wait(1000);
cy.getBySel('table-row').each($row => {
if ($row.text().indexOf('Sample dashboard') > -1) {
cy.wrap($row).find('input[type="checkbox"]').click();
}
});
cy.getBySel('bulk-select-action').eq(0).contains('Delete').click();
confirmDelete();
});

Comment on lines +71 to +84
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codyml There is a utils that it seems to do this is cy.deleteDashboard(id: number, failOnStatusCode: boolean) or deleteDashboardByName(dashboardName: string, failOnStatusCode: boolean).

it('should show the cross-referenced dashboards in the table cell', () => {
interceptDashboardGet();
cy.getBySel('table-row')
Expand All @@ -92,6 +106,7 @@ describe('Charts list', () => {
saveChartToDashboard('2 - Sample dashboard');
saveChartToDashboard('3 - Sample dashboard');
saveChartToDashboard('4 - Sample dashboard');
cy.wait(500);
visitChartList();
cy.getBySel('count-crosslinks').should('be.visible');
cy.getBySel('crosslinks')
Expand Down