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

@@ -3,6 +3,7 @@ import React, { useEffect, useMemo, useState } from 'react';
import { useLocation } from 'react-router-dom';
import { locationUtil, NavModel, NavModelItem } from '@grafana/data';
import { selectors } from '@grafana/e2e-selectors';
import { locationService } from '@grafana/runtime';
import { Button, PageToolbar, ToolbarButtonRow } from '@grafana/ui';
import { AppChromeUpdate } from 'app/core/components/AppChrome/AppChromeUpdate';
@@ -59,7 +60,14 @@ export function DashboardSettings({ dashboard, editview, pageNav, sectionNav }:
const actions = [
config.featureToggles.topnav && (
<Button variant="secondary" key="close" fill="outline" size={size} onClick={onClose}>
<Button
data-testid={selectors.pages.Dashboard.Settings.Actions.close}
variant="secondary"
key="close"
fill="outline"
size={size}
onClick={onClose}
>
Close
</Button>
),