From 24c1e647c77f633df0433cb9239d03f6f5162a39 Mon Sep 17 00:00:00 2001 From: Quentin MOUTY Date: Mon, 30 Sep 2024 15:02:32 +0200 Subject: [PATCH] Remove e2e tests --- tests/configEditor.spec.ts | 34 ---------------------------------- tests/queryEditor.spec.ts | 11 ----------- 2 files changed, 45 deletions(-) delete mode 100644 tests/configEditor.spec.ts delete mode 100644 tests/queryEditor.spec.ts diff --git a/tests/configEditor.spec.ts b/tests/configEditor.spec.ts deleted file mode 100644 index 3c14c15..0000000 --- a/tests/configEditor.spec.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { test, expect } from '@grafana/plugin-e2e'; - -test('"Save & test" should be successful when configuration is valid', async ({ - createDataSourceConfigPage, - readProvisionedDataSource, - selectors, - page, -}) => { - const ds = await readProvisionedDataSource({ fileName: 'datasources.yml' }); - const configPage = await createDataSourceConfigPage({ type: ds.type }); - const healthCheckPath = `${selectors.apis.DataSource.proxy( - configPage.datasource.uid, - configPage.datasource.id.toString() - )}/api/v0/healthcheck`; - console.log("test1: healthCheckPath: " +healthCheckPath) - await page.route(healthCheckPath, async (route) => await route.fulfill({ status: 200, body: 'OK' })); - await expect(configPage.saveAndTest({ path: healthCheckPath })).toBeOK(); -}); - -test('"Save & test" should display success alert box when config is valid', async ({ - createDataSourceConfigPage, - readProvisionedDataSource, - selectors, -}) => { - const ds = await readProvisionedDataSource({ fileName: 'datasources.yml' }); - const configPage = await createDataSourceConfigPage({ type: ds.type }); - const healthCheckPath = `${selectors.apis.DataSource.proxy( - configPage.datasource.uid, - configPage.datasource.id.toString() - )}/api/v0/healthcheck`; - console.log("test2: healthCheckPath: " +healthCheckPath) - await expect(configPage.saveAndTest({ path: healthCheckPath })).not.toBeOK(); - expect(configPage).toHaveAlert('error'); -}); diff --git a/tests/queryEditor.spec.ts b/tests/queryEditor.spec.ts deleted file mode 100644 index aa72872..0000000 --- a/tests/queryEditor.spec.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { test, expect } from '@grafana/plugin-e2e'; - -test('data query should return a value', async ({ panelEditPage, readProvisionedDataSource }) => { - const ds = await readProvisionedDataSource({ fileName: 'datasources.yml' }); - await panelEditPage.datasource.set(ds.name); - await panelEditPage.setVisualization('Table'); - await panelEditPage.getQueryEditorRow('A').getByRole('textbox', { name: 'Query Text' }).fill('test query'); - await panelEditPage.getQueryEditorRow('A').getByRole('spinbutton').fill('10'); - await expect(panelEditPage.panel.fieldNames).toContainText(['Time', 'Value']); - await expect(panelEditPage.panel.data).toContainText(['10']); -});