@grafana/plugin-e2e 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/api.d.ts
CHANGED
|
@@ -3,7 +3,19 @@ import { CreateDataSourceArgs, CreateDataSourcePageArgs, DataSource, ReadProvisi
|
|
|
3
3
|
import { PanelEditPage, GrafanaPage, DataSourceConfigPage, DashboardPage, VariableEditPage, AnnotationEditPage } from './models';
|
|
4
4
|
import { ExplorePage } from './models/ExplorePage';
|
|
5
5
|
export type PluginOptions = {
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* When using the readProvisioning fixture, files will be read from this directory. If no directory is provided,
|
|
8
|
+
* the 'provisioning' directory in the current working directory will be used.
|
|
9
|
+
*
|
|
10
|
+
* eg.
|
|
11
|
+
* export default defineConfig({
|
|
12
|
+
use: {
|
|
13
|
+
provisioningRootDir: 'path/to/provisioning',
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
provisioningRootDir: string;
|
|
7
19
|
};
|
|
8
20
|
export type PluginFixture = {
|
|
9
21
|
/**
|
|
@@ -115,7 +127,7 @@ export type PluginFixture = {
|
|
|
115
127
|
*/
|
|
116
128
|
isFeatureToggleEnabled<T = object>(featureToggle: keyof T): Promise<boolean>;
|
|
117
129
|
};
|
|
118
|
-
export declare const test: import("@playwright/test").TestType<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & PluginFixture
|
|
130
|
+
export declare const test: import("@playwright/test").TestType<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & PluginFixture, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & PluginOptions>;
|
|
119
131
|
export declare const expect: import("@playwright/test").Expect<{
|
|
120
132
|
toBeOK: (request: Promise<import("@playwright/test").Response>) => Promise<{
|
|
121
133
|
message: () => string;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
const fs_1 = require("fs");
|
|
4
|
-
const path_1 = require("path");
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
5
8
|
const yaml_1 = require("yaml");
|
|
6
|
-
const readProvision = async ({}, use) => {
|
|
9
|
+
const readProvision = async ({ provisioningRootDir }, use) => {
|
|
7
10
|
await use(async ({ filePath }) => {
|
|
8
|
-
const resolvedPath =
|
|
11
|
+
const resolvedPath = path_1.default.resolve(path_1.default.join(provisioningRootDir, filePath));
|
|
9
12
|
const contents = await fs_1.promises.readFile(resolvedPath, 'utf8');
|
|
10
13
|
return (0, yaml_1.parse)(contents);
|
|
11
14
|
});
|
package/dist/fixtures/index.d.ts
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
createDataSourceConfigPage: (args: import("..").PluginFixture & import("..").PluginOptions & import("playwright/test").PlaywrightTestArgs & import("playwright/test").PlaywrightTestOptions & import("playwright/test").PlaywrightWorkerArgs & import("playwright/test").PlaywrightWorkerOptions, use: (r: (args: import("../types").CreateDataSourcePageArgs) => Promise<import("..").DataSourceConfigPage>) => Promise<void>, testInfo: import("playwright/test").TestInfo) => any;
|
|
6
|
-
newDashboardPage: (args: import("..").PluginFixture & import("..").PluginOptions & import("playwright/test").PlaywrightTestArgs & import("playwright/test").PlaywrightTestOptions & import("playwright/test").PlaywrightWorkerArgs & import("playwright/test").PlaywrightWorkerOptions, use: (r: import("..").DashboardPage) => Promise<void>, testInfo: import("playwright/test").TestInfo) => any;
|
|
7
|
-
panelEditPage: (args: import("..").PluginFixture & import("..").PluginOptions & import("playwright/test").PlaywrightTestArgs & import("playwright/test").PlaywrightTestOptions & import("playwright/test").PlaywrightWorkerArgs & import("playwright/test").PlaywrightWorkerOptions, use: (r: import("..").PanelEditPage) => Promise<void>, testInfo: import("playwright/test").TestInfo) => any;
|
|
8
|
-
variableEditPage: (args: import("..").PluginFixture & import("..").PluginOptions & import("playwright/test").PlaywrightTestArgs & import("playwright/test").PlaywrightTestOptions & import("playwright/test").PlaywrightWorkerArgs & import("playwright/test").PlaywrightWorkerOptions, use: (r: import("..").VariableEditPage) => Promise<void>, testInfo: import("playwright/test").TestInfo) => any;
|
|
9
|
-
annotationEditPage: (args: import("..").PluginFixture & import("..").PluginOptions & import("playwright/test").PlaywrightTestArgs & import("playwright/test").PlaywrightTestOptions & import("playwright/test").PlaywrightWorkerArgs & import("playwright/test").PlaywrightWorkerOptions, use: (r: import("..").AnnotationEditPage) => Promise<void>, testInfo: import("playwright/test").TestInfo) => any;
|
|
10
|
-
explorePage: (args: import("..").PluginFixture & import("..").PluginOptions & import("playwright/test").PlaywrightTestArgs & import("playwright/test").PlaywrightTestOptions & import("playwright/test").PlaywrightWorkerArgs & import("playwright/test").PlaywrightWorkerOptions, use: (r: import("../models/ExplorePage").ExplorePage) => Promise<void>, testInfo: import("playwright/test").TestInfo) => any;
|
|
11
|
-
createDataSource: (args: import("..").PluginFixture & import("..").PluginOptions & import("playwright/test").PlaywrightTestArgs & import("playwright/test").PlaywrightTestOptions & import("playwright/test").PlaywrightWorkerArgs & import("playwright/test").PlaywrightWorkerOptions, use: (r: (args: import("../types").CreateDataSourceArgs) => Promise<import("../types").DataSource<any>>) => Promise<void>, testInfo: import("playwright/test").TestInfo) => any;
|
|
12
|
-
readProvision: (args: import("..").PluginFixture & import("..").PluginOptions & import("playwright/test").PlaywrightTestArgs & import("playwright/test").PlaywrightTestOptions & import("playwright/test").PlaywrightWorkerArgs & import("playwright/test").PlaywrightWorkerOptions, use: (r: <T = any>(args: import("../types").ReadProvisionArgs) => Promise<T>) => Promise<void>, testInfo: import("playwright/test").TestInfo) => any;
|
|
13
|
-
isFeatureToggleEnabled: (args: import("..").PluginFixture & import("..").PluginOptions & import("playwright/test").PlaywrightTestArgs & import("playwright/test").PlaywrightTestOptions & import("playwright/test").PlaywrightWorkerArgs & import("playwright/test").PlaywrightWorkerOptions, use: (r: <T_1 = object>(featureToggle: keyof T_1) => Promise<boolean>) => Promise<void>, testInfo: import("playwright/test").TestInfo) => any;
|
|
14
|
-
};
|
|
15
|
-
export default _default;
|
|
1
|
+
import { Fixtures } from '@playwright/test';
|
|
2
|
+
import { PluginFixture, PluginOptions } from '../api';
|
|
3
|
+
declare const fixtures: Fixtures<PluginFixture, PluginOptions>;
|
|
4
|
+
export default fixtures;
|
package/dist/fixtures/index.js
CHANGED
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const path_1 = __importDefault(require("path"));
|
|
6
7
|
const annotationEditPage_1 = __importDefault(require("./annotationEditPage"));
|
|
7
8
|
const grafanaVersion_1 = __importDefault(require("./grafanaVersion"));
|
|
8
9
|
const selectors_1 = __importDefault(require("./selectors"));
|
|
@@ -15,7 +16,8 @@ const newDashboardPage_1 = __importDefault(require("./newDashboardPage"));
|
|
|
15
16
|
const variableEditPage_1 = __importDefault(require("./variableEditPage"));
|
|
16
17
|
const explorePage_1 = __importDefault(require("./explorePage"));
|
|
17
18
|
const isFeatureToggleEnabled_1 = __importDefault(require("./isFeatureToggleEnabled"));
|
|
18
|
-
|
|
19
|
+
const fixtures = {
|
|
20
|
+
provisioningRootDir: [path_1.default.join(process.cwd(), 'provisioning'), { option: true, scope: 'worker' }],
|
|
19
21
|
selectors: selectors_1.default,
|
|
20
22
|
grafanaVersion: grafanaVersion_1.default,
|
|
21
23
|
login: login_1.default,
|
|
@@ -29,3 +31,4 @@ exports.default = {
|
|
|
29
31
|
readProvision: readProvision_1.default,
|
|
30
32
|
isFeatureToggleEnabled: isFeatureToggleEnabled_1.default,
|
|
31
33
|
};
|
|
34
|
+
exports.default = fixtures;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/plugin-e2e",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"semver": "^7.5.4",
|
|
45
45
|
"uuid": "^9.0.1"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "dbe303c94f5720894be795671c10a0bf36c752a1"
|
|
48
48
|
}
|