Files
grafana/playwright.config.ts
Ihor Yeromin 66b01e49a1 Canvas: Pan and zoom improvement (#86879)
* fix(canvas): style linter issue

* feat(canvas): update infinite viewer root element

* fix(canvas): resize element on moving

* fix(canvas): global element position

* fix(canvas): connection anchor position

* fix(canvas): connection position

* fix(canvas): connection coordinates calculation

* cleaning

* fix(canvas): calculation connection coordinates

* fix(canvas): initial connections svg position

* fix(canvas): align connection with new coordinates system

* fix(canvas): temporary element position fix

* comment

* Canvas: Fix canvas selecto (#104621)

* fix(canvas): get context back

* fix(canvas): selecto containers

* clean up

* Canvas: Fix jumpy elements behaviour on select and drag (#104641)

fix(canvas): jumpy elements behaviour on select and drag

* fix(canvas): connection regression (#104682)

* Canvas pan + zoom:  Updated mouse interactions (#104648)

* feat: canvas panel pan + zoom key binds

* feat: panning when right click + ctrl

* chore: some cleanup

* chore: adjust mouse move delta by canvas scale

* Canvas: Zoom to content (#104950)

feat(canvas): zoom to content

* Canvas pan + zoom: Unique key for canvas panel elements (#104947)

fix: unique keys

* Canvas: Placement adjustment (#105117)

* feat(canvas): top/left placement migration

* feat(canvas): adjust constraint system for pan and zoom usage

* feat(canvas): support other constraints

* Canvas: Align connection anchors and element rotation (#106002)

* feat(canvas): align connection anchors and element rotation

* clean up

* clean-up math

* Canvas: Disable pan when pan+zoom toggle is false (#106224)

chore: no pan when pan+zoom toggle is disabled

* Canvas: Fix desync between scene and InfiniteViewer zoom/position on element addition (#106655)

feat(canvas): keep pan and zoom state to re-apply

* Canvas: Clicking on metricValue dropdown does not work; right-click triggers context menu instead (#106701)

fix(canvas): metricValue left click dropdown

* Canvas: Double-click on canvas should reset scale and position (#106709)

fix(canvas): dblclick to reset zoom

* Canvas: Put new canvas pan and zoom under feature toggle (#107001)

* feat(canvas): put pan and zoom under FF

* clean-up

* clean-up

* fix(canvas): clear selection on scene manipulation

* fix(canvas): any types

* Canvas: Fix canvas apply styles (#107404)

* fix(canvas): apply styles

* remove deps

* Canvas: E2E test coverage (#107474)

* betterer

* feat(canvas): sceneAbleManagement tests

* feat(canvas): playwright tests

* chore(canvas): add draft e2e tests

* chore(canvas): clean draft e2e tests

* chore(canvas): fix draft e2e tests

* chore(canvas): todo comments

* chore(canvas): update e2e tests

* chore(canvas): delete scene unit tests

* chore(canvas): delete sceneAbleManagement unit tests

* chore(canvas): delete sceneAbleManagement unit tests

* chore(canvas): linter

* chore(canvas): locales

* chore(canvas): remove flag checking

* Fix canvas connection point z-indexing bug (#107223)

fix(canvas): hoist connect points one level higher in DOM to fix z-index

* Revert "Fix canvas connection point z-indexing bug" (#108146)

Revert "Fix canvas connection point z-indexing bug (#107223)"

This reverts commit e419cb164a6a9a7468a0b35d620dcf55719c37cd.

* Canvas: Set canvas zoom range (#108318)

* chore(canvas): set zoom range

* chore(canvas): naming

* Canvas: Fix infinite-viewer connections viewport values (#108315)

chore(canvas): infinite-viewer connections viewport values

* Canvas: Fix z-indices order and explicit pointer events (#108284)

* fix(canvas-connection-points): z-indices order, explicit pointer events

* chore(canvas): remove user select

* chore(canvas): naming

* chore(canvas): create ConnectionAnchor2 component

---------

Co-authored-by: Ihor Yeromin <yeryomin.igor@gmail.com>

* Canvas: Hide anchors on panel resize (#108588)

chore(canvas): hide anchors on panel resize

* Canvas: Center & scale select, resize, zoom bugs (#108749)

* Canvas: Fix center and scale constraint with zoom

* Remove unused resize flag

* Consolidate and clean up

* fix(canvas): re-size scale and center elements

---------

Co-authored-by: Ihor Yeromin <yeryomin.igor@gmail.com>

* Canvas: Fix on constraint change during zoom (#108947)

* Canvas: Ensure correct panel size during edit (#108953)

* chore(canvas): re-gen cue

---------

Co-authored-by: drew08t <drew08@gmail.com>
Co-authored-by: Sven Grossmann <svennergr@gmail.com>
Co-authored-by: Alex Spencer <52186778+alexjonspencer1@users.noreply.github.com>
Co-authored-by: Jesse David Peterson <jesdavpet@users.noreply.github.com>
Co-authored-by: Drew Slobodnjak <60050885+drew08t@users.noreply.github.com>
2025-07-31 19:34:48 +02:00

288 lines
8.0 KiB
TypeScript

import { defineConfig, devices } from '@playwright/test';
import path, { dirname } from 'path';
import { PluginOptions } from '@grafana/plugin-e2e';
const testDirRoot = 'e2e-playwright';
const pluginDirRoot = path.join(testDirRoot, 'plugin-e2e');
const DEFAULT_URL = 'http://localhost:3001';
export default defineConfig<PluginOptions>({
fullyParallel: true,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
reporter: [
['html'], // pretty
],
expect: {
timeout: 10_000,
},
use: {
baseURL: process.env.GRAFANA_URL ?? DEFAULT_URL,
trace: 'retain-on-failure',
httpCredentials: {
username: 'admin',
password: 'admin',
},
screenshot: 'only-on-failure',
permissions: ['clipboard-read', 'clipboard-write'],
provisioningRootDir: path.join(process.cwd(), process.env.PROV_DIR ?? 'conf/provisioning'),
},
...(!process.env.GRAFANA_URL && {
webServer: {
command: 'yarn e2e:plugin:build && ./e2e-playwright/start-server',
url: DEFAULT_URL,
stdout: 'pipe',
stderr: 'pipe',
},
}),
projects: [
// Login to Grafana with admin user and store the cookie on disk for use in other tests
{
name: 'authenticate',
testDir: `${dirname(require.resolve('@grafana/plugin-e2e'))}/auth`,
testMatch: [/.*\.js/],
},
// Login to Grafana with new user with viewer role and store the cookie on disk for use in other tests
{
name: 'createUserAndAuthenticate',
testDir: `${dirname(require.resolve('@grafana/plugin-e2e'))}/auth`,
testMatch: [/.*\.js/],
use: {
user: {
user: 'viewer',
password: 'password',
role: 'Viewer',
},
},
},
// Run all tests in parallel using user with admin role
{
name: 'admin',
testDir: path.join(pluginDirRoot, '/plugin-e2e-api-tests/as-admin-user'),
use: {
...devices['Desktop Chrome'],
storageState: 'playwright/.auth/admin.json',
},
dependencies: ['authenticate'],
},
// Run all tests in parallel using user with viewer role
{
name: 'viewer',
testDir: path.join(pluginDirRoot, '/plugin-e2e-api-tests/as-viewer-user'),
use: {
...devices['Desktop Chrome'],
storageState: 'playwright/.auth/viewer.json',
},
dependencies: ['createUserAndAuthenticate'],
},
{
name: 'elasticsearch',
testDir: path.join(pluginDirRoot, '/elasticsearch'),
use: {
...devices['Desktop Chrome'],
storageState: 'playwright/.auth/admin.json',
},
dependencies: ['authenticate'],
},
{
name: 'mysql',
testDir: path.join(pluginDirRoot, '/mysql'),
use: {
...devices['Desktop Chrome'],
storageState: 'playwright/.auth/admin.json',
},
dependencies: ['authenticate'],
},
{
name: 'mssql',
testDir: path.join(pluginDirRoot, '/mssql'),
use: {
...devices['Desktop Chrome'],
storageState: 'playwright/.auth/admin.json',
},
dependencies: ['authenticate'],
},
{
name: 'extensions-test-app',
testDir: path.join(testDirRoot, '/test-plugins/grafana-extensionstest-app'),
use: {
...devices['Desktop Chrome'],
storageState: 'playwright/.auth/admin.json',
},
dependencies: ['authenticate'],
},
{
name: 'grafana-e2etest-datasource',
testDir: path.join(testDirRoot, '/test-plugins/grafana-test-datasource'),
use: {
...devices['Desktop Chrome'],
storageState: 'playwright/.auth/admin.json',
},
dependencies: ['authenticate'],
},
{
name: 'cloudwatch',
testDir: path.join(pluginDirRoot, '/cloudwatch'),
use: {
...devices['Desktop Chrome'],
storageState: 'playwright/.auth/admin.json',
},
dependencies: ['authenticate'],
},
{
name: 'azuremonitor',
testDir: path.join(pluginDirRoot, '/azuremonitor'),
use: {
...devices['Desktop Chrome'],
storageState: 'playwright/.auth/admin.json',
},
dependencies: ['authenticate'],
},
{
name: 'cloudmonitoring',
testDir: path.join(pluginDirRoot, '/cloudmonitoring'),
use: {
...devices['Desktop Chrome'],
storageState: 'playwright/.auth/admin.json',
},
dependencies: ['authenticate'],
},
{
name: 'graphite',
testDir: path.join(pluginDirRoot, '/graphite'),
use: {
...devices['Desktop Chrome'],
storageState: 'playwright/.auth/admin.json',
},
dependencies: ['authenticate'],
},
{
name: 'influxdb',
testDir: path.join(pluginDirRoot, '/influxdb'),
use: {
...devices['Desktop Chrome'],
storageState: 'playwright/.auth/admin.json',
},
dependencies: ['authenticate'],
},
{
name: 'opentsdb',
testDir: path.join(pluginDirRoot, '/opentsdb'),
use: {
...devices['Desktop Chrome'],
storageState: 'playwright/.auth/admin.json',
},
dependencies: ['authenticate'],
},
{
name: 'jaeger',
testDir: path.join(pluginDirRoot, '/jaeger'),
use: {
...devices['Desktop Chrome'],
storageState: 'playwright/.auth/admin.json',
},
dependencies: ['authenticate'],
},
{
name: 'grafana-postgresql-datasource',
testDir: path.join(pluginDirRoot, '/grafana-postgresql-datasource'),
use: {
...devices['Desktop Chrome'],
storageState: 'playwright/.auth/admin.json',
},
dependencies: ['authenticate'],
},
{
name: 'canvas',
testDir: path.join(testDirRoot, '/canvas'),
use: {
...devices['Desktop Chrome'],
storageState: 'playwright/.auth/admin.json',
},
dependencies: ['authenticate'],
},
{
name: 'zipkin',
testDir: path.join(pluginDirRoot, '/zipkin'),
use: {
...devices['Desktop Chrome'],
storageState: 'playwright/.auth/admin.json',
},
dependencies: ['authenticate'],
},
{
name: 'unauthenticated',
testDir: path.join(testDirRoot, '/unauthenticated'),
use: {
...devices['Desktop Chrome'],
},
},
{
name: 'various',
testDir: path.join(testDirRoot, '/various-suite'),
use: {
...devices['Desktop Chrome'],
storageState: 'playwright/.auth/admin.json',
},
dependencies: ['authenticate'],
},
{
name: 'panels',
testDir: path.join(testDirRoot, '/panels-suite'),
use: {
...devices['Desktop Chrome'],
storageState: 'playwright/.auth/admin.json',
},
dependencies: ['authenticate'],
},
{
name: 'smoke',
testDir: path.join(testDirRoot, '/smoke-tests-suite'),
use: {
...devices['Desktop Chrome'],
storageState: 'playwright/.auth/admin.json',
},
dependencies: ['authenticate'],
},
{
name: 'dashboards',
testDir: path.join(testDirRoot, '/dashboards-suite'),
use: {
...devices['Desktop Chrome'],
storageState: 'playwright/.auth/admin.json',
},
dependencies: ['authenticate'],
},
{
name: 'loki',
testDir: path.join(testDirRoot, '/loki'),
use: {
...devices['Desktop Chrome'],
storageState: 'playwright/.auth/admin.json',
},
dependencies: ['authenticate'],
},
{
name: 'cloud-plugins',
testDir: path.join(testDirRoot, '/cloud-plugins-suite'),
use: {
...devices['Desktop Chrome'],
storageState: 'playwright/.auth/admin.json',
},
dependencies: ['authenticate'],
},
{
name: 'dashboard-new-layouts',
testDir: path.join(testDirRoot, '/dashboard-new-layouts'),
use: {
...devices['Desktop Chrome'],
storageState: 'playwright/.auth/admin.json',
},
dependencies: ['authenticate'],
},
],
});