@grafana/plugin-e2e 1.7.2 → 1.8.0-canary.1111.faecd66.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/models/pages/AlertRuleEditPage.js +1 -1
- package/dist/models/pages/AnnotationEditPage.js +1 -1
- package/dist/models/pages/AnnotationPage.js +1 -1
- package/dist/models/pages/AppPage.js +1 -1
- package/dist/models/pages/DashboardPage.js +1 -1
- package/dist/models/pages/ExplorePage.d.ts +3 -2
- package/dist/models/pages/ExplorePage.js +4 -2
- package/dist/models/pages/GrafanaPage.d.ts +3 -2
- package/dist/models/pages/GrafanaPage.js +7 -3
- package/dist/models/pages/PanelEditPage.js +1 -1
- package/dist/models/pages/PluginConfigPage.js +1 -1
- package/dist/models/pages/VariableEditPage.js +1 -1
- package/dist/models/pages/VariablePage.js +1 -1
- package/dist/types.d.ts +5 -4
- package/package.json +2 -2
|
@@ -36,7 +36,7 @@ class DashboardPage extends GrafanaPage_1.GrafanaPage {
|
|
|
36
36
|
dataSourcePicker;
|
|
37
37
|
timeRange;
|
|
38
38
|
constructor(ctx, dashboard) {
|
|
39
|
-
super(ctx);
|
|
39
|
+
super(ctx, dashboard);
|
|
40
40
|
this.ctx = ctx;
|
|
41
41
|
this.dashboard = dashboard;
|
|
42
42
|
this.dataSourcePicker = new DataSourcePicker_1.DataSourcePicker(ctx);
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { Locator } from '@playwright/test';
|
|
2
|
-
import { NavigateOptions, PluginTestCtx, RequestOptions } from '../../types';
|
|
2
|
+
import { GrafanaPageArgs, NavigateOptions, PluginTestCtx, RequestOptions } from '../../types';
|
|
3
3
|
import { DataSourcePicker } from '../components/DataSourcePicker';
|
|
4
4
|
import { GrafanaPage } from './GrafanaPage';
|
|
5
5
|
import { Panel } from '../components/Panel';
|
|
6
6
|
export declare class ExplorePage extends GrafanaPage {
|
|
7
|
+
readonly args?: GrafanaPageArgs | undefined;
|
|
7
8
|
datasource: DataSourcePicker;
|
|
8
9
|
timeRange: any;
|
|
9
10
|
timeSeriesPanel: Panel;
|
|
10
11
|
tablePanel: Panel;
|
|
11
|
-
constructor(ctx: PluginTestCtx);
|
|
12
|
+
constructor(ctx: PluginTestCtx, args?: GrafanaPageArgs | undefined);
|
|
12
13
|
private getPanelLocators;
|
|
13
14
|
/**
|
|
14
15
|
* Navigates to the explore page.
|
|
@@ -34,12 +34,14 @@ const TABLE_PANEL_SELECTOR_SUFFIX = 'Table';
|
|
|
34
34
|
const TIME_SERIES_PANEL_TEXT = 'Graph Lines Bars Points';
|
|
35
35
|
const TABLE_PANEL_TEXT = 'Table';
|
|
36
36
|
class ExplorePage extends GrafanaPage_1.GrafanaPage {
|
|
37
|
+
args;
|
|
37
38
|
datasource;
|
|
38
39
|
timeRange;
|
|
39
40
|
timeSeriesPanel;
|
|
40
41
|
tablePanel;
|
|
41
|
-
constructor(ctx) {
|
|
42
|
-
super(ctx);
|
|
42
|
+
constructor(ctx, args) {
|
|
43
|
+
super(ctx, args);
|
|
44
|
+
this.args = args;
|
|
43
45
|
this.datasource = new DataSourcePicker_1.DataSourcePicker(ctx);
|
|
44
46
|
this.timeRange = new TimeRange_1.TimeRange(ctx);
|
|
45
47
|
this.timeSeriesPanel = new Panel_1.Panel(this.ctx, this.getPanelLocators(TIME_SERIES_PANEL_SELECTOR_SUFFIX, TIME_SERIES_PANEL_TEXT));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Locator, Request, Response } from '@playwright/test';
|
|
2
|
-
import { getByGrafanaSelectorOptions, NavigateOptions, PluginTestCtx } from '../../types';
|
|
2
|
+
import { getByGrafanaSelectorOptions, GrafanaPageArgs, NavigateOptions, PluginTestCtx } from '../../types';
|
|
3
3
|
/**
|
|
4
4
|
* Base class for all Grafana pages.
|
|
5
5
|
*
|
|
@@ -7,7 +7,8 @@ import { getByGrafanaSelectorOptions, NavigateOptions, PluginTestCtx } from '../
|
|
|
7
7
|
*/
|
|
8
8
|
export declare abstract class GrafanaPage {
|
|
9
9
|
readonly ctx: PluginTestCtx;
|
|
10
|
-
|
|
10
|
+
readonly pageArgs: GrafanaPageArgs;
|
|
11
|
+
constructor(ctx: PluginTestCtx, pageArgs?: GrafanaPageArgs);
|
|
11
12
|
protected navigate(url: string, options?: NavigateOptions): Promise<void>;
|
|
12
13
|
/**
|
|
13
14
|
* Get a locator based on a Grafana E2E selector. A grafana E2E selector is defined in @grafana/e2e-selectors or in plugin-e2e/src/e2e-selectors.
|
|
@@ -8,15 +8,19 @@ exports.GrafanaPage = void 0;
|
|
|
8
8
|
*/
|
|
9
9
|
class GrafanaPage {
|
|
10
10
|
ctx;
|
|
11
|
-
|
|
11
|
+
pageArgs;
|
|
12
|
+
constructor(ctx, pageArgs = {}) {
|
|
12
13
|
this.ctx = ctx;
|
|
14
|
+
this.pageArgs = pageArgs;
|
|
13
15
|
}
|
|
14
16
|
async navigate(url, options) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
let queryParams = options?.queryParams ? options.queryParams : this.pageArgs.queryParams;
|
|
18
|
+
if (queryParams) {
|
|
19
|
+
url += `?${queryParams.toString()}`;
|
|
17
20
|
}
|
|
18
21
|
await this.ctx.page.goto(url, {
|
|
19
22
|
waitUntil: 'networkidle',
|
|
23
|
+
...this.pageArgs,
|
|
20
24
|
...options,
|
|
21
25
|
});
|
|
22
26
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -386,7 +386,8 @@ export interface TimeRangeArgs {
|
|
|
386
386
|
*/
|
|
387
387
|
zone?: string;
|
|
388
388
|
}
|
|
389
|
-
export type
|
|
389
|
+
export type GrafanaPageArgs = NavigateOptions;
|
|
390
|
+
export type DashboardPageArgs = GrafanaPageArgs & {
|
|
390
391
|
/**
|
|
391
392
|
* The uid of the dashboard to go to
|
|
392
393
|
*/
|
|
@@ -407,11 +408,11 @@ export type DashboardPageArgs = {
|
|
|
407
408
|
* If dashboard is not specified, it's assumed that it's a new dashboard. Otherwise, the dashboard uid is used to
|
|
408
409
|
* navigate to an already existing dashboard.
|
|
409
410
|
*/
|
|
410
|
-
export type DashboardEditViewArgs<T> = {
|
|
411
|
+
export type DashboardEditViewArgs<T> = GrafanaPageArgs & {
|
|
411
412
|
dashboard?: DashboardPageArgs;
|
|
412
413
|
id: T;
|
|
413
414
|
};
|
|
414
|
-
export type AlertRuleArgs = {
|
|
415
|
+
export type AlertRuleArgs = GrafanaPageArgs & {
|
|
415
416
|
uid: string;
|
|
416
417
|
};
|
|
417
418
|
export type ReadProvisionedDashboardArgs = {
|
|
@@ -444,7 +445,7 @@ export type ReadProvisionedDataSourceArgs = {
|
|
|
444
445
|
*/
|
|
445
446
|
name?: string;
|
|
446
447
|
};
|
|
447
|
-
export type PluginPageArgs = {
|
|
448
|
+
export type PluginPageArgs = GrafanaPageArgs & {
|
|
448
449
|
pluginId: string;
|
|
449
450
|
};
|
|
450
451
|
export type GotoAppConfigPageArgs = PluginPageArgs;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/plugin-e2e",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0-canary.1111.faecd66.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"start": "cls || clear"
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "faecd66fa1f3e3209108c979984f3595c4cfe577"
|
|
59
59
|
}
|