@twilio/flex-plugin-e2e-tests 6.3.3 → 6.3.4-alpha.202404120926

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.
@@ -0,0 +1,175 @@
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 testSuite = function (_a) {
69
+ var scenario = _a.scenario, config = _a.config, secrets = _a.secrets, environment = _a.environment;
70
+ return __awaiter(void 0, void 0, void 0, function () {
71
+ var ext, tmpComponentText, startPlugin, plugin1, plugin2, plugin3, resource, oldVersion, flags, twilioCliResult, e_1;
72
+ return __generator(this, function (_b) {
73
+ switch (_b.label) {
74
+ case 0:
75
+ ext = scenario.isTS ? 'tsx' : 'jsx';
76
+ tmpComponentText = 'This is the new text for the next version!';
77
+ startPlugin = function (url) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
78
+ return [2 /*return*/, utils_1.pluginHelper.waitForPluginToStart(url, core_1.testParams.config.start.timeout, core_1.testParams.config.start.pollInterval)];
79
+ }); }); };
80
+ plugin1 = scenario.plugins[0];
81
+ plugin2 = scenario.plugins[1];
82
+ plugin3 = scenario.plugins[2];
83
+ utils_1.assertion.not.isNull(plugin1);
84
+ utils_1.assertion.not.isNull(plugin2);
85
+ utils_1.assertion.not.isNull(plugin3);
86
+ utils_1.assertion.not.isNull(plugin1.newlineValue, 'scenario.plugins[0].newlineValue does not have a valid value');
87
+ // Edit remote plugin to have different text
88
+ return [4 /*yield*/, replace_in_file_1.replaceInFile({
89
+ files: utils_1.joinPath(plugin1.dir, 'src', 'components', 'CustomTaskList', "CustomTaskList." + ext),
90
+ from: plugin1.componentText,
91
+ to: tmpComponentText,
92
+ })];
93
+ case 1:
94
+ // Edit remote plugin to have different text
95
+ _b.sent();
96
+ return [4 /*yield*/, utils_1.api.getLatestPluginVersion(plugin1.name)];
97
+ case 2:
98
+ resource = _b.sent();
99
+ oldVersion = (resource === null || resource === void 0 ? void 0 : resource.version) || '0.0.0';
100
+ plugin1.version = semver_1.default.inc(oldVersion, 'patch');
101
+ return [4 /*yield*/, utils_1.spawn('twilio', __spreadArray(['flex:plugins:deploy', '--changelog', "\"" + plugin1.changelog + "\"", '--patch', '-l', 'debug'], __read(config.regionFlag)), {
102
+ cwd: plugin1.dir,
103
+ })];
104
+ case 3:
105
+ _b.sent();
106
+ // Release the edited plugin
107
+ return [4 /*yield*/, utils_1.spawn('twilio', __spreadArray([
108
+ 'flex:plugins:release',
109
+ '--plugin',
110
+ '-l',
111
+ 'debug',
112
+ plugin1.name + "@" + plugin1.version
113
+ ], __read(config.regionFlag)))];
114
+ case 4:
115
+ // Release the edited plugin
116
+ _b.sent();
117
+ flags = ['--name', plugin1.name + "@" + oldVersion, '--name', plugin2.name];
118
+ return [4 /*yield*/, utils_1.spawn('twilio', __spreadArray(['flex:plugins:start', '-l', 'debug'], __read(flags)), {
119
+ detached: true,
120
+ cwd: plugin3.dir,
121
+ })];
122
+ case 5:
123
+ twilioCliResult = _b.sent();
124
+ return [4 /*yield*/, Promise.all([startPlugin(plugin2.localhostUrl), startPlugin(plugin3.localhostUrl)])];
125
+ case 6:
126
+ _b.sent();
127
+ _b.label = 7;
128
+ case 7:
129
+ _b.trys.push([7, 14, 16, 19]);
130
+ // Load local plugin
131
+ return [4 /*yield*/, utils_1.Browser.create({ flex: plugin3.localhostUrl, twilioConsole: config.consoleBaseUrl })];
132
+ case 8:
133
+ // Load local plugin
134
+ _b.sent();
135
+ return [4 /*yield*/, utils_1.Browser.app.twilioConsole.login('admin', secrets.api.accountSid, config.localhostPort)];
136
+ case 9:
137
+ _b.sent();
138
+ // Check if local plugin loaded okay
139
+ return [4 /*yield*/, utils_1.assertion.app.view.agentDesktop.isVisible()];
140
+ case 10:
141
+ // Check if local plugin loaded okay
142
+ _b.sent();
143
+ // @ts-ignore
144
+ return [4 /*yield*/, utils_1.assertion.app.view.plugins.plugin.isVisible(plugin1.newlineValue)];
145
+ case 11:
146
+ // @ts-ignore
147
+ _b.sent();
148
+ return [4 /*yield*/, utils_1.assertion.app.view.plugins.plugin.isVisible(plugin2.componentText)];
149
+ case 12:
150
+ _b.sent();
151
+ return [4 /*yield*/, utils_1.assertion.app.view.plugins.plugin.isVisible(plugin3.componentText)];
152
+ case 13:
153
+ _b.sent();
154
+ return [3 /*break*/, 19];
155
+ case 14:
156
+ e_1 = _b.sent();
157
+ return [4 /*yield*/, utils_1.Browser.app.takeScreenshot(environment.cwd)];
158
+ case 15:
159
+ _b.sent();
160
+ throw e_1;
161
+ case 16: return [4 /*yield*/, utils_1.Browser.kill()];
162
+ case 17:
163
+ _b.sent();
164
+ return [4 /*yield*/, utils_1.killChildProcess(twilioCliResult.child, environment.operatingSystem)];
165
+ case 18:
166
+ _b.sent();
167
+ return [7 /*endfinally*/];
168
+ case 19: return [2 /*return*/];
169
+ }
170
+ });
171
+ });
172
+ };
173
+ testSuite.description = 'Running {{twilio flex:plugins:start}} with multiple plugins: 2 local and 1 versioned';
174
+ exports.default = testSuite;
175
+ //# sourceMappingURL=step013.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step013.js","sourceRoot":"","sources":["../../src/tests/step013.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA6C;AAC7C,mDAAgD;AAChD,kDAA4B;AAE5B,gCAA4D;AAC5D,kCAAoG;AAEpG,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,C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AAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,aAAa,CAAC,EAAA;;oBAAxE,SAAwE,CAAC;;;;oBAEzE,qBAAM,eAAO,CAAC,GAAG,CAAC,cAAc,CAAC,WAAW,CAAC,GAAG,CAAC,EAAA;;oBAAjD,SAAiD,CAAC;oBAClD,MAAM,GAAC,CAAC;yBAER,qBAAM,eAAO,CAAC,IAAI,EAAE,EAAA;;oBAApB,SAAoB,CAAC;oBACrB,qBAAM,wBAAgB,CAAC,eAAe,CAAC,KAAK,EAAE,WAAW,CAAC,eAAe,CAAC,EAAA;;oBAA1E,SAA0E,CAAC;;;;;;CAE9E,CAAC;AAEF,SAAS,CAAC,WAAW,GAAG,sFAAsF,CAAC;AAE/G,kBAAe,SAAS,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twilio/flex-plugin-e2e-tests",
3
- "version": "6.3.3",
3
+ "version": "6.3.4-alpha.202404120926",
4
4
  "description": "Flex Plugin E2E Tests framework",
5
5
  "keywords": [
6
6
  "flex",
@@ -34,8 +34,8 @@
34
34
  "test": "exit 0"
35
35
  },
36
36
  "dependencies": {
37
- "@twilio/flex-dev-utils": "6.3.3",
38
- "@twilio/flex-plugins-api-client": "6.3.3",
37
+ "@twilio/flex-dev-utils": "6.3.4-alpha.202404120926",
38
+ "@twilio/flex-plugins-api-client": "6.3.4-alpha.202404120926",
39
39
  "axios": "^0.24.0",
40
40
  "lodash": "4.17.21",
41
41
  "package-json": "^7.0.0",
@@ -53,5 +53,5 @@
53
53
  "publishConfig": {
54
54
  "access": "public"
55
55
  },
56
- "gitHead": "ecf939020c94968e96086761108077e16aaa0ef3"
56
+ "gitHead": "5675744bf3da43a10bee49e25b27946fb96f1ca5"
57
57
  }