@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.
Files changed (70) hide show
  1. package/dist/auth/auth.setup.js +2 -2
  2. package/dist/fixtures/annotationEditPage.d.ts +5 -6
  3. package/dist/fixtures/annotationEditPage.js +4 -3
  4. package/dist/fixtures/commands/createDataSource.d.ts +4 -6
  5. package/dist/fixtures/commands/createDataSource.js +2 -2
  6. package/dist/fixtures/commands/createDataSourceConfigPage.d.ts +5 -7
  7. package/dist/fixtures/commands/createDataSourceConfigPage.js +4 -3
  8. package/dist/fixtures/commands/createUser.d.ts +4 -5
  9. package/dist/fixtures/commands/createUser.js +2 -1
  10. package/dist/fixtures/commands/gotoAnnotationEditPage.d.ts +5 -7
  11. package/dist/fixtures/commands/gotoAnnotationEditPage.js +4 -3
  12. package/dist/fixtures/commands/gotoAppConfigPage.d.ts +3 -5
  13. package/dist/fixtures/commands/gotoAppConfigPage.js +0 -1
  14. package/dist/fixtures/commands/gotoAppPage.d.ts +3 -4
  15. package/dist/fixtures/commands/gotoAppPage.js +0 -1
  16. package/dist/fixtures/commands/gotoDashboardPage.d.ts +5 -7
  17. package/dist/fixtures/commands/gotoDashboardPage.js +4 -3
  18. package/dist/fixtures/commands/gotoDataSourceConfigPage.d.ts +5 -6
  19. package/dist/fixtures/commands/gotoDataSourceConfigPage.js +4 -3
  20. package/dist/fixtures/commands/gotoPanelEditPage.d.ts +5 -7
  21. package/dist/fixtures/commands/gotoPanelEditPage.js +4 -3
  22. package/dist/fixtures/commands/gotoVariableEditPage.d.ts +5 -7
  23. package/dist/fixtures/commands/gotoVariableEditPage.js +4 -3
  24. package/dist/fixtures/commands/login.d.ts +4 -5
  25. package/dist/fixtures/commands/login.js +2 -2
  26. package/dist/fixtures/commands/readProvisionedDashboard.d.ts +4 -6
  27. package/dist/fixtures/commands/readProvisionedDashboard.js +2 -1
  28. package/dist/fixtures/commands/readProvisionedDataSource.d.ts +4 -6
  29. package/dist/fixtures/commands/readProvisionedDataSource.js +2 -1
  30. package/dist/fixtures/dashboardPage.d.ts +5 -6
  31. package/dist/fixtures/dashboardPage.js +4 -3
  32. package/dist/fixtures/explorePage.d.ts +4 -5
  33. package/dist/fixtures/explorePage.js +2 -1
  34. package/dist/fixtures/grafanaVersion.d.ts +2 -2
  35. package/dist/fixtures/grafanaVersion.js +2 -1
  36. package/dist/fixtures/isFeatureToggleEnabled.d.ts +4 -5
  37. package/dist/fixtures/isFeatureToggleEnabled.js +2 -1
  38. package/dist/fixtures/page.d.ts +4 -5
  39. package/dist/fixtures/page.js +2 -1
  40. package/dist/fixtures/panelEditPage.d.ts +5 -6
  41. package/dist/fixtures/panelEditPage.js +2 -1
  42. package/dist/fixtures/selectors.d.ts +4 -5
  43. package/dist/fixtures/selectors.js +2 -1
  44. package/dist/fixtures/variableEditPage.d.ts +5 -6
  45. package/dist/fixtures/variableEditPage.js +4 -3
  46. package/dist/index.d.ts +46 -6
  47. package/dist/index.js +105 -7
  48. package/dist/matchers/toBeOK.d.ts +1 -2
  49. package/dist/matchers/toBeOK.js +2 -1
  50. package/dist/matchers/toDisplayPreviews.d.ts +2 -3
  51. package/dist/matchers/toDisplayPreviews.js +2 -1
  52. package/dist/matchers/toHaveAlert.d.ts +2 -3
  53. package/dist/matchers/toHaveAlert.js +2 -1
  54. package/dist/models/pages/AppPage.d.ts +1 -1
  55. package/dist/models/pages/AppPage.js +2 -2
  56. package/dist/options.d.ts +3 -0
  57. package/dist/{options/index.js → options.js} +2 -2
  58. package/dist/types.d.ts +275 -39
  59. package/package.json +2 -2
  60. package/dist/api.d.ts +0 -254
  61. package/dist/api.js +0 -26
  62. package/dist/fixtures/index.d.ts +0 -25
  63. package/dist/fixtures/index.js +0 -52
  64. package/dist/fixtures/types.d.ts +0 -2
  65. package/dist/fixtures/types.js +0 -2
  66. package/dist/matchers/index.d.ts +0 -25
  67. package/dist/matchers/index.js +0 -13
  68. package/dist/models/index.d.ts +0 -15
  69. package/dist/models/index.js +0 -33
  70. package/dist/options/index.d.ts +0 -4
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const api_1 = require("../api");
4
- (0, api_1.test)('authenticate', async ({ login, createUser, user }) => {
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 { PluginFixture, PluginOptions } from '../api';
3
- import { AnnotationEditPage } from '../models';
4
- import { PlaywrightCombinedArgs } from './types';
5
- type AnnotationEditPageFixture = TestFixture<AnnotationEditPage, PluginFixture & PluginOptions & PlaywrightCombinedArgs>;
6
- declare const annotationEditPage: AnnotationEditPageFixture;
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
- const models_1 = require("../models");
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 models_1.AnnotationPage({ page, selectors, grafanaVersion, request, testInfo });
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.default = annotationEditPage;
11
+ exports.annotationEditPage = annotationEditPage;
@@ -1,8 +1,6 @@
1
1
  import { APIRequestContext, TestFixture } from '@playwright/test';
2
- import { PluginFixture, PluginOptions } from '../../api';
3
- import { CreateDataSourceArgs, DataSourceSettings } from '../../types';
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 default createDataSource;
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.default = createDataSource;
36
+ exports.createDataSource = createDataSource;
@@ -1,8 +1,6 @@
1
1
  import { TestFixture } from '@playwright/test';
2
- import { PluginFixture, PluginOptions } from '../../api';
3
- import { CreateDataSourcePageArgs } from '../../types';
4
- import { PlaywrightCombinedArgs } from '../types';
5
- import { DataSourceConfigPage } from '../../models';
6
- type CreateDataSourceConfigPageFixture = TestFixture<(args: CreateDataSourcePageArgs) => Promise<DataSourceConfigPage>, PluginFixture & PluginOptions & PlaywrightCombinedArgs>;
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
- const models_1 = require("../../models");
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 models_1.DataSourceConfigPage({ page, selectors, grafanaVersion, request, testInfo }, datasource);
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.default = createDataSourceConfigPage;
18
+ exports.createDataSourceConfigPage = createDataSourceConfigPage;
@@ -1,6 +1,5 @@
1
1
  import { TestFixture } from '@playwright/test';
2
- import { PluginFixture, PluginOptions } from '../../api';
3
- import { PlaywrightCombinedArgs } from '../types';
4
- type CreateUserFixture = TestFixture<() => Promise<void>, PluginFixture & PluginOptions & PlaywrightCombinedArgs>;
5
- declare const createUser: CreateUserFixture;
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.default = createUser;
51
+ exports.createUser = createUser;
@@ -1,8 +1,6 @@
1
1
  import { TestFixture } from '@playwright/test';
2
- import { PluginFixture, PluginOptions } from '../../api';
3
- import { DashboardEditViewArgs } from '../../types';
4
- import { PlaywrightCombinedArgs } from '../types';
5
- import { AnnotationEditPage } from '../../models';
6
- type GotoAnnotationEditPageFixture = TestFixture<(args: DashboardEditViewArgs<string>) => Promise<AnnotationEditPage>, PluginFixture & PluginOptions & PlaywrightCombinedArgs>;
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
- const models_1 = require("../../models");
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 models_1.AnnotationEditPage({ page, selectors, grafanaVersion, request, testInfo }, args);
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.default = gotoAnnotationEditPage;
12
+ exports.gotoAnnotationEditPage = gotoAnnotationEditPage;
@@ -1,8 +1,6 @@
1
1
  import { TestFixture } from '@playwright/test';
2
- import { PluginFixture, PluginOptions } from '../../api';
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>, PluginFixture & PluginOptions & PlaywrightCombinedArgs>;
4
+ type GotoAppConfigPageFixture = TestFixture<(args: GotoAppConfigPageArgs) => Promise<AppConfigPage>, PlaywrightArgs>;
7
5
  export declare const gotoAppConfigPage: GotoAppConfigPageFixture;
8
- export default gotoAppConfigPage;
6
+ export {};
@@ -10,4 +10,3 @@ const gotoAppConfigPage = async ({ page, selectors, grafanaVersion, request }, u
10
10
  });
11
11
  };
