mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
@@ -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}`,
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user