@grafana/plugin-e2e 0.0.2-canary.610.88b3096.0 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.d.ts +2 -6
- package/dist/api.js +4 -4
- package/dist/e2e-selectors/resolver.js +12 -12
- package/dist/e2e-selectors/resolver.test.js +17 -19
- package/dist/e2e-selectors/types.d.ts +1 -4
- package/dist/e2e-selectors/versioned/apis.js +24 -26
- package/dist/e2e-selectors/versioned/components.js +78 -83
- package/dist/e2e-selectors/versioned/pages.js +40 -47
- package/dist/fixtures/annotationEditPage.js +6 -58
- package/dist/fixtures/commands/createDataSource.js +28 -102
- package/dist/fixtures/commands/createDataSourceConfigPage.js +12 -77
- package/dist/fixtures/commands/login.js +10 -80
- package/dist/fixtures/commands/readProvision.js +9 -63
- package/dist/fixtures/explorePage.js +5 -55
- package/dist/fixtures/grafanaVersion.js +7 -59
- package/dist/fixtures/index.js +11 -11
- package/dist/fixtures/newDashboardPage.js +5 -55
- package/dist/fixtures/panelEditPage.js +3 -52
- package/dist/fixtures/selectors.js +10 -58
- package/dist/fixtures/variableEditPage.js +6 -58
- package/dist/matchers/index.d.ts +0 -4
- package/dist/matchers/index.js +3 -5
- package/dist/matchers/toBeOK.js +20 -65
- package/dist/matchers/toDisplayPreviews.js +21 -66
- package/dist/matchers/toHavePanelError.js +20 -70
- package/dist/matchers/utils.js +1 -1
- package/dist/models/AnnotationEditPage.js +13 -77
- package/dist/models/AnnotationPage.js +21 -94
- package/dist/models/DashboardPage.js +50 -156
- package/dist/models/DataSourceConfigPage.d.ts +2 -2
- package/dist/models/DataSourceConfigPage.js +25 -131
- package/dist/models/DataSourcePicker.js +13 -81
- package/dist/models/ExplorePage.d.ts +1 -1
- package/dist/models/ExplorePage.js +34 -123
- package/dist/models/GrafanaPage.js +33 -137
- package/dist/models/PanelEditPage.d.ts +1 -1
- package/dist/models/PanelEditPage.js +37 -132
- package/dist/models/TimeRange.js +25 -114
- package/dist/models/VariableEditPage.js +25 -104
- package/dist/models/VariablePage.js +22 -101
- package/dist/selectorEngine.js +8 -8
- package/dist/types.d.ts +1 -12
- package/package.json +2 -2
- package/dist/matchers/toHaveAlert.d.ts +0 -8
- package/dist/matchers/toHaveAlert.js +0 -75
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/plugin-e2e",
|
|
3
|
-
"version": "0.0.2
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"semver": "^7.5.4",
|
|
45
45
|
"uuid": "^9.0.1"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "6ae82da1ba012e5741ec16077ddc0b0ec19f3d03"
|
|
48
48
|
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { GrafanaPage } from '../models';
|
|
2
|
-
import { AlertPageOptions } from '../types';
|
|
3
|
-
export type AlertVariant = 'success' | 'warning' | 'error' | 'info';
|
|
4
|
-
declare const toHaveAlert: (grafanaPage: GrafanaPage, severity: AlertVariant, options?: AlertPageOptions) => Promise<{
|
|
5
|
-
message: () => any;
|
|
6
|
-
pass: boolean;
|
|
7
|
-
}>;
|
|
8
|
-
export default toHaveAlert;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
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;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
var test_1 = require("@playwright/test");
|
|
40
|
-
var utils_1 = require("./utils");
|
|
41
|
-
var toHaveAlert = function (grafanaPage, severity, options) { return __awaiter(void 0, void 0, void 0, function () {
|
|
42
|
-
var pass, message, filteredAlerts, err_1;
|
|
43
|
-
return __generator(this, function (_a) {
|
|
44
|
-
switch (_a.label) {
|
|
45
|
-
case 0:
|
|
46
|
-
pass = true;
|
|
47
|
-
message = "An alert of variant ".concat(severity, " to be displayed on the page");
|
|
48
|
-
_a.label = 1;
|
|
49
|
-
case 1:
|
|
50
|
-
_a.trys.push([1, 3, , 4]);
|
|
51
|
-
filteredAlerts = grafanaPage
|
|
52
|
-
.getByTestIdOrAriaLabel(grafanaPage.ctx.selectors.components.Alert.alertV2(severity))
|
|
53
|
-
.filter({
|
|
54
|
-
hasText: options === null || options === void 0 ? void 0 : options.hasText,
|
|
55
|
-
hasNotText: options === null || options === void 0 ? void 0 : options.hasNotText,
|
|
56
|
-
has: options === null || options === void 0 ? void 0 : options.has,
|
|
57
|
-
hasNot: options === null || options === void 0 ? void 0 : options.hasNot,
|
|
58
|
-
});
|
|
59
|
-
return [4, (0, test_1.expect)(filteredAlerts.first()).toBeVisible({ timeout: options === null || options === void 0 ? void 0 : options.timeout })];
|
|
60
|
-
case 2:
|
|
61
|
-
_a.sent();
|
|
62
|
-
return [3, 4];
|
|
63
|
-
case 3:
|
|
64
|
-
err_1 = _a.sent();
|
|
65
|
-
message = (0, utils_1.getMessage)(message, "No alert was found on the page: ".concat(err_1 instanceof Error ? err_1.toString() : ''));
|
|
66
|
-
pass = false;
|
|
67
|
-
return [3, 4];
|
|
68
|
-
case 4: return [2, {
|
|
69
|
-
message: function () { return message; },
|
|
70
|
-
pass: pass,
|
|
71
|
-
}];
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
}); };
|
|
75
|
-
exports.default = toHaveAlert;
|