e2e: creates a separate package for selectors (#23858)

* Initial commit

* Chore: fixes after merge

* Chore: removes todos

* Chore: uncomment test

* Chore: adds missing externals to rollup config

* Refactor: selectors is master for everything

* Docs: updates Docs

* Chore: adds e2e-selectors to publish
This commit is contained in:
Hugo Häggmark
2020-04-27 09:09:05 +02:00
committed by GitHub
parent 9ac7263e66
commit b09b49fb37
105 changed files with 691 additions and 760 deletions

View File

@@ -1,6 +1,6 @@
import angular, { ILocationService } from 'angular';
import _ from 'lodash';
import { e2e } from '@grafana/e2e';
import { selectors } from '@grafana/e2e-selectors';
import { VariableSrv } from 'app/features/templating/all';
import { CoreEvents } from '../../../../types';
@@ -9,7 +9,7 @@ export class SubMenuCtrl {
variables: any;
dashboard: any;
submenuEnabled: boolean;
selectors: typeof e2e.pages.Dashboard.SubMenu.selectors;
selectors: typeof selectors.pages.Dashboard.SubMenu;
/** @ngInject */
constructor(private variableSrv: VariableSrv, private $location: ILocationService) {
@@ -19,7 +19,7 @@ export class SubMenuCtrl {
this.dashboard.events.on(CoreEvents.submenuVisibilityChanged, (enabled: boolean) => {
this.submenuEnabled = enabled;
});
this.selectors = e2e.pages.Dashboard.SubMenu.selectors;
this.selectors = selectors.pages.Dashboard.SubMenu;
}
annotationStateChanged() {

View File

@@ -1,6 +1,6 @@
import React, { FunctionComponent, useEffect, useState } from 'react';
import { VariableHide, VariableModel } from '../../../templating/types';
import { e2e } from '@grafana/e2e';
import { selectors } from '@grafana/e2e-selectors';
import { PickerRenderer } from '../../../variables/pickers/PickerRenderer';
interface Props {
@@ -24,7 +24,7 @@ export const SubMenuItems: FunctionComponent<Props> = ({ variables }) => {
<div
key={variable.id}
className="submenu-item gf-form-inline"
aria-label={e2e.pages.Dashboard.SubMenu.selectors.submenuItem}
aria-label={selectors.pages.Dashboard.SubMenu.submenuItem}
>
<PickerRenderer variable={variable} />
</div>