diff --git a/e2e/cypress/downloads/downloads.html b/e2e/cypress/downloads/downloads.html new file mode 100644 index 00000000000..dbe6b7b70da Binary files /dev/null and b/e2e/cypress/downloads/downloads.html differ diff --git a/e2e/old-arch/various-suite/helpers/prometheus-helpers.ts b/e2e/old-arch/various-suite/helpers/prometheus-helpers.ts index 0102bcec3ab..5223c2f4571 100644 --- a/e2e/old-arch/various-suite/helpers/prometheus-helpers.ts +++ b/e2e/old-arch/various-suite/helpers/prometheus-helpers.ts @@ -14,6 +14,8 @@ export function createPromDS(dataSourceID: string, name: string): void { .should('be.visible') // prevents flakiness .click(); + e2e.pages.ConnectionsDataSource.button().should('exist').click(); + // add url for DS to save without error e2e.components.DataSource.Prometheus.configPage.connectionSettings().type('http://prom-url:9090'); diff --git a/e2e/old-arch/various-suite/prometheus-editor.spec.ts b/e2e/old-arch/various-suite/prometheus-editor.spec.ts index 7b3093f4f5d..7b06cdac619 100644 --- a/e2e/old-arch/various-suite/prometheus-editor.spec.ts +++ b/e2e/old-arch/various-suite/prometheus-editor.spec.ts @@ -22,6 +22,8 @@ function navigateToEditor(editorType: editorType, name: string): void { .should('be.visible') // prevents flakiness .click(); + e2e.pages.ConnectionsDataSource.button().should('exist').click(); + // choose default editor e2e.components.DataSource.Prometheus.configPage.defaultEditor().scrollIntoView().should('exist').click(); selectOption(editorType); diff --git a/packages/grafana-e2e-selectors/src/selectors/pages.ts b/packages/grafana-e2e-selectors/src/selectors/pages.ts index 1fa640a2563..5a3e8597f93 100644 --- a/packages/grafana-e2e-selectors/src/selectors/pages.ts +++ b/packages/grafana-e2e-selectors/src/selectors/pages.ts @@ -99,13 +99,21 @@ export const versionedPages = { }, AddDataSource: { url: { - [MIN_GRAFANA_VERSION]: '/datasources/new', + [MIN_GRAFANA_VERSION]: '/connections/add-new-connection?cat=data-source', }, dataSourcePluginsV2: { '9.3.1': (pluginName: string) => `Add new data source ${pluginName}`, [MIN_GRAFANA_VERSION]: (pluginName: string) => `Data source plugin item ${pluginName}`, }, }, + ConnectionsDataSource: { + url: { + [MIN_GRAFANA_VERSION]: (dataSourceUid: string) => `/connections/datasources/${dataSourceUid}`, + }, + button: { + '12.4.0': 'data-testid Add new data source button', + }, + }, ConfirmModal: { delete: { '10.0.0': 'data-testid Confirm Modal Danger Button', diff --git a/public/app/features/connections/tabs/ConnectData/CardGrid/CardGrid.tsx b/public/app/features/connections/tabs/ConnectData/CardGrid/CardGrid.tsx index ce1e9b51681..495f99c807c 100644 --- a/public/app/features/connections/tabs/ConnectData/CardGrid/CardGrid.tsx +++ b/public/app/features/connections/tabs/ConnectData/CardGrid/CardGrid.tsx @@ -1,7 +1,8 @@ import { css } from '@emotion/css'; import * as React from 'react'; -import { GrafanaTheme2 } from '@grafana/data'; +import { GrafanaTheme2, PluginType } from '@grafana/data'; +import { selectors as e2eSelectors } from '@grafana/e2e-selectors'; import { t } from '@grafana/i18n'; import { featureEnabled } from '@grafana/runtime'; import { Badge, Card, Grid, Stack, useStyles2 } from '@grafana/ui'; @@ -80,6 +81,7 @@ export interface CardGridProps { export const CardGrid = ({ items, onClickItem }: CardGridProps) => { const styles = useStyles2(getStyles); + console.log('items', items); return ( {items.map((item) => ( @@ -94,7 +96,16 @@ export const CardGrid = ({ items, onClickItem }: CardGridProps) => { } }} > - {item.name} + + {item.name} + diff --git a/public/app/features/plugins/admin/components/GetStartedWithPlugin/GetStartedWithDataSource.tsx b/public/app/features/plugins/admin/components/GetStartedWithPlugin/GetStartedWithDataSource.tsx index eba64519719..7c5b6feb7fa 100644 --- a/public/app/features/plugins/admin/components/GetStartedWithPlugin/GetStartedWithDataSource.tsx +++ b/public/app/features/plugins/admin/components/GetStartedWithPlugin/GetStartedWithDataSource.tsx @@ -2,6 +2,7 @@ import { useCallback } from 'react'; import * as React from 'react'; import { DataSourcePluginMeta } from '@grafana/data'; +import { selectors as e2eSelectors } from '@grafana/e2e-selectors'; import { Trans, t } from '@grafana/i18n'; import { config } from '@grafana/runtime'; import { Button } from '@grafana/ui'; @@ -46,6 +47,7 @@ export function GetStartedWithDataSource({ plugin }: Props): React.ReactElement ) : undefined } + data-testid={e2eSelectors.pages.ConnectionsDataSource.button} > Add new data source