-
Notifications
You must be signed in to change notification settings - Fork 54
feat(create-plugin): make Playwright config extendable #2807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
joshhunt
merged 5 commits into
grafana:main
from
alectimison-maker:feat/extend-playwright-config
Aug 11, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
5607c93
feat(create-plugin): make Playwright config extendable
alectimison-maker 878008f
fix(create-plugin): address Playwright config review
alectimison-maker 8a2a729
Merge remote-tracking branch 'upstream/main' into feat/extend-playwri…
alectimison-maker 37add1c
Merge branch 'main' into feat/extend-playwright-config
alectimison-maker c7846f4
Remove spreading projects from the default config
joshhunt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
packages/create-plugin/templates/common/.config/playwright.config.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| /** | ||
| * ⚠️⚠️⚠️ THIS FILE WAS SCAFFOLDED BY `@grafana/create-plugin`. DO NOT EDIT THIS FILE DIRECTLY. ⚠️⚠️⚠️ | ||
| * | ||
| * To extend the configuration, follow the steps in | ||
| * https://grafana.com/developers/plugin-tools/how-to-guides/extend-configurations#extend-the-playwright-config | ||
| */ | ||
|
|
||
| import type { PluginOptions } from '@grafana/plugin-e2e'; | ||
| import { defineConfig, devices } from '@playwright/test'; | ||
| import { dirname } from 'node:path'; | ||
|
|
||
| const pluginE2eAuth = `${dirname(require.resolve('@grafana/plugin-e2e'))}/auth`; | ||
|
|
||
| /** | ||
| * See https://playwright.dev/docs/test-configuration. | ||
| */ | ||
| export default defineConfig<PluginOptions>({ | ||
| testDir: './tests', | ||
| /* Run tests in files in parallel */ | ||
| fullyParallel: true, | ||
| /* Fail the build on CI if you accidentally left test.only in the source code. */ | ||
| forbidOnly: !!process.env.CI, | ||
| /* Retry on CI only */ | ||
| retries: process.env.CI ? 2 : 0, | ||
| /* Reporter to use. See https://playwright.dev/docs/test-reporters */ | ||
| reporter: 'html', | ||
| /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ | ||
| use: { | ||
| /* Base URL to use in actions like `await page.goto('/')`. */ | ||
| baseURL: process.env.GRAFANA_URL || 'http://localhost:3000', | ||
|
|
||
| /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ | ||
| trace: 'on-first-retry', | ||
| }, | ||
|
|
||
| /* Configure projects for major browsers */ | ||
| projects: [ | ||
| // 1. Login to Grafana and store the cookie on disk for use in other tests. | ||
| { | ||
| name: 'auth', | ||
| testDir: pluginE2eAuth, | ||
| testMatch: [/.*\.js/], | ||
| }, | ||
| // 2. Run tests in Google Chrome. Every test will start authenticated as admin user. | ||
| { | ||
| name: 'chromium', | ||
| use: { | ||
| ...devices['Desktop Chrome'], | ||
| storageState: 'playwright/.auth/admin.json', | ||
| }, | ||
| dependencies: ['auth'], | ||
| }, | ||
| ], | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied in 724d614. The generated user-owned config now links directly to the Playwright extension guide. I also merged the latest upstream/main and revalidated create-plugin lint, typecheck, and build; all passed. The full test command remains blocked locally by pre-existing Windows path failures (for example C:\C:... and slash-separator assertions), so I am leaving full-suite coverage to CI.