e2e tests: Add selector to close dashboard settings and use it in e2e tests (#65625)

* add selector to close dashboard settings and use it in e2e tests

* check visibility of add panel button

* check visibility of add new panel button before clicking
This commit is contained in:
Ashley Harrison
2023-03-31 09:32:44 +01:00
committed by GitHub
parent bbf74b941b
commit a123e0a97c
10 changed files with 32 additions and 16 deletions

View File

@@ -67,6 +67,9 @@ export const Pages = {
`data-testid Dashboard template variables Variable Value DropDown option text ${item}`,
},
Settings: {
Actions: {
close: 'data-testid dashboard-settings-close',
},
General: {
deleteDashBoard: 'Dashboard settings page delete dashboard button',
sectionItems: (item: string) => `Dashboard settings section item ${item}`,

View File

@@ -91,12 +91,14 @@ export const configurePanel = (config: PartialAddPanelConfig | PartialEditPanelC
e2e.components.Panels.Panel.headerItems('Edit').click();
} else {
try {
e2e.components.PageToolbar.item('Add panel').should('be.visible');
e2e.components.PageToolbar.item('Add panel').click();
} catch (e) {
// Depending on the screen size, the "Add panel" button might be hidden
e2e.components.PageToolbar.item('Show more items').click();
e2e.components.PageToolbar.item('Add panel').last().click();
}
e2e.pages.AddDashboard.addNewPanel().should('be.visible');
e2e.pages.AddDashboard.addNewPanel().click();
}