e2e: Update annotation marker selector (#67135)

pull/67156/head
Adela Almasan 3 years ago committed by GitHub
parent a6577cc6fd
commit c4c747cca6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      e2e/various-suite/filter-annotations.spec.ts
  2. 2
      e2e/various-suite/query-editor.spec.ts
  3. 6
      packages/grafana-e2e-selectors/src/selectors/pages.ts
  4. 2
      public/app/plugins/panel/timeseries/plugins/annotations/AnnotationMarker.tsx

@ -55,7 +55,7 @@ e2e.scenario({
e2e.components.Panels.Panel.title('Panel one') e2e.components.Panels.Panel.title('Panel one')
.should('exist') .should('exist')
.within(() => { .within(() => {
e2e.pages.SoloPanel.Annotations.marker().should('exist').should('have.length', 4); e2e.pages.Dashboard.Annotations.marker().should('exist').should('have.length', 4);
}); });
}, },
}); });

@ -2,7 +2,7 @@ import { e2e } from '@grafana/e2e';
e2e.scenario({ e2e.scenario({
describeName: 'Query editor', describeName: 'Query editor',
itName: 'Undo should work in query editor for prometheus.', itName: 'Undo should work in query editor for prometheus -- test CI.',
addScenarioDataSource: false, addScenarioDataSource: false,
addScenarioDashBoard: false, addScenarioDashBoard: false,
skipScenario: false, skipScenario: false,

@ -177,6 +177,9 @@ export const Pages = {
}, },
}, },
}, },
Annotations: {
marker: 'data-testid annotation-marker',
},
}, },
Dashboards: { Dashboards: {
url: '/dashboards', url: '/dashboards',
@ -249,9 +252,6 @@ export const Pages = {
}, },
SoloPanel: { SoloPanel: {
url: (page: string) => `/d-solo/${page}`, url: (page: string) => `/d-solo/${page}`,
Annotations: {
marker: 'data-testid annotation-marker',
},
}, },
PluginsList: { PluginsList: {
page: 'Plugins list page', page: 'Plugins list page',

@ -127,7 +127,7 @@ export function AnnotationMarker({ annotation, timeZone, width }: Props) {
onMouseEnter={onMouseEnter} onMouseEnter={onMouseEnter}
onMouseLeave={onMouseLeave} onMouseLeave={onMouseLeave}
className={!isRegionAnnotation ? styles.markerWrapper : undefined} className={!isRegionAnnotation ? styles.markerWrapper : undefined}
data-testid={selectors.pages.SoloPanel.Annotations.marker} data-testid={selectors.pages.Dashboard.Annotations.marker}
> >
{marker} {marker}
</div> </div>

Loading…
Cancel
Save