@grafana/plugin-e2e 0.0.0 → 0.0.1
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/README.md +1 -0
- package/dist/api.d.ts +41 -0
- package/dist/api.js +15 -0
- package/dist/e2e-selectors/index.d.ts +2 -0
- package/dist/e2e-selectors/index.js +20 -0
- package/dist/e2e-selectors/resolver.d.ts +3 -0
- package/dist/e2e-selectors/resolver.js +38 -0
- package/dist/e2e-selectors/resolver.test.d.ts +1 -0
- package/dist/e2e-selectors/resolver.test.js +39 -0
- package/dist/e2e-selectors/types.d.ts +691 -0
- package/dist/e2e-selectors/types.js +2 -0
- package/dist/e2e-selectors/versioned/apis.d.ts +29 -0
- package/dist/e2e-selectors/versioned/apis.js +35 -0
- package/dist/e2e-selectors/versioned/components.d.ts +419 -0
- package/dist/e2e-selectors/versioned/components.js +426 -0
- package/dist/e2e-selectors/versioned/constants.d.ts +1 -0
- package/dist/e2e-selectors/versioned/constants.js +4 -0
- package/dist/e2e-selectors/versioned/index.d.ts +2 -0
- package/dist/e2e-selectors/versioned/index.js +7 -0
- package/dist/e2e-selectors/versioned/pages.d.ts +334 -0
- package/dist/e2e-selectors/versioned/pages.js +345 -0
- package/dist/e2e-selectors/versioned/types.d.ts +8 -0
- package/dist/e2e-selectors/versioned/types.js +2 -0
- package/dist/fixtures/annotationEditPage.d.ts +7 -0
- package/dist/fixtures/annotationEditPage.js +62 -0
- package/dist/fixtures/commands/createDataSource.d.ts +8 -0
- package/dist/fixtures/commands/createDataSource.js +110 -0
- package/dist/fixtures/commands/createDataSourceConfigPage.d.ts +8 -0
- package/dist/fixtures/commands/createDataSourceConfigPage.js +82 -0
- package/dist/fixtures/commands/login.d.ts +6 -0
- package/dist/fixtures/commands/login.js +88 -0
- package/dist/fixtures/commands/readProvision.d.ts +7 -0
- package/dist/fixtures/commands/readProvision.js +67 -0
- package/dist/fixtures/explorePage.d.ts +7 -0
- package/dist/fixtures/explorePage.js +59 -0
- package/dist/fixtures/grafanaVersion.d.ts +6 -0
- package/dist/fixtures/grafanaVersion.js +63 -0
- package/dist/fixtures/index.d.ts +14 -0
- package/dist/fixtures/index.js +29 -0
- package/dist/fixtures/newDashboardPage.d.ts +7 -0
- package/dist/fixtures/newDashboardPage.js +59 -0
- package/dist/fixtures/panelEditPage.d.ts +7 -0
- package/dist/fixtures/panelEditPage.js +56 -0
- package/dist/fixtures/selectors.d.ts +7 -0
- package/dist/fixtures/selectors.js +62 -0
- package/dist/fixtures/types.d.ts +2 -0
- package/dist/fixtures/types.js +2 -0
- package/dist/fixtures/variableEditPage.d.ts +7 -0
- package/dist/fixtures/variableEditPage.js +62 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +22 -0
- package/dist/matchers/index.d.ts +20 -0
- package/dist/matchers/index.js +13 -0
- package/dist/matchers/toBeOK.d.ts +7 -0
- package/dist/matchers/toBeOK.js +69 -0
- package/dist/matchers/toDisplayPreviews.d.ts +7 -0
- package/dist/matchers/toDisplayPreviews.js +70 -0
- package/dist/matchers/toHavePanelError.d.ts +9 -0
- package/dist/matchers/toHavePanelError.js +74 -0
- package/dist/matchers/utils.d.ts +1 -0
- package/dist/matchers/utils.js +5 -0
- package/dist/models/AnnotationEditPage.d.ts +8 -0
- package/dist/models/AnnotationEditPage.js +82 -0
- package/dist/models/AnnotationPage.d.ts +8 -0
- package/dist/models/AnnotationPage.js +123 -0
- package/dist/models/DashboardPage.d.ts +15 -0
- package/dist/models/DashboardPage.js +163 -0
- package/dist/models/DataSourceConfigPage.d.ts +10 -0
- package/dist/models/DataSourceConfigPage.js +135 -0
- package/dist/models/DataSourcePicker.d.ts +6 -0
- package/dist/models/DataSourcePicker.js +86 -0
- package/dist/models/ExplorePage.d.ts +12 -0
- package/dist/models/ExplorePage.js +130 -0
- package/dist/models/GrafanaPage.d.ts +11 -0
- package/dist/models/GrafanaPage.js +150 -0
- package/dist/models/PanelEditPage.d.ts +15 -0
- package/dist/models/PanelEditPage.js +165 -0
- package/dist/models/TimeRange.d.ts +6 -0
- package/dist/models/TimeRange.js +119 -0
- package/dist/models/VariableEditPage.d.ts +10 -0
- package/dist/models/VariableEditPage.js +109 -0
- package/dist/models/VariablePage.d.ts +8 -0
- package/dist/models/VariablePage.js +107 -0
- package/dist/models/index.d.ts +8 -0
- package/dist/models/index.js +19 -0
- package/dist/selectorEngine.d.ts +4 -0
- package/dist/selectorEngine.js +18 -0
- package/dist/types.d.ts +54 -0
- package/dist/types.js +2 -0
- package/package.json +4 -4
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
exports.AnnotationEditPage = void 0;
|
|
55
|
+
var DataSourcePicker_1 = require("./DataSourcePicker");
|
|
56
|
+
var GrafanaPage_1 = require("./GrafanaPage");
|
|
57
|
+
var AnnotationEditPage = (function (_super) {
|
|
58
|
+
__extends(AnnotationEditPage, _super);
|
|
59
|
+
function AnnotationEditPage(ctx) {
|
|
60
|
+
var _this = _super.call(this, ctx) || this;
|
|
61
|
+
_this.datasource = new DataSourcePicker_1.DataSourcePicker(ctx);
|
|
62
|
+
return _this;
|
|
63
|
+
}
|
|
64
|
+
AnnotationEditPage.prototype.runQuery = function (options) {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
66
|
+
var responsePromise;
|
|
67
|
+
var _this = this;
|
|
68
|
+
return __generator(this, function (_a) {
|
|
69
|
+
switch (_a.label) {
|
|
70
|
+
case 0:
|
|
71
|
+
responsePromise = this.ctx.page.waitForResponse(function (resp) { return resp.url().includes(_this.ctx.selectors.apis.DataSource.query); }, options);
|
|
72
|
+
return [4, this.ctx.page.getByRole('button', { name: 'TEST' }).click()];
|
|
73
|
+
case 1:
|
|
74
|
+
_a.sent();
|
|
75
|
+
return [2, responsePromise];
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
return AnnotationEditPage;
|
|
81
|
+
}(GrafanaPage_1.GrafanaPage));
|
|
82
|
+
exports.AnnotationEditPage = AnnotationEditPage;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PluginTestCtx } from '../types';
|
|
2
|
+
import { AnnotationEditPage } from './AnnotationEditPage';
|
|
3
|
+
import { GrafanaPage } from './GrafanaPage';
|
|
4
|
+
export declare class AnnotationPage extends GrafanaPage {
|
|
5
|
+
constructor(ctx: PluginTestCtx);
|
|
6
|
+
goto(): Promise<void>;
|
|
7
|
+
clickAddNew(): Promise<AnnotationEditPage>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
41
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
42
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
43
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
44
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
45
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
46
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
50
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
51
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
52
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
53
|
+
function step(op) {
|
|
54
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
55
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
56
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
57
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
58
|
+
switch (op[0]) {
|
|
59
|
+
case 0: case 1: t = op; break;
|
|
60
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
61
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
62
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
63
|
+
default:
|
|
64
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
65
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
66
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
67
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
68
|
+
if (t[2]) _.ops.pop();
|
|
69
|
+
_.trys.pop(); continue;
|
|
70
|
+
}
|
|
71
|
+
op = body.call(thisArg, _);
|
|
72
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
73
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
77
|
+
exports.AnnotationPage = void 0;
|
|
78
|
+
var semver = __importStar(require("semver"));
|
|
79
|
+
var AnnotationEditPage_1 = require("./AnnotationEditPage");
|
|
80
|
+
var GrafanaPage_1 = require("./GrafanaPage");
|
|
81
|
+
var AnnotationPage = (function (_super) {
|
|
82
|
+
__extends(AnnotationPage, _super);
|
|
83
|
+
function AnnotationPage(ctx) {
|
|
84
|
+
return _super.call(this, ctx) || this;
|
|
85
|
+
}
|
|
86
|
+
AnnotationPage.prototype.goto = function () {
|
|
87
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
88
|
+
return __generator(this, function (_a) {
|
|
89
|
+
switch (_a.label) {
|
|
90
|
+
case 0: return [4, this.ctx.page.goto(this.ctx.selectors.pages.AddDashboard.Settings.Annotations.List.url, {
|
|
91
|
+
waitUntil: 'networkidle',
|
|
92
|
+
})];
|
|
93
|
+
case 1:
|
|
94
|
+
_a.sent();
|
|
95
|
+
return [2];
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
AnnotationPage.prototype.clickAddNew = function () {
|
|
101
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
102
|
+
var Dashboard;
|
|
103
|
+
return __generator(this, function (_a) {
|
|
104
|
+
switch (_a.label) {
|
|
105
|
+
case 0:
|
|
106
|
+
Dashboard = this.ctx.selectors.pages.Dashboard;
|
|
107
|
+
if (!semver.gte(this.ctx.grafanaVersion, '8.3.0')) return [3, 2];
|
|
108
|
+
return [4, this.getByTestIdOrAriaLabel(Dashboard.Settings.Annotations.List.addAnnotationCTAV2).click()];
|
|
109
|
+
case 1:
|
|
110
|
+
_a.sent();
|
|
111
|
+
return [3, 4];
|
|
112
|
+
case 2: return [4, this.getByTestIdOrAriaLabel(Dashboard.Settings.Annotations.List.addAnnotationCTA).click()];
|
|
113
|
+
case 3:
|
|
114
|
+
_a.sent();
|
|
115
|
+
_a.label = 4;
|
|
116
|
+
case 4: return [2, new AnnotationEditPage_1.AnnotationEditPage(this.ctx)];
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
return AnnotationPage;
|
|
122
|
+
}(GrafanaPage_1.GrafanaPage));
|
|
123
|
+
exports.AnnotationPage = AnnotationPage;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { GotoDashboardArgs, PluginTestCtx } from '../types';
|
|
2
|
+
import { GrafanaPage } from './GrafanaPage';
|
|
3
|
+
import { PanelEditPage } from './PanelEditPage';
|
|
4
|
+
import { TimeRange } from './TimeRange';
|
|
5
|
+
export declare class DashboardPage extends GrafanaPage {
|
|
6
|
+
protected readonly dashboardUid?: string;
|
|
7
|
+
dataSourcePicker: any;
|
|
8
|
+
timeRange: TimeRange;
|
|
9
|
+
constructor(ctx: PluginTestCtx, dashboardUid?: string);
|
|
10
|
+
goto(opts?: GotoDashboardArgs): Promise<void>;
|
|
11
|
+
gotoPanelEditPage(panelId: string): Promise<PanelEditPage>;
|
|
12
|
+
addPanel(): Promise<PanelEditPage>;
|
|
13
|
+
deleteDashboard(): Promise<void>;
|
|
14
|
+
refreshDashboard(): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
exports.DashboardPage = void 0;
|
|
55
|
+
var gte = require('semver/functions/gte');
|
|
56
|
+
var DataSourcePicker_1 = require("./DataSourcePicker");
|
|
57
|
+
var GrafanaPage_1 = require("./GrafanaPage");
|
|
58
|
+
var PanelEditPage_1 = require("./PanelEditPage");
|
|
59
|
+
var TimeRange_1 = require("./TimeRange");
|
|
60
|
+
var DashboardPage = (function (_super) {
|
|
61
|
+
__extends(DashboardPage, _super);
|
|
62
|
+
function DashboardPage(ctx, dashboardUid) {
|
|
63
|
+
var _this = _super.call(this, ctx) || this;
|
|
64
|
+
_this.dashboardUid = dashboardUid;
|
|
65
|
+
_this.dataSourcePicker = new DataSourcePicker_1.DataSourcePicker(ctx);
|
|
66
|
+
_this.timeRange = new TimeRange_1.TimeRange(ctx);
|
|
67
|
+
return _this;
|
|
68
|
+
}
|
|
69
|
+
DashboardPage.prototype.goto = function (opts) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
71
|
+
var uid, url;
|
|
72
|
+
return __generator(this, function (_a) {
|
|
73
|
+
switch (_a.label) {
|
|
74
|
+
case 0:
|
|
75
|
+
uid = (opts === null || opts === void 0 ? void 0 : opts.uid) || this.dashboardUid;
|
|
76
|
+
url = uid ? this.ctx.selectors.pages.Dashboard.url(uid) : this.ctx.selectors.pages.AddDashboard.url;
|
|
77
|
+
if (opts === null || opts === void 0 ? void 0 : opts.queryParams) {
|
|
78
|
+
url += "?".concat(opts.queryParams.toString());
|
|
79
|
+
}
|
|
80
|
+
return [4, this.ctx.page.goto(url, {
|
|
81
|
+
waitUntil: 'networkidle',
|
|
82
|
+
})];
|
|
83
|
+
case 1:
|
|
84
|
+
_a.sent();
|
|
85
|
+
if (!(opts === null || opts === void 0 ? void 0 : opts.timeRange)) return [3, 3];
|
|
86
|
+
return [4, this.timeRange.set(opts.timeRange)];
|
|
87
|
+
case 2:
|
|
88
|
+
_a.sent();
|
|
89
|
+
_a.label = 3;
|
|
90
|
+
case 3: return [2];
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
DashboardPage.prototype.gotoPanelEditPage = function (panelId) {
|
|
96
|
+
var _a;
|
|
97
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
98
|
+
var url;
|
|
99
|
+
return __generator(this, function (_b) {
|
|
100
|
+
switch (_b.label) {
|
|
101
|
+
case 0:
|
|
102
|
+
url = this.ctx.selectors.pages.Dashboard.url((_a = this.dashboardUid) !== null && _a !== void 0 ? _a : '');
|
|
103
|
+
return [4, this.ctx.page.goto("".concat(url, "?editPanel=").concat(panelId), {
|
|
104
|
+
waitUntil: 'networkidle',
|
|
105
|
+
})];
|
|
106
|
+
case 1:
|
|
107
|
+
_b.sent();
|
|
108
|
+
return [2, new PanelEditPage_1.PanelEditPage(this.ctx)];
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
DashboardPage.prototype.addPanel = function () {
|
|
114
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
115
|
+
var _a, components, pages;
|
|
116
|
+
return __generator(this, function (_b) {
|
|
117
|
+
switch (_b.label) {
|
|
118
|
+
case 0:
|
|
119
|
+
_a = this.ctx.selectors, components = _a.components, pages = _a.pages;
|
|
120
|
+
if (!gte(this.ctx.grafanaVersion, '10.0.0')) return [3, 3];
|
|
121
|
+
return [4, this.getByTestIdOrAriaLabel(components.PageToolbar.itemButton(components.PageToolbar.itemButtonTitle)).click()];
|
|
122
|
+
case 1:
|
|
123
|
+
_b.sent();
|
|
124
|
+
return [4, this.getByTestIdOrAriaLabel(pages.AddDashboard.itemButton(pages.AddDashboard.itemButtonAddViz)).click()];
|
|
125
|
+
case 2:
|
|
126
|
+
_b.sent();
|
|
127
|
+
return [3, 5];
|
|
128
|
+
case 3: return [4, this.getByTestIdOrAriaLabel(pages.AddDashboard.addNewPanel).click()];
|
|
129
|
+
case 4:
|
|
130
|
+
_b.sent();
|
|
131
|
+
_b.label = 5;
|
|
132
|
+
case 5: return [2, new PanelEditPage_1.PanelEditPage(this.ctx)];
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
DashboardPage.prototype.deleteDashboard = function () {
|
|
138
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
139
|
+
return __generator(this, function (_a) {
|
|
140
|
+
switch (_a.label) {
|
|
141
|
+
case 0: return [4, this.ctx.request.delete(this.ctx.selectors.apis.Dashboard.delete(this.dashboardUid))];
|
|
142
|
+
case 1:
|
|
143
|
+
_a.sent();
|
|
144
|
+
return [2];
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
DashboardPage.prototype.refreshDashboard = function () {
|
|
150
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
151
|
+
return __generator(this, function (_a) {
|
|
152
|
+
switch (_a.label) {
|
|
153
|
+
case 0: return [4, this.ctx.page.getByTestId(this.ctx.selectors.components.RefreshPicker.runButtonV2).click()];
|
|
154
|
+
case 1:
|
|
155
|
+
_a.sent();
|
|
156
|
+
return [2];
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
};
|
|
161
|
+
return DashboardPage;
|
|
162
|
+
}(GrafanaPage_1.GrafanaPage));
|
|
163
|
+
exports.DashboardPage = DashboardPage;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DataSource, PluginTestCtx } from '../types';
|
|
2
|
+
import { GrafanaPage } from './GrafanaPage';
|
|
3
|
+
export declare class DataSourceConfigPage extends GrafanaPage {
|
|
4
|
+
private datasource;
|
|
5
|
+
constructor(ctx: PluginTestCtx, datasource: DataSource);
|
|
6
|
+
deleteDataSource(): Promise<void>;
|
|
7
|
+
goto(): Promise<void>;
|
|
8
|
+
mockHealthCheckResponse<T = any>(json: T, status?: number): Promise<void>;
|
|
9
|
+
saveAndTest(): Promise<import("playwright-core").Response>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
exports.DataSourceConfigPage = void 0;
|
|
55
|
+
var GrafanaPage_1 = require("./GrafanaPage");
|
|
56
|
+
var DataSourceConfigPage = (function (_super) {
|
|
57
|
+
__extends(DataSourceConfigPage, _super);
|
|
58
|
+
function DataSourceConfigPage(ctx, datasource) {
|
|
59
|
+
var _this = _super.call(this, ctx) || this;
|
|
60
|
+
_this.datasource = datasource;
|
|
61
|
+
return _this;
|
|
62
|
+
}
|
|
63
|
+
DataSourceConfigPage.prototype.deleteDataSource = function () {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
65
|
+
return __generator(this, function (_a) {
|
|
66
|
+
switch (_a.label) {
|
|
67
|
+
case 0: return [4, this.ctx.request.delete(this.ctx.selectors.apis.DataSource.delete(this.datasource.uid))];
|
|
68
|
+
case 1:
|
|
69
|
+
_a.sent();
|
|
70
|
+
return [2];
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
DataSourceConfigPage.prototype.goto = function () {
|
|
76
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
77
|
+
return __generator(this, function (_a) {
|
|
78
|
+
switch (_a.label) {
|
|
79
|
+
case 0: return [4, this.ctx.page.goto(this.ctx.selectors.pages.EditDataSource.url(this.datasource.uid), {
|
|
80
|
+
waitUntil: 'load',
|
|
81
|
+
})];
|
|
82
|
+
case 1:
|
|
83
|
+
_a.sent();
|
|
84
|
+
return [2];
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
DataSourceConfigPage.prototype.mockHealthCheckResponse = function (json, status) {
|
|
90
|
+
if (status === void 0) { status = 200; }
|
|
91
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
92
|
+
var _this = this;
|
|
93
|
+
return __generator(this, function (_a) {
|
|
94
|
+
switch (_a.label) {
|
|
95
|
+
case 0: return [4, this.ctx.page.route("".concat(this.ctx.selectors.apis.DataSource.health), function (route) { return __awaiter(_this, void 0, void 0, function () {
|
|
96
|
+
return __generator(this, function (_a) {
|
|
97
|
+
switch (_a.label) {
|
|
98
|
+
case 0: return [4, route.fulfill({ json: json, status: status })];
|
|
99
|
+
case 1:
|
|
100
|
+
_a.sent();
|
|
101
|
+
return [2];
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}); })];
|
|
105
|
+
case 1:
|
|
106
|
+
_a.sent();
|
|
107
|
+
return [2];
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
DataSourceConfigPage.prototype.saveAndTest = function () {
|
|
113
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
114
|
+
var responsePromise;
|
|
115
|
+
var _this = this;
|
|
116
|
+
return __generator(this, function (_a) {
|
|
117
|
+
switch (_a.label) {
|
|
118
|
+
case 0:
|
|
119
|
+
responsePromise = this.ctx.page.waitForResponse(function (resp) {
|
|
120
|
+
var _a, _b;
|
|
121
|
+
return resp
|
|
122
|
+
.url()
|
|
123
|
+
.includes(_this.ctx.selectors.apis.DataSource.health((_a = _this.datasource.uid) !== null && _a !== void 0 ? _a : '', (_b = _this.datasource.id.toString()) !== null && _b !== void 0 ? _b : ''));
|
|
124
|
+
});
|
|
125
|
+
return [4, this.getByTestIdOrAriaLabel(this.ctx.selectors.pages.DataSource.saveAndTest).click()];
|
|
126
|
+
case 1:
|
|
127
|
+
_a.sent();
|
|
128
|
+
return [2, responsePromise];
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
return DataSourceConfigPage;
|
|
134
|
+
}(GrafanaPage_1.GrafanaPage));
|
|
135
|
+
exports.DataSourceConfigPage = DataSourceConfigPage;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
exports.DataSourcePicker = void 0;
|
|
55
|
+
var GrafanaPage_1 = require("./GrafanaPage");
|
|
56
|
+
var DataSourcePicker = (function (_super) {
|
|
57
|
+
__extends(DataSourcePicker, _super);
|
|
58
|
+
function DataSourcePicker(ctx) {
|
|
59
|
+
return _super.call(this, ctx) || this;
|
|
60
|
+
}
|
|
61
|
+
DataSourcePicker.prototype.set = function (name) {
|
|
62
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
63
|
+
return __generator(this, function (_a) {
|
|
64
|
+
switch (_a.label) {
|
|
65
|
+
case 0: return [4, this.getByTestIdOrAriaLabel(this.ctx.selectors.components.DataSourcePicker.container)
|
|
66
|
+
.locator('input')
|
|
67
|
+
.fill(name)];
|
|
68
|
+
case 1:
|
|
69
|
+
_a.sent();
|
|
70
|
+
return [4, this.ctx.page.keyboard.press('ArrowDown')];
|
|
71
|
+
case 2:
|
|
72
|
+
_a.sent();
|
|
73
|
+
return [4, this.ctx.page.keyboard.press('ArrowUp')];
|
|
74
|
+
case 3:
|
|
75
|
+
_a.sent();
|
|
76
|
+
return [4, this.ctx.page.keyboard.press('Enter')];
|
|
77
|
+
case 4:
|
|
78
|
+
_a.sent();
|
|
79
|
+
return [2];
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
return DataSourcePicker;
|
|
85
|
+
}(GrafanaPage_1.GrafanaPage));
|
|
86
|
+
exports.DataSourcePicker = DataSourcePicker;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Locator } from '@playwright/test';
|
|
2
|
+
import { NavigateOptions, PluginTestCtx, RequestOptions } from '../types';
|
|
3
|
+
import { DataSourcePicker } from './DataSourcePicker';
|
|
4
|
+
import { GrafanaPage } from './GrafanaPage';
|
|
5
|
+
export declare class ExplorePage extends GrafanaPage {
|
|
6
|
+
datasource: DataSourcePicker;
|
|
7
|
+
timeRange: any;
|
|
8
|
+
constructor(ctx: PluginTestCtx);
|
|
9
|
+
goto(options?: NavigateOptions): Promise<void>;
|
|
10
|
+
getQueryEditorRow(refId: string): Promise<Locator>;
|
|
11
|
+
runQuery(options?: RequestOptions): Promise<import("playwright-core").Response>;
|
|
12
|
+
}
|