12
12
  exports.gotoAppConfigPage = gotoAppConfigPage;
13
- exports.default = exports.gotoAppConfigPage;
@@ -1,7 +1,6 @@
1
1
  import { TestFixture } from '@playwright/test';
2
- import { PluginFixture, PluginOptions } from '../../api';
3
- import { PlaywrightCombinedArgs } from '../types';
2
+ import { PlaywrightArgs } from '../../types';
4
3
  import { AppPage, GotoAppPageArgs } from '../..';
5
- type GotoAppPageFixture = TestFixture<(args: GotoAppPageArgs) => Promise<AppPage>, PluginFixture & PluginOptions & PlaywrightCombinedArgs>;
4
+ type GotoAppPageFixture = TestFixture<(args: GotoAppPageArgs) => Promise<AppPage>, PlaywrightArgs>;
6
5
  export declare const gotoAppPage: GotoAppPageFixture;
7
- export default gotoAppPage;
6
+ export {};
@@ -10,4 +10,3 @@ const gotoAppPage = async ({ page, selectors, grafanaVersion, request }, use, te
10
10
  });
11
11
  };
12
12
  exports.gotoAppPage = gotoAppPage;
13
- exports.default = exports.gotoAppPage;
@@ -1,8 +1,6 @@
1
1
  import { TestFixture } from '@playwright/test';
