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

@@ -2,7 +2,7 @@ import _ from 'lodash';
import { IScope } from 'angular';
import { getBackendSrv } from '@grafana/runtime';
import { dateMath, dateTime } from '@grafana/data';
import { e2e } from '@grafana/e2e';
import { selectors } from '@grafana/e2e-selectors';
import { QueryCtrl } from 'app/plugins/sdk';
import { defaultQuery } from './runStreams';
@@ -34,7 +34,7 @@ export class TestDataQueryCtrl extends QueryCtrl {
digest: (promise: Promise<any>) => Promise<any>;
showLabels = false;
selectors: typeof e2e.components.DataSource.TestData.QueryTab.selectors;
selectors: typeof selectors.components.DataSource.TestData.QueryTab;
/** @ngInject */
constructor($scope: IScope, $injector: any) {
@@ -45,7 +45,7 @@ export class TestDataQueryCtrl extends QueryCtrl {
this.newPointTime = dateTime();
this.selectedPoint = { text: 'Select point', value: null };
this.showLabels = showLabelsFor.includes(this.target.scenarioId);
this.selectors = e2e.components.DataSource.TestData.QueryTab.selectors;
this.selectors = selectors.components.DataSource.TestData.QueryTab;
}
getPoints() {

View File

@@ -1,8 +1,8 @@
import React, { PureComponent } from 'react';
import classNames from 'classnames';
import { TimeSeries } from 'app/core/core';
import { SeriesColorPicker, Icon } from '@grafana/ui';
import { e2e } from '@grafana/e2e';
import { Icon, SeriesColorPicker } from '@grafana/ui';
import { selectors } from '@grafana/e2e-selectors';
export const LEGEND_STATS = ['min', 'max', 'avg', 'current', 'total'];
@@ -143,7 +143,7 @@ class LegendSeriesLabel extends PureComponent<LegendSeriesLabelProps & LegendSer
title={label}
key="label"
onClick={e => this.props.onLabelClick(e)}
aria-label={e2e.components.Panels.Visualization.Graph.Legend.selectors.legendItemAlias(label)}
aria-label={selectors.components.Panels.Visualization.Graph.Legend.legendItemAlias(label)}
>
{label}
</a>,

View File

@@ -1,4 +1,4 @@
import { e2e } from '@grafana/e2e';
import { selectors } from '@grafana/e2e-selectors';
import { GraphCtrl } from './module';
export class AxesEditorCtrl {
@@ -8,7 +8,7 @@ export class AxesEditorCtrl {
xAxisModes: any;
xAxisStatOptions: any;
xNameSegment: any;
selectors: typeof e2e.components.Panels.Visualization.Graph.VisualizationTab.selectors;
selectors: typeof selectors.components.Panels.Visualization.Graph.VisualizationTab;
/** @ngInject */
constructor(private $scope: any) {
@@ -45,7 +45,7 @@ export class AxesEditorCtrl {
this.panel.xaxis.name = 'specify field';
}
}
this.selectors = e2e.components.Panels.Visualization.Graph.VisualizationTab.selectors;
this.selectors = selectors.components.Panels.Visualization.Graph.VisualizationTab;
}
setUnitFormat(axis: { format: any }) {