Search: add basic e2e test for the folder view (#55820)

This commit is contained in:
Artur Wierzbicki
2022-09-28 09:46:24 +04:00
committed by GitHub
parent d9d7bff793
commit 202dce66ff
6 changed files with 259 additions and 2 deletions
@@ -0,0 +1,28 @@
import { e2e } from '@grafana/e2e';
import testDashboard from '../dashboards/TestDashboard.json';
e2e.scenario({
describeName: 'Dashboard search',
itName: 'Basic folder view test',
addScenarioDataSource: false,
addScenarioDashBoard: false,
skipScenario: false,
scenario: () => {
e2e.flows.importDashboard(testDashboard, 1000, true);
e2e.pages.Search.FolderView.visit();
// folder view is collapsed - verify its content does not exist
e2e.components.Search.folderContent('General').should('not.exist');
e2e.components.Search.dashboardItem('E2E Test - Dashboard Search').should('not.exist');
e2e.components.Search.folderHeader('General').click({ force: true });
e2e.components.Search.folderContent('General').should('be.visible');
e2e.components.Search.dashboardItem('E2E Test - Import Dashboard').should('be.visible');
// verify the imported dashboard is the only dashboard present in the folder
e2e().get('[data-testid^="data-testid Dashboard search item "]').should('have.length', 1);
},
});