2
- import { PluginFixture, PluginOptions } from '../../api';
3
- import { DashboardPageArgs } from '../../types';
4
- import { PlaywrightCombinedArgs } from '../types';
5
- import { DashboardPage } from '../../models';
6
- type GotoDashboardFixture = TestFixture<(args: DashboardPageArgs) => Promise<DashboardPage>, PluginFixture & PluginOptions & PlaywrightCombinedArgs>;
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
- const models_1 = require("../../models");
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 models_1.DashboardPage({ page, selectors, grafanaVersion, request, testInfo }, args);
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.default = gotoDashboardPage;
12
+ exports.gotoDashboardPage = gotoDashboardPage;
@@ -1,7 +1,6 @@
1
1
  import { TestFixture } from '@playwright/test';
2
- import { PluginFixture, PluginOptions } from '../../api';
3
- import { PlaywrightCombinedArgs } from '../types';
4
- import { DataSourceConfigPage } from '../../models';
5
- type GotoDataSourceConfigPageFixture = TestFixture<(uid: string) => Promise<DataSourceConfigPage>, PluginFixture & PluginOptions & PlaywrightCombinedArgs>;
6
- declare const gotoDataSourceConfigPage: GotoDataSourceConfigPageFixture;
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
- const models_1 = require("../../models");
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 models_1.DataSourceConfigPage({ page, selectors, grafanaVersion, request, testInfo }, settings);
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.default = gotoDataSourceConfigPage;
22
+ exports.gotoDataSourceConfigPage = gotoDataSourceConfigPage;
@@ -1,8 +1,6 @@
1
1
  import { TestFixture } from '@playwright/test';
2
- import { PluginFixture, PluginOptions } from '../../api';
3
- import { DashboardEditViewArgs } from '../../types';
4
- import { PlaywrightCombinedArgs } from '../types';
5
- import { PanelEditPage } from '../../models';
6
- type GotoPanelEditPageFixture = TestFixture<(args: DashboardEditViewArgs<string>) => Promise<PanelEditPage>, PluginFixture & PluginOptions & PlaywrightCombinedArgs>;
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
- const models_1 = require("../../models");
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 models_1.PanelEditPage({ page, selectors, grafanaVersion, request, testInfo }, args);
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.default = gotoPanelEditPage;
12
+ exports.gotoPanelEditPage = gotoPanelEditPage;
@@ -1,8 +1,6 @@
1
1
  import { TestFixture } from '@playwright/test';
2
- import { PluginFixture, PluginOptions } from '../../api';
3
- import { DashboardEditViewArgs } from '../../types';
4
- import { PlaywrightCombinedArgs } from '../types';
5
- import { VariableEditPage } from '../../models';
6
- type GotoVariableEditPageFixture = TestFixture<(args: DashboardEditViewArgs<string>) => Promise<VariableEditPage>, PluginFixture & PluginOptions & PlaywrightCombinedArgs>;
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
- const models_1 = require("../../models");
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 models_1.VariableEditPage({ page, selectors, grafanaVersion, request, testInfo }, args);
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.default = gotoVariableEditPage;
12
+ exports.gotoVariableEditPage = gotoVariableEditPage;
@@ -1,6 +1,5 @@
1
1
  import { TestFixture } from '@playwright/test';
2
- import { PluginFixture, PluginOptions } from '../../api';
3
- import { PlaywrightCombinedArgs } from '../types';
4
- type LoginFixture = TestFixture<() => Promise<void>, PluginFixture & PluginOptions & PlaywrightCombinedArgs>;
5
- declare const login: LoginFixture;
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.default = login;
19
+ exports.login = login;
@@ -1,7 +1,5 @@
1
1
  import { TestFixture } from '@playwright/test';
