Playwright: Changes needed for enterprise tests (#110424)
* enterprise scaffolding * clean up gitignore, add enterprise to playwright config * add workflows * setup enterprise in the workflows * update permissions * try update license path * add TODO * undo workflow changes * remove commands * add extensions folder * update gitignore * include the whole public folder * add comment * review comments
This commit is contained in:
@@ -191,6 +191,8 @@ compilation-stats.json
|
||||
/e2e/build_results.zip
|
||||
/e2e/extensions
|
||||
!/e2e/extensions/.keep
|
||||
/e2e-playwright/extensions
|
||||
!/e2e-playwright/extensions/.keep
|
||||
/e2e/extensions-suite
|
||||
/test-results/
|
||||
/playwright-report/
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Ensure we're in the Grafana root directory
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")/.." || exit 1
|
||||
|
||||
. scripts/grafana-server/variables
|
||||
|
||||
LICENSE_PATH=""
|
||||
|
||||
@@ -144,8 +144,8 @@ func run(ctx context.Context, cmd *cli.Command) error {
|
||||
"public/app/core/icons/cached.json",
|
||||
|
||||
// packages we use in playwright tests
|
||||
"packages", // TODO: do we need all of this?
|
||||
"public/app/plugins", // TODO: do we need all of this?
|
||||
"packages",
|
||||
"public",
|
||||
|
||||
// e2e files
|
||||
"e2e-playwright",
|
||||
|
||||
@@ -3,11 +3,11 @@ import path, { dirname } from 'path';
|
||||
|
||||
import { PluginOptions } from '@grafana/plugin-e2e';
|
||||
|
||||
const testDirRoot = 'e2e-playwright';
|
||||
export const testDirRoot = 'e2e-playwright';
|
||||
const pluginDirRoot = path.join(testDirRoot, 'plugin-e2e');
|
||||
const DEFAULT_URL = 'http://localhost:3001';
|
||||
export const DEFAULT_URL = 'http://localhost:3001';
|
||||
|
||||
function withAuth(project: Project): Project {
|
||||
export function withAuth(project: Project): Project {
|
||||
project.dependencies ??= [];
|
||||
project.use ??= {};
|
||||
|
||||
@@ -20,7 +20,7 @@ function withAuth(project: Project): Project {
|
||||
return project;
|
||||
}
|
||||
|
||||
export default defineConfig<PluginOptions>({
|
||||
export const baseConfig: PlaywrightTestConfig<PluginOptions, {}> = {
|
||||
fullyParallel: true,
|
||||
/* Retry on CI only */
|
||||
retries: process.env.CI ? 2 : 0,
|
||||
@@ -44,6 +44,10 @@ export default defineConfig<PluginOptions>({
|
||||
permissions: ['clipboard-read', 'clipboard-write'],
|
||||
provisioningRootDir: path.join(process.cwd(), process.env.PROV_DIR ?? 'conf/provisioning'),
|
||||
},
|
||||
};
|
||||
|
||||
export default defineConfig<PluginOptions>({
|
||||
...baseConfig,
|
||||
...(!process.env.GRAFANA_URL && {
|
||||
webServer: {
|
||||
command: 'yarn e2e:plugin:build && ./e2e-playwright/start-server',
|
||||
|
||||
Reference in New Issue
Block a user