@grafana/plugin-e2e 0.24.0 → 0.25.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/auth/auth.setup.js +2 -2
- package/dist/fixtures/annotationEditPage.d.ts +5 -6
- package/dist/fixtures/annotationEditPage.js +4 -3
- package/dist/fixtures/commands/createDataSource.d.ts +4 -6
- package/dist/fixtures/commands/createDataSource.js +2 -2
- package/dist/fixtures/commands/createDataSourceConfigPage.d.ts +5 -7
- package/dist/fixtures/commands/createDataSourceConfigPage.js +4 -3
- package/dist/fixtures/commands/createUser.d.ts +4 -5
- package/dist/fixtures/commands/createUser.js +2 -1
- package/dist/fixtures/commands/gotoAnnotationEditPage.d.ts +5 -7
- package/dist/fixtures/commands/gotoAnnotationEditPage.js +4 -3
- package/dist/fixtures/commands/gotoAppConfigPage.d.ts +3 -5
- package/dist/fixtures/commands/gotoAppConfigPage.js +0 -1
- package/dist/fixtures/commands/gotoAppPage.d.ts +3 -4
- package/dist/fixtures/commands/gotoAppPage.js +0 -1
- package/dist/fixtures/commands/gotoDashboardPage.d.ts +5 -7
- package/dist/fixtures/commands/gotoDashboardPage.js +4 -3
- package/dist/fixtures/commands/gotoDataSourceConfigPage.d.ts +5 -6
- package/dist/fixtures/commands/gotoDataSourceConfigPage.js +4 -3
- package/dist/fixtures/commands/gotoPanelEditPage.d.ts +5 -7
- package/dist/fixtures/commands/gotoPanelEditPage.js +4 -3
- package/dist/fixtures/commands/gotoVariableEditPage.d.ts +5 -7
- package/dist/fixtures/commands/gotoVariableEditPage.js +4 -3
- package/dist/fixtures/commands/login.d.ts +4 -5
- package/dist/fixtures/commands/login.js +2 -2
- package/dist/fixtures/commands/readProvisionedDashboard.d.ts +4 -6
- package/dist/fixtures/commands/readProvisionedDashboard.js +2 -1
- package/dist/fixtures/commands/readProvisionedDataSource.d.ts +4 -6
- package/dist/fixtures/commands/readProvisionedDataSource.js +2 -1
- package/dist/fixtures/dashboardPage.d.ts +5 -6
- package/dist/fixtures/dashboardPage.js +4 -3
- package/dist/fixtures/explorePage.d.ts +4 -5
- package/dist/fixtures/explorePage.js +2 -1
- package/dist/fixtures/grafanaVersion.d.ts +2 -2
- package/dist/fixtures/grafanaVersion.js +2 -1
- package/dist/fixtures/isFeatureToggleEnabled.d.ts +4 -5
- package/dist/fixtures/isFeatureToggleEnabled.js +2 -1
- package/dist/fixtures/page.d.ts +4 -5
- package/dist/fixtures/page.js +2 -1
- package/dist/fixtures/panelEditPage.d.ts +5 -6
- package/dist/fixtures/panelEditPage.js +2 -1
- package/dist/fixtures/selectors.d.ts +4 -5
- package/dist/fixtures/selectors.js +2 -1
- package/dist/fixtures/variableEditPage.d.ts +5 -6
- package/dist/fixtures/variableEditPage.js +4 -3
- package/dist/index.d.ts +46 -6
- package/dist/index.js +105 -7
- package/dist/matchers/toBeOK.d.ts +1 -2
- package/dist/matchers/toBeOK.js +2 -1
- package/dist/matchers/toDisplayPreviews.d.ts +2 -3
- package/dist/matchers/toDisplayPreviews.js +2 -1
- package/dist/matchers/toHaveAlert.d.ts +2 -3
- package/dist/matchers/toHaveAlert.js +2 -1
- package/dist/models/pages/AppPage.d.ts +1 -1
- package/dist/models/pages/AppPage.js +2 -2
- package/dist/options.d.ts +3 -0
- package/dist/{options/index.js → options.js} +2 -2
- package/dist/types.d.ts +275 -39
- package/package.json +2 -2
- package/dist/api.d.ts +0 -254
- package/dist/api.js +0 -26
- package/dist/fixtures/index.d.ts +0 -25
- package/dist/fixtures/index.js +0 -52
- package/dist/fixtures/types.d.ts +0 -2
- package/dist/fixtures/types.js +0 -2
- package/dist/matchers/index.d.ts +0 -25
- package/dist/matchers/index.js +0 -13
- package/dist/models/index.d.ts +0 -15
- package/dist/models/index.js +0 -33
- package/dist/options/index.d.ts +0 -4
package/dist/auth/auth.setup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
(0,
|
|
3
|
+
const __1 = require("../");
|
|
4
|
+
(0, __1.test)('authenticate', async ({ login, createUser, user }) => {
|
|
5
5
|
if (user) {
|
|
6
6
|
await createUser();
|
|
7
7
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { TestFixture } from '@playwright/test';
|
|
2
|
-
import {
|
|
3
|
-
import { AnnotationEditPage } from '../models';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export default annotationEditPage;
|
|
2
|
+
import { PlaywrightArgs } from '../types';
|
|
3
|
+
import { AnnotationEditPage } from '../models/pages/AnnotationEditPage';
|
|
4
|
+
type AnnotationEditPageFixture = TestFixture<AnnotationEditPage, PlaywrightArgs>;
|
|
5
|
+
export declare const annotationEditPage: AnnotationEditPageFixture;
|
|
6
|
+
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
exports.annotationEditPage = void 0;
|
|
4
|
+
const AnnotationPage_1 = require("../models/pages/AnnotationPage");
|
|
4
5
|
const annotationEditPage = async ({ page, selectors, grafanaVersion, request }, use, testInfo) => {
|
|
5
|
-
const annotationPage = new
|
|
6
|
+
const annotationPage = new AnnotationPage_1.AnnotationPage({ page, selectors, grafanaVersion, request, testInfo });
|
|
6
7
|
await annotationPage.goto();
|
|
7
8
|
const annotationEditPage = await annotationPage.clickAddNew();
|
|
8
9
|
await use(annotationEditPage);
|
|
9
10
|
};
|
|
10
|
-
exports.
|
|
11
|
+
exports.annotationEditPage = annotationEditPage;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { APIRequestContext, TestFixture } from '@playwright/test';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { PlaywrightCombinedArgs } from '../types';
|
|
5
|
-
type CreateDataSourceViaAPIFixture = TestFixture<(args: CreateDataSourceArgs) => Promise<DataSourceSettings>, PluginFixture & PluginOptions & PlaywrightCombinedArgs>;
|
|
2
|
+
import { CreateDataSourceArgs, DataSourceSettings, PlaywrightArgs } from '../../types';
|
|
3
|
+
type CreateDataSourceViaAPIFixture = TestFixture<(args: CreateDataSourceArgs) => Promise<DataSourceSettings>, PlaywrightArgs>;
|
|
6
4
|
export declare const createDataSourceViaAPI: (request: APIRequestContext, datasource: CreateDataSourceArgs) => Promise<DataSourceSettings>;
|
|
7
|
-
declare const createDataSource: CreateDataSourceViaAPIFixture;
|
|
8
|
-
export
|
|
5
|
+
export declare const createDataSource: CreateDataSourceViaAPIFixture;
|
|
6
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createDataSourceViaAPI = void 0;
|
|
3
|
+
exports.createDataSource = exports.createDataSourceViaAPI = void 0;
|
|
4
4
|
const uuid_1 = require("uuid");
|
|
5
5
|
const test_1 = require("@playwright/test");
|
|
6
6
|
const createDataSourceViaAPI = async (request, datasource) => {
|
|
@@ -33,4 +33,4 @@ const createDataSource = async ({ request }, use) => {
|
|
|
33
33
|
return (0, exports.createDataSourceViaAPI)(request, args);
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
|
-
exports.
|
|
36
|
+
exports.createDataSource = createDataSource;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { TestFixture } from '@playwright/test';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
declare const createDataSourceConfigPage: CreateDataSourceConfigPageFixture;
|
|
8
|
-
export default createDataSourceConfigPage;
|
|
2
|
+
import { CreateDataSourcePageArgs, PlaywrightArgs } from '../../types';
|
|
3
|
+
import { DataSourceConfigPage } from '../../models/pages/DataSourceConfigPage';
|
|
4
|
+
type CreateDataSourceConfigPageFixture = TestFixture<(args: CreateDataSourcePageArgs) => Promise<DataSourceConfigPage>, PlaywrightArgs>;
|
|
5
|
+
export declare const createDataSourceConfigPage: CreateDataSourceConfigPageFixture;
|
|
6
|
+
export {};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
exports.createDataSourceConfigPage = void 0;
|
|
4
4
|
const createDataSource_1 = require("./createDataSource");
|
|
5
|
+
const DataSourceConfigPage_1 = require("../../models/pages/DataSourceConfigPage");
|
|
5
6
|
const createDataSourceConfigPage = async ({ request, page, selectors, grafanaVersion }, use, testInfo) => {
|
|
6
7
|
let datasourceConfigPage;
|
|
7
8
|
let deleteDataSource = true;
|
|
8
9
|
await use(async (args) => {
|
|
9
10
|
deleteDataSource = args.deleteDataSourceAfterTest ?? true;
|
|
10
11
|
const datasource = await (0, createDataSource_1.createDataSourceViaAPI)(request, args);
|
|
11
|
-
datasourceConfigPage = new
|
|
12
|
+
datasourceConfigPage = new DataSourceConfigPage_1.DataSourceConfigPage({ page, selectors, grafanaVersion, request, testInfo }, datasource);
|
|
12
13
|
await datasourceConfigPage.goto();
|
|
13
14
|
return datasourceConfigPage;
|
|
14
15
|
});
|
|
15
16
|
deleteDataSource && (await datasourceConfigPage?.deleteDataSource());
|
|
16
17
|
};
|
|
17
|
-
exports.
|
|
18
|
+
exports.createDataSourceConfigPage = createDataSourceConfigPage;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { TestFixture } from '@playwright/test';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export default createUser;
|
|
2
|
+
import { PlaywrightArgs } from '../../types';
|
|
3
|
+
type CreateUserFixture = TestFixture<() => Promise<void>, PlaywrightArgs>;
|
|
4
|
+
export declare const createUser: CreateUserFixture;
|
|
5
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createUser = void 0;
|
|
3
4
|
const test_1 = require("@playwright/test");
|
|
4
5
|
const headers = {
|
|
5
6
|
Authorization: `Basic ${Buffer.from(`admin:admin`).toString('base64')}`,
|
|
@@ -47,4 +48,4 @@ const createUser = async ({ request, user }, use) => {
|
|
|
47
48
|
}
|
|
48
49
|
});
|
|
49
50
|
};
|
|
50
|
-
exports.
|
|
51
|
+
exports.createUser = createUser;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { TestFixture } from '@playwright/test';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
declare const gotoAnnotationEditPage: GotoAnnotationEditPageFixture;
|
|
8
|
-
export default gotoAnnotationEditPage;
|
|
2
|
+
import { DashboardEditViewArgs, PlaywrightArgs } from '../../types';
|
|
3
|
+
import { AnnotationEditPage } from '../../models/pages/AnnotationEditPage';
|
|
4
|
+
type GotoAnnotationEditPageFixture = TestFixture<(args: DashboardEditViewArgs<string>) => Promise<AnnotationEditPage>, PlaywrightArgs>;
|
|
5
|
+
export declare const gotoAnnotationEditPage: GotoAnnotationEditPageFixture;
|
|
6
|
+
export {};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
exports.gotoAnnotationEditPage = void 0;
|
|
4
|
+
const AnnotationEditPage_1 = require("../../models/pages/AnnotationEditPage");
|
|
4
5
|
const gotoAnnotationEditPage = async ({ request, page, selectors, grafanaVersion }, use, testInfo) => {
|
|
5
6
|
await use(async (args) => {
|
|
6
|
-
const annotationEditPage = new
|
|
7
|
+
const annotationEditPage = new AnnotationEditPage_1.AnnotationEditPage({ page, selectors, grafanaVersion, request, testInfo }, args);
|
|
7
8
|
await annotationEditPage.goto();
|
|
8
9
|
return annotationEditPage;
|
|
9
10
|
});
|
|
10
11
|
};
|
|
11
|
-
exports.
|
|
12
|
+
exports.gotoAnnotationEditPage = gotoAnnotationEditPage;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { TestFixture } from '@playwright/test';
|
|
2
|
-
import {
|
|
3
|
-
import { GotoAppConfigPageArgs } from '../../types';
|
|
4
|
-
import { PlaywrightCombinedArgs } from '../types';
|
|
2
|
+
import { GotoAppConfigPageArgs, PlaywrightArgs } from '../../types';
|
|
5
3
|
import { AppConfigPage } from '../../models/pages/AppConfigPage';
|
|
6
|
-
type GotoAppConfigPageFixture = TestFixture<(args: GotoAppConfigPageArgs) => Promise<AppConfigPage>,
|
|
4
|
+
type GotoAppConfigPageFixture = TestFixture<(args: GotoAppConfigPageArgs) => Promise<AppConfigPage>, PlaywrightArgs>;
|
|
7
5
|
export declare const gotoAppConfigPage: GotoAppConfigPageFixture;
|
|
8
|
-
export
|
|
6
|
+
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { TestFixture } from '@playwright/test';
|
|
2
|
-
import {
|
|
3
|
-
import { PlaywrightCombinedArgs } from '../types';
|
|
2
|
+
import { PlaywrightArgs } from '../../types';
|
|
4
3
|
import { AppPage, GotoAppPageArgs } from '../..';
|
|
5
|
-
type GotoAppPageFixture = TestFixture<(args: GotoAppPageArgs) => Promise<AppPage>,
|
|
4
|
+
type GotoAppPageFixture = TestFixture<(args: GotoAppPageArgs) => Promise<AppPage>, PlaywrightArgs>;
|
|
6
5
|
export declare const gotoAppPage: GotoAppPageFixture;
|
|
7
|
-
export
|
|
6
|
+
export {};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { TestFixture } from '@playwright/test';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
declare const gotoDashboardPage: GotoDashboardFixture;
|
|
8
|
-
export default gotoDashboardPage;
|
|
2
|
+
import { DashboardPageArgs, PlaywrightArgs } from '../../types';
|
|
3
|
+
import { DashboardPage } from '../../models/pages/DashboardPage';
|
|
4
|
+
type GotoDashboardFixture = TestFixture<(args: DashboardPageArgs) => Promise<DashboardPage>, PlaywrightArgs>;
|
|
5
|
+
export declare const gotoDashboardPage: GotoDashboardFixture;
|
|
6
|
+
export {};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
exports.gotoDashboardPage = void 0;
|
|
4
|
+
const DashboardPage_1 = require("../../models/pages/DashboardPage");
|
|
4
5
|
const gotoDashboardPage = async ({ request, page, selectors, grafanaVersion }, use, testInfo) => {
|
|
5
6
|
await use(async (args) => {
|
|
6
|
-
const dashboardPage = new
|
|
7
|
+
const dashboardPage = new DashboardPage_1.DashboardPage({ page, selectors, grafanaVersion, request, testInfo }, args);
|
|
7
8
|
await dashboardPage.goto();
|
|
8
9
|
return dashboardPage;
|
|
9
10
|
});
|
|
10
11
|
};
|
|
11
|
-
exports.
|
|
12
|
+
exports.gotoDashboardPage = gotoDashboardPage;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { TestFixture } from '@playwright/test';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export default gotoDataSourceConfigPage;
|
|
2
|
+
import { PlaywrightArgs } from '../../types';
|
|
3
|
+
import { DataSourceConfigPage } from '../../models/pages/DataSourceConfigPage';
|
|
4
|
+
type GotoDataSourceConfigPageFixture = TestFixture<(uid: string) => Promise<DataSourceConfigPage>, PlaywrightArgs>;
|
|
5
|
+
export declare const gotoDataSourceConfigPage: GotoDataSourceConfigPageFixture;
|
|
6
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
exports.gotoDataSourceConfigPage = void 0;
|
|
4
|
+
const DataSourceConfigPage_1 = require("../../models/pages/DataSourceConfigPage");
|
|
4
5
|
const gotoDataSourceConfigPage = async ({ request, page, selectors, grafanaVersion }, use, testInfo) => {
|
|
5
6
|
await use(async (uid) => {
|
|
6
7
|
const response = await request.get(`/api/datasources/uid/${uid}`, {
|
|
@@ -13,9 +14,9 @@ const gotoDataSourceConfigPage = async ({ request, page, selectors, grafanaVersi
|
|
|
13
14
|
throw new Error(`Failed to get datasource by uid: ${response.statusText()}. If you're using a provisioned data source, make sure it has a UID`);
|
|
14
15
|
}
|
|
15
16
|
const settings = await response.json();
|
|
16
|
-
const dataSourceConfigPage = new
|
|
17
|
+
const dataSourceConfigPage = new DataSourceConfigPage_1.DataSourceConfigPage({ page, selectors, grafanaVersion, request, testInfo }, settings);
|
|
17
18
|
await dataSourceConfigPage.goto();
|
|
18
19
|
return dataSourceConfigPage;
|
|
19
20
|
});
|
|
20
21
|
};
|
|
21
|
-
exports.
|
|
22
|
+
exports.gotoDataSourceConfigPage = gotoDataSourceConfigPage;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { TestFixture } from '@playwright/test';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
declare const gotoPanelEditPage: GotoPanelEditPageFixture;
|
|
8
|
-
export default gotoPanelEditPage;
|
|
2
|
+
import { DashboardEditViewArgs, PlaywrightArgs } from '../../types';
|
|
3
|
+
import { PanelEditPage } from '../../models/pages/PanelEditPage';
|
|
4
|
+
type GotoPanelEditPageFixture = TestFixture<(args: DashboardEditViewArgs<string>) => Promise<PanelEditPage>, PlaywrightArgs>;
|
|
5
|
+
export declare const gotoPanelEditPage: GotoPanelEditPageFixture;
|
|
6
|
+
export {};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
exports.gotoPanelEditPage = void 0;
|
|
4
|
+
const PanelEditPage_1 = require("../../models/pages/PanelEditPage");
|
|
4
5
|
const gotoPanelEditPage = async ({ request, page, selectors, grafanaVersion }, use, testInfo) => {
|
|
5
6
|
await use(async (args) => {
|
|
6
|
-
const panelEditPage = new
|
|
7
|
+
const panelEditPage = new PanelEditPage_1.PanelEditPage({ page, selectors, grafanaVersion, request, testInfo }, args);
|
|
7
8
|
await panelEditPage.goto();
|
|
8
9
|
return panelEditPage;
|
|
9
10
|
});
|
|
10
11
|
};
|
|
11
|
-
exports.
|
|
12
|
+
exports.gotoPanelEditPage = gotoPanelEditPage;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { TestFixture } from '@playwright/test';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
declare const gotoVariableEditPage: GotoVariableEditPageFixture;
|
|
8
|
-
export default gotoVariableEditPage;
|
|
2
|
+
import { DashboardEditViewArgs, PlaywrightArgs } from '../../types';
|
|
3
|
+
import { VariableEditPage } from '../../models/pages/VariableEditPage';
|
|
4
|
+
type GotoVariableEditPageFixture = TestFixture<(args: DashboardEditViewArgs<string>) => Promise<VariableEditPage>, PlaywrightArgs>;
|
|
5
|
+
export declare const gotoVariableEditPage: GotoVariableEditPageFixture;
|
|
6
|
+
export {};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
exports.gotoVariableEditPage = void 0;
|
|
4
|
+
const VariableEditPage_1 = require("../../models/pages/VariableEditPage");
|
|
4
5
|
const gotoVariableEditPage = async ({ request, page, selectors, grafanaVersion }, use, testInfo) => {
|
|
5
6
|
await use(async (args) => {
|
|
6
|
-
const variableEditPage = new
|
|
7
|
+
const variableEditPage = new VariableEditPage_1.VariableEditPage({ page, selectors, grafanaVersion, request, testInfo }, args);
|
|
7
8
|
await variableEditPage.goto();
|
|
8
9
|
return variableEditPage;
|
|
9
10
|
});
|
|
10
11
|
};
|
|
11
|
-
exports.
|
|
12
|
+
exports.gotoVariableEditPage = gotoVariableEditPage;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { TestFixture } from '@playwright/test';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export default login;
|
|
2
|
+
import { PlaywrightArgs } from '../../types';
|
|
3
|
+
type LoginFixture = TestFixture<() => Promise<void>, PlaywrightArgs>;
|
|
4
|
+
export declare const login: LoginFixture;
|
|
5
|
+
export {};
|
|
@@ -3,9 +3,9 @@ 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
|
+
exports.login = void 0;
|
|
6
7
|
const path_1 = __importDefault(require("path"));
|
|
7
8
|
const test_1 = require("@playwright/test");
|
|
8
|
-
const authFile = 'playwright/.auth/user.json';
|
|
9
9
|
const ADMIN_USER = { user: 'admin', password: 'admin' };
|
|
10
10
|
const login = async ({ request, user }, use) => {
|
|
11
11
|
await use(async () => {
|
|
@@ -16,4 +16,4 @@ const login = async ({ request, user }, use) => {
|
|
|
16
16
|
await request.storageState({ path: path_1.default.join(process.cwd(), `playwright/.auth/${data.user}.json`) });
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
|
-
exports.
|
|
19
|
+
exports.login = login;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { TestFixture } from '@playwright/test';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
declare const readProvisionedDashboard: ReadProvisionedDashboardFixture;
|
|
7
|
-
export default readProvisionedDashboard;
|
|
2
|
+
import { PlaywrightArgs, ReadProvisionedDashboardArgs } from '../../types';
|
|
3
|
+
type ReadProvisionedDashboardFixture = TestFixture<(<T = any>(args: ReadProvisionedDashboardArgs) => Promise<T>), PlaywrightArgs>;
|
|
4
|
+
export declare const readProvisionedDashboard: ReadProvisionedDashboardFixture;
|
|
5
|
+
export {};
|
|
@@ -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
|
+
exports.readProvisionedDashboard = void 0;
|
|
6
7
|
const path_1 = __importDefault(require("path"));
|
|
7
8
|
const fs_1 = require("fs");
|
|
8
9
|
const DASHBOARDS_DIR = 'dashboards';
|
|
@@ -13,4 +14,4 @@ const readProvisionedDashboard = async ({ provisioningRootDir }, use) => {
|
|
|
13
14
|
return JSON.parse(contents);
|
|
14
15
|
});
|
|
15
16
|
};
|
|
16
|
-
exports.
|
|
17
|
+
exports.readProvisionedDashboard = readProvisionedDashboard;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { TestFixture } from '@playwright/test';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
declare const readProvisionedDataSource: ReadProvisionedDataSourceFixture;
|
|
7
|
-
export default readProvisionedDataSource;
|
|
2
|
+
import { ReadProvisionedDataSourceArgs, PlaywrightArgs } from '../../types';
|
|
3
|
+
type ReadProvisionedDataSourceFixture = TestFixture<(<T = any>(args: ReadProvisionedDataSourceArgs) => Promise<T>), PlaywrightArgs>;
|
|
4
|
+
export declare const readProvisionedDataSource: ReadProvisionedDataSourceFixture;
|
|
5
|
+
export {};
|
|
@@ -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
|
+
exports.readProvisionedDataSource = void 0;
|
|
6
7
|
const fs_1 = require("fs");
|
|
7
8
|
const path_1 = __importDefault(require("path"));
|
|
8
9
|
const yaml_1 = require("yaml");
|
|
@@ -18,4 +19,4 @@ const readProvisionedDataSource = async ({ provisioningRootDir }, use) => {
|
|
|
18
19
|
return yml.datasources.find((ds) => ds.name === name);
|
|
19
20
|
});
|
|
20
21
|
};
|
|
21
|
-
exports.
|
|
22
|
+
exports.readProvisionedDataSource = readProvisionedDataSource;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { TestFixture } from '@playwright/test';
|
|
2
|
-
import {
|
|
3
|
-
import { DashboardPage } from '../models';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export default dashboardPage;
|
|
2
|
+
import { PlaywrightArgs } from '../types';
|
|
3
|
+
import { DashboardPage } from '../models/pages/DashboardPage';
|
|
4
|
+
type DashboardPageFixture = TestFixture<DashboardPage, PlaywrightArgs>;
|
|
5
|
+
export declare const dashboardPage: DashboardPageFixture;
|
|
6
|
+
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
exports.dashboardPage = void 0;
|
|
4
|
+
const DashboardPage_1 = require("../models/pages/DashboardPage");
|
|
4
5
|
const dashboardPage = async ({ page, request, selectors, grafanaVersion }, use, testInfo) => {
|
|
5
|
-
const dashboardPage = new
|
|
6
|
+
const dashboardPage = new DashboardPage_1.DashboardPage({ page, selectors, grafanaVersion, request, testInfo });
|
|
6
7
|
await dashboardPage.goto();
|
|
7
8
|
await use(dashboardPage);
|
|
8
9
|
};
|
|
9
|
-
exports.
|
|
10
|
+
exports.dashboardPage = dashboardPage;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { TestFixture } from '@playwright/test';
|
|
2
|
-
import {
|
|
2
|
+
import { PlaywrightArgs } from '../types';
|
|
3
3
|
import { ExplorePage } from '../models/pages/ExplorePage';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export default explorePage;
|
|
4
|
+
type ExplorePageFixture = TestFixture<ExplorePage, PlaywrightArgs>;
|
|
5
|
+
export declare const explorePage: ExplorePageFixture;
|
|
6
|
+
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.explorePage = void 0;
|
|
3
4
|
const ExplorePage_1 = require("../models/pages/ExplorePage");
|
|
4
5
|
const explorePage = async ({ page, selectors, grafanaVersion, request }, use, testInfo) => {
|
|
5
6
|
const explorePage = new ExplorePage_1.ExplorePage({ page, selectors, grafanaVersion, request, testInfo });
|
|
6
7
|
await explorePage.goto();
|
|
7
8
|
await use(explorePage);
|
|
8
9
|
};
|
|
9
|
-
exports.
|
|
10
|
+
exports.explorePage = explorePage;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { PlaywrightTestArgs, TestFixture } from '@playwright/test';
|
|
2
2
|
type GrafanaVersion = TestFixture<string, PlaywrightTestArgs>;
|
|
3
|
-
declare const grafanaVersion: GrafanaVersion;
|
|
4
|
-
export
|
|
3
|
+
export declare const grafanaVersion: GrafanaVersion;
|
|
4
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.grafanaVersion = void 0;
|
|
3
4
|
const grafanaVersion = async ({ page }, use) => {
|
|
4
5
|
let grafanaVersion = process.env.GRAFANA_VERSION ?? '';
|
|
5
6
|
if (!grafanaVersion) {
|
|
@@ -8,4 +9,4 @@ const grafanaVersion = async ({ page }, use) => {
|
|
|
8
9
|
}
|
|
9
10
|
await use(grafanaVersion.replace(/\-.*/, ''));
|
|
10
11
|
};
|
|
11
|
-
exports.
|
|
12
|
+
exports.grafanaVersion = grafanaVersion;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { TestFixture } from '@playwright/test';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export default isFeatureToggleEnabled;
|
|
2
|
+
import { PlaywrightArgs } from '../types';
|
|
3
|
+
type FeatureToggleFixture = TestFixture<(<T = object>(featureToggle: keyof T) => Promise<boolean>), PlaywrightArgs>;
|
|
4
|
+
export declare const isFeatureToggleEnabled: FeatureToggleFixture;
|
|
5
|
+
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isFeatureToggleEnabled = void 0;
|
|
3
4
|
const isFeatureToggleEnabled = async ({ page, grafanaVersion }, use) => {
|
|
4
5
|
await use(async (featureToggle) => {
|
|
5
6
|
const featureToggles = await page.evaluate('window.grafanaBootData.settings.featureToggles');
|
|
6
7
|
return Boolean(featureToggles[featureToggle]);
|
|
7
8
|
});
|
|
8
9
|
};
|
|
9
|
-
exports.
|
|
10
|
+
exports.isFeatureToggleEnabled = isFeatureToggleEnabled;
|
package/dist/fixtures/page.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { TestFixture, Page } from '@playwright/test';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
type PageFixture = TestFixture<Page, PluginFixture & PluginOptions & PlaywrightCombinedArgs>;
|
|
2
|
+
import { PlaywrightArgs } from '../types';
|
|
3
|
+
type PageFixture = TestFixture<Page, PlaywrightArgs>;
|
|
5
4
|
/**
|
|
6
5
|
* This fixture ensures the feature toggles defined in the Playwright config are being used in Grafana frontend.
|
|
7
6
|
* If Grafana version >= 10.1.0, feature toggles are read from to the 'grafana.featureToggles' key in the browser's localStorage.
|
|
@@ -13,5 +12,5 @@ type PageFixture = TestFixture<Page, PluginFixture & PluginOptions & PlaywrightC
|
|
|
13
12
|
* newly attached frame.
|
|
14
13
|
* The script is evaluated after the document was created but before any of its scripts were run.
|
|
15
14
|
*/
|
|
16
|
-
declare const page: PageFixture;
|
|
17
|
-
export
|
|
15
|
+
export declare const page: PageFixture;
|
|
16
|
+
export {};
|
package/dist/fixtures/page.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.page = void 0;
|
|
3
4
|
const overrideFeatureToggles_1 = require("./scripts/overrideFeatureToggles");
|
|
4
5
|
/**
|
|
5
6
|
* This fixture ensures the feature toggles defined in the Playwright config are being used in Grafana frontend.
|
|
@@ -24,4 +25,4 @@ const page = async ({ page, featureToggles }, use) => {
|
|
|
24
25
|
await page.goto('/');
|
|
25
26
|
await use(page);
|
|
26
27
|
};
|
|
27
|
-
exports.
|
|
28
|
+
exports.page = page;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { TestFixture } from '@playwright/test';
|
|
2
|
-
import {
|
|
3
|
-
import { PanelEditPage } from '../models';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export default panelEditPage;
|
|
2
|
+
import { PlaywrightArgs } from '../types';
|
|
3
|
+
import { PanelEditPage } from '../models/pages/PanelEditPage';
|
|
4
|
+
type PanelEditPageFixture = TestFixture<PanelEditPage, PlaywrightArgs>;
|
|
5
|
+
export declare const panelEditPage: PanelEditPageFixture;
|
|
6
|
+
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.panelEditPage = void 0;
|
|
3
4
|
const panelEditPage = async ({ dashboardPage }, use) => {
|
|
4
5
|
const panelEditPage = await dashboardPage.addPanel();
|
|
5
6
|
await use(panelEditPage);
|
|
6
7
|
};
|
|
7
|
-
exports.
|
|
8
|
+
exports.panelEditPage = panelEditPage;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { TestFixture } from '@playwright/test';
|
|
2
|
-
import {
|
|
2
|
+
import { PlaywrightArgs } from '../types';
|
|
3
3
|
import { E2ESelectors } from '../e2e-selectors';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export default selectors;
|
|
4
|
+
type SelectorFixture = TestFixture<E2ESelectors, PlaywrightArgs>;
|
|
5
|
+
export declare const selectors: SelectorFixture;
|
|
6
|
+
export {};
|