@twilio/flex-plugin-e2e-tests 6.3.3-beta.0 → 6.3.3

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.
@@ -1,181 +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 (_) 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
- var __read = (this && this.__read) || function (o, n) {
39
- var m = typeof Symbol === "function" && o[Symbol.iterator];
40
- if (!m) return o;
41
- var i = m.call(o), r, ar = [], e;
42
- try {
43
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
44
- }
45
- catch (error) { e = { error: error }; }
46
- finally {
47
- try {
48
- if (r && !r.done && (m = i["return"])) m.call(i);
49
- }
50
- finally { if (e) throw e.error; }
51
- }
52
- return ar;
53
- };
54
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
55
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
56
- to[j] = from[i];
57
- return to;
58
- };
59
- var __importDefault = (this && this.__importDefault) || function (mod) {
60
- return (mod && mod.__esModule) ? mod : { "default": mod };
61
- };
62
- Object.defineProperty(exports, "__esModule", { value: true });
63
- /* eslint-disable import/no-unused-modules */
64
- var replace_in_file_1 = require("replace-in-file");
65
- var semver_1 = __importDefault(require("semver"));
66
- var core_1 = require("../core");
67
- var utils_1 = require("../utils");
68
- var step011_1 = require("./step011");
69
- var testSuite = function (_a) {
70
- var scenario = _a.scenario, config = _a.config, secrets = _a.secrets, environment = _a.environment;
71
- return __awaiter(void 0, void 0, void 0, function () {
72
- var ext, tmpComponentText, startPlugin, plugin1, plugin2, plugin3, resource, oldVersion, flags, twilioCliResult, e_1;
73
- return __generator(this, function (_b) {
74
- switch (_b.label) {
75
- case 0:
76
- ext = scenario.isTS ? 'tsx' : 'jsx';
77
- tmpComponentText = 'This is the new text for the next version!';
78
- startPlugin = function (url) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
79
- return [2 /*return*/, utils_1.pluginHelper.waitForPluginToStart(url, core_1.testParams.config.start.timeout, core_1.testParams.config.start.pollInterval)];
80
- }); }); };
81
- plugin1 = scenario.plugins[0];
82
- plugin2 = scenario.plugins[1];
83
- plugin3 = scenario.plugins[2];
84
- utils_1.assertion.not.isNull(plugin1);
85
- utils_1.assertion.not.isNull(plugin2);
86
- utils_1.assertion.not.isNull(plugin3);
87
- utils_1.assertion.not.isNull(plugin1.newlineValue, 'scenario.plugins[0].newlineValue does not have a valid value');
88
- // Edit remote plugin to have different text
89
- return [4 /*yield*/, replace_in_file_1.replaceInFile({
90
- files: utils_1.joinPath(plugin1.dir, 'src', 'components', 'CustomTaskList', "CustomTaskList." + ext),
91
- from: plugin1.componentText,
92
- to: tmpComponentText,
93
- })];
94
- case 1:
95
- // Edit remote plugin to have different text
96
- _b.sent();
97
- return [4 /*yield*/, utils_1.api.getLatestPluginVersion(plugin1.name)];
98
- case 2:
99
- resource = _b.sent();
100
- oldVersion = (resource === null || resource === void 0 ? void 0 : resource.version) || '0.0.0';
101
- plugin1.version = semver_1.default.inc(oldVersion, 'patch');
102
- return [4 /*yield*/, utils_1.spawn('twilio', __spreadArray(['flex:plugins:deploy', '--changelog', "\"" + plugin1.changelog + "\"", '--patch', '-l', 'debug'], __read(config.regionFlag)), {
103
- cwd: plugin1.dir,
104
- })];
105
- case 3:
106
- _b.sent();
107
- // Release the edited plugin
108
- return [4 /*yield*/, utils_1.spawn('twilio', __spreadArray([
109
- 'flex:plugins:release',
110
- '--plugin',
111
- '-l',
112
- 'debug',
113
- plugin1.name + "@" + plugin1.version
114
- ], __read(config.regionFlag)))];
115
- case 4:
116
- // Release the edited plugin
117
- _b.sent();
118
- flags = ['--name', plugin1.name + "@" + oldVersion, '--name', plugin2.name];
119
- return [4 /*yield*/, utils_1.spawn('twilio', __spreadArray(['flex:plugins:start', '-l', 'debug'], __read(flags)), {
120
- detached: true,
121
- cwd: plugin3.dir,
122
- })];
123
- case 5:
124
- twilioCliResult = _b.sent();
125
- return [4 /*yield*/, Promise.all([startPlugin(plugin2.localhostUrl), startPlugin(plugin3.localhostUrl)])];
126
- case 6:
127
- _b.sent();
128
- _b.label = 7;
129
- case 7:
130
- _b.trys.push([7, 15, 17, 20]);
131
- // Login to Flex and setup the required flex.twilio.com cookies
132
- return [4 /*yield*/, step011_1.setupFlexBeforeLocalhost(config, secrets)];
133
- case 8:
134
- // Login to Flex and setup the required flex.twilio.com cookies
135
- _b.sent();
136
- // Load local plugin
137
- return [4 /*yield*/, utils_1.Browser.loadNewPage({ flex: plugin3.localhostUrl, twilioConsole: config.consoleBaseUrl })];
138
- case 9:
139
- // Load local plugin
140
- _b.sent();
141
- return [4 /*yield*/, utils_1.Browser.app.twilioConsole.login('admin', secrets.api.accountSid, config.localhostPort, false)];
142
- case 10:
143
- _b.sent();
144
- // Check if local plugin loaded okay
145
- return [4 /*yield*/, utils_1.assertion.app.view.agentDesktop.isVisible()];
146
- case 11:
147
- // Check if local plugin loaded okay
148
- _b.sent();
149
- // @ts-ignore
150
- return [4 /*yield*/, utils_1.assertion.app.view.plugins.plugin.isVisible(plugin1.newlineValue)];
151
- case 12:
152
- // @ts-ignore
153
- _b.sent();
154
- return [4 /*yield*/, utils_1.assertion.app.view.plugins.plugin.isVisible(plugin2.componentText)];
155
- case 13:
156
- _b.sent();
157
- return [4 /*yield*/, utils_1.assertion.app.view.plugins.plugin.isVisible(plugin3.componentText)];
158
- case 14:
159
- _b.sent();
160
- return [3 /*break*/, 20];
161
- case 15:
162
- e_1 = _b.sent();
163
- return [4 /*yield*/, utils_1.Browser.app.takeScreenshot(environment.cwd)];
164
- case 16:
165
- _b.sent();
166
- throw e_1;
167
- case 17: return [4 /*yield*/, utils_1.Browser.kill()];
168
- case 18:
169
- _b.sent();
170
- return [4 /*yield*/, utils_1.killChildProcess(twilioCliResult.child, environment.operatingSystem)];
171
- case 19:
172
- _b.sent();
173
- return [7 /*endfinally*/];
174
- case 20: return [2 /*return*/];
175
- }
176
- });
177
- });
178
- };
179
- testSuite.description = 'Running {{twilio flex:plugins:start}} with multiple plugins: 2 local and 1 versioned';
180
- exports.default = testSuite;
181
- //# sourceMappingURL=step013.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"step013.js","sourceRoot":"","sources":["../../src/tests/step013.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA6C;AAC7C,mDAAgD;AAChD,kDAA4B;AAE5B,gCAA4D;AAC5D,kCAAoG;AACpG,qCAAqD;AAErD,IAAM,SAAS,GAAc,UAAO,EAAsD;QAApD,QAAQ,cAAA,EAAE,MAAM,YAAA,EAAE,OAAO,aAAA,EAAE,WAAW,iBAAA;;;;;;oBACpE,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;oBACpC,gBAAgB,GAAG,4CAA4C,CAAC;oBAChE,WAAW,GAAG,UAAO,GAAW;wBACpC,sBAAA,oBAAY,CAAC,oBAAoB,CAAC,GAAG,EAAE,iBAAU,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,iBAAU,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,EAAA;6BAAA,CAAC;oBAC1G,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;oBAC9B,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;oBAC9B,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;oBACpC,iBAAS,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;oBAC9B,iBAAS,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;oBAC9B,iBAAS,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;oBAC9B,iBAAS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