2
- import { PluginFixture, PluginOptions } from '../../api';
3
- import { ReadProvisionedDashboardArgs } from '../../types';
4
- import { PlaywrightCombinedArgs } from '../types';
5
- type ReadProvisionedDashboardFixture = TestFixture<(<T = any>(args: ReadProvisionedDashboardArgs) => Promise<T>), PluginFixture & PluginOptions & PlaywrightCombinedArgs>;
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.default = readProvisionedDashboard;
17
+ exports.readProvisionedDashboard = readProvisionedDashboard;
@@ -1,7 +1,5 @@
1
1
  import { TestFixture } from '@playwright/test';
2
- import { PluginFixture, PluginOptions } from '../../api';
3
- import { ReadProvisionedDataSourceArgs } from '../../types';
4
- import { PlaywrightCombinedArgs } from '../types';
5
- type ReadProvisionedDataSourceFixture = TestFixture<(<T = any>(args: ReadProvisionedDataSourceArgs) => Promise<T>), PluginFixture & PluginOptions & PlaywrightCombinedArgs>;
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.default = readProvisionedDataSource;
22
+ exports.readProvisionedDataSource = readProvisionedDataSource;
@@ -1,7 +1,6 @@
1
1
  import { TestFixture } from '@playwright/test';
2
- import { PluginFixture, PluginOptions } from '../api';
3
- import { DashboardPage } from '../models';
4
- import { PlaywrightCombinedArgs } from './types';
5
- type DashboardPageFixture = TestFixture<DashboardPage, PluginFixture & PluginOptions & PlaywrightCombinedArgs>;
6
- declare const dashboardPage: DashboardPageFixture;
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
- const models_1 = require("../models");
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 models_1.DashboardPage({ page, selectors, grafanaVersion, request, testInfo });
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.default = dashboardPage;
10
+ exports.dashboardPage = dashboardPage;
@@ -1,7 +1,6 @@
1
1
  import { TestFixture } from '@playwright/test';
2
- import { PluginFixture, PluginOptions } from '../api';
2
+ import { PlaywrightArgs } from '../types';
3
3
  import { ExplorePage } from '../models/pages/ExplorePage';
4
- import { PlaywrightCombinedArgs } from './types';
5
- type ExplorePageFixture = TestFixture<ExplorePage, PluginFixture & PluginOptions & PlaywrightCombinedArgs>;
6
- declare const explorePage: ExplorePageFixture;
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.default = explorePage;
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 default grafanaVersion;
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.default = grafanaVersion;
12
+ exports.grafanaVersion = grafanaVersion;
@@ -1,6 +1,5 @@
1
1
  import { TestFixture } from '@playwright/test';
2
- import { PluginFixture, PluginOptions } from '../api';
3
- import { PlaywrightCombinedArgs } from './types';
4
- type FeatureToggleFixture = TestFixture<(<T = object>(featureToggle: keyof T) => Promise<boolean>), PluginFixture & PluginOptions & PlaywrightCombinedArgs>;
5
- declare const isFeatureToggleEnabled: FeatureToggleFixture;
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.default = isFeatureToggleEnabled;
10
+ exports.isFeatureToggleEnabled = isFeatureToggleEnabled;
@@ -1,7 +1,6 @@
1
1
  import { TestFixture, Page } from '@playwright/test';
2
- import { PluginFixture, PluginOptions } from '../api';
3
- import { PlaywrightCombinedArgs } from './types';
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 default page;
15
+ export declare const page: PageFixture;
16
+ export {};
@@ -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.default = page;
28
+ exports.page = page;
@@ -1,7 +1,6 @@
1
1
  import { TestFixture } from '@playwright/test';
2
- import { PluginFixture, PluginOptions } from '../api';
3
- import { PanelEditPage } from '../models';
4
- import { PlaywrightCombinedArgs } from './types';
5
- type PanelEditPageFixture = TestFixture<PanelEditPage, PluginFixture & PluginOptions & PlaywrightCombinedArgs>;
6
- declare const panelEditPage: PanelEditPageFixture;
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.default = panelEditPage;
8
+ exports.panelEditPage = panelEditPage;
@@ -1,7 +1,6 @@
1
1
  import { TestFixture } from '@playwright/test';
2
- import { PluginFixture, PluginOptions } from '../api';
2
+ import { PlaywrightArgs } from '../types';
3
3
  import { E2ESelectors } from '../e2e-selectors';
4
- import { PlaywrightCombinedArgs } from './types';
5
- type SelectorFixture = TestFixture<E2ESelectors, PluginFixture & PluginOptions & PlaywrightCombinedArgs>;
6
- declare const selectors: SelectorFixture;
7
- export default selectors;
4
+ type SelectorFixture = TestFixture<E2ESelectors, PlaywrightArgs>;
5
+ export declare const selectors: SelectorFixture;
6
+ export {};