mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
@@ -1,7 +1,8 @@
|
||||
import React, { FC } from 'react';
|
||||
import { InlineFormLabel, LegacyForms } from '@grafana/ui';
|
||||
import { selectors } from '@grafana/e2e-selectors';
|
||||
|
||||
const { Input, Switch } = LegacyForms;
|
||||
import { e2e } from '@grafana/e2e';
|
||||
|
||||
export interface Props {
|
||||
dataSourceName: string;
|
||||
@@ -30,7 +31,7 @@ const BasicSettings: FC<Props> = ({ dataSourceName, isDefault, onDefaultChange,
|
||||
placeholder="Name"
|
||||
onChange={event => onNameChange(event.target.value)}
|
||||
required
|
||||
aria-label={e2e.pages.DataSource.selectors.name}
|
||||
aria-label={selectors.pages.DataSource.name}
|
||||
/>
|
||||
</div>
|
||||
<Switch
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { FC } from 'react';
|
||||
import { e2e } from '@grafana/e2e';
|
||||
import { selectors } from '@grafana/e2e-selectors';
|
||||
|
||||
import config from 'app/core/config';
|
||||
|
||||
@@ -19,7 +19,7 @@ const ButtonRow: FC<Props> = ({ isReadOnly, onDelete, onSubmit, onTest }) => {
|
||||
className="btn btn-primary"
|
||||
disabled={isReadOnly}
|
||||
onClick={event => onSubmit(event)}
|
||||
aria-label={e2e.pages.DataSource.selectors.saveAndTest}
|
||||
aria-label={selectors.pages.DataSource.saveAndTest}
|
||||
>
|
||||
Save & Test
|
||||
</button>
|
||||
@@ -34,7 +34,7 @@ const ButtonRow: FC<Props> = ({ isReadOnly, onDelete, onSubmit, onTest }) => {
|
||||
className="btn btn-danger"
|
||||
disabled={isReadOnly}
|
||||
onClick={onDelete}
|
||||
aria-label={e2e.pages.DataSource.selectors.delete}
|
||||
aria-label={selectors.pages.DataSource.delete}
|
||||
>
|
||||
Delete
|
||||
</button>
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
import { hot } from 'react-hot-loader';
|
||||
import isString from 'lodash/isString';
|
||||
import { e2e } from '@grafana/e2e';
|
||||
import { Icon } from '@grafana/ui';
|
||||
import { selectors } from '@grafana/e2e-selectors';
|
||||
// Components
|
||||
import Page from 'app/core/components/Page/Page';
|
||||
import { GenericDataSourcePlugin, PluginSettings } from './PluginSettings';
|
||||
@@ -24,7 +25,6 @@ import { getRouteParamsId } from 'app/core/selectors/location';
|
||||
// Types
|
||||
import { CoreEvents, StoreState } from 'app/types/';
|
||||
import { DataSourcePluginMeta, DataSourceSettings, NavModel, UrlQueryMap } from '@grafana/data';
|
||||
import { Icon } from '@grafana/ui';
|
||||
import { getDataSourceLoadingNav } from '../state/navModel';
|
||||
import PluginStateinfo from 'app/features/plugins/PluginStateInfo';
|
||||
import { dataSourceLoaded, setDataSourceName, setIsDefault } from '../state/reducers';
|
||||
@@ -204,12 +204,12 @@ export class DataSourceSettingsPage extends PureComponent<Props> {
|
||||
|
||||
<div className="gf-form-group">
|
||||
{testingStatus && testingStatus.message && (
|
||||
<div className={`alert-${testingStatus.status} alert`} aria-label={e2e.pages.DataSource.selectors.alert}>
|
||||
<div className={`alert-${testingStatus.status} alert`} aria-label={selectors.pages.DataSource.alert}>
|
||||
<div className="alert-icon">
|
||||
{testingStatus.status === 'error' ? <Icon name="exclamation-triangle" /> : <Icon name="check" />}
|
||||
</div>
|
||||
<div className="alert-body">
|
||||
<div className="alert-title" aria-label={e2e.pages.DataSource.selectors.alertMessage}>
|
||||
<div className="alert-title" aria-label={selectors.pages.DataSource.alertMessage}>
|
||||
{testingStatus.message}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user