grafana/e2e-playwright/dashboard-cujs/global-teardown.spec.ts

20 lines
494 B
TypeScript

import { test } from '@playwright/test';
import { clearDashboardUIDs, getDashboardUIDs } from './dashboardUidsState';
test.describe('Dashboard CUJS Global Teardown', () => {
test('cleanup test dashboards', async ({ request }) => {
const dashboardUIDs = getDashboardUIDs();
if (!dashboardUIDs.length) {
return;
}
for (const dashboardUID of dashboardUIDs) {
await request.delete(`/api/dashboards/uid/${dashboardUID}`);
}
clearDashboardUIDs();
});
});