@twilio/flex-plugin-e2e-tests 5.0.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.
- package/LICENSE +21 -0
- package/README.md +52 -0
- package/dist/core/index.d.ts +3 -0
- package/dist/core/index.js +16 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/parameters.d.ts +54 -0
- package/dist/core/parameters.js +95 -0
- package/dist/core/parameters.js.map +1 -0
- package/dist/core/runner.d.ts +8 -0
- package/dist/core/runner.js +313 -0
- package/dist/core/runner.js.map +1 -0
- package/dist/core/suites.d.ts +11 -0
- package/dist/core/suites.js +17 -0
- package/dist/core/suites.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/tests/step001.d.ts +3 -0
- package/dist/tests/step001.js +65 -0
- package/dist/tests/step001.js.map +1 -0
- package/dist/tests/step002.d.ts +3 -0
- package/dist/tests/step002.js +133 -0
- package/dist/tests/step002.js.map +1 -0
- package/dist/tests/step003.d.ts +3 -0
- package/dist/tests/step003.js +63 -0
- package/dist/tests/step003.js.map +1 -0
- package/dist/tests/step004.d.ts +3 -0
- package/dist/tests/step004.js +65 -0
- package/dist/tests/step004.js.map +1 -0
- package/dist/tests/step005.d.ts +3 -0
- package/dist/tests/step005.js +86 -0
- package/dist/tests/step005.js.map +1 -0
- package/dist/tests/step006.d.ts +3 -0
- package/dist/tests/step006.js +122 -0
- package/dist/tests/step006.js.map +1 -0
- package/dist/tests/step007.d.ts +3 -0
- package/dist/tests/step007.js +122 -0
- package/dist/tests/step007.js.map +1 -0
- package/dist/tests/step008.d.ts +3 -0
- package/dist/tests/step008.js +103 -0
- package/dist/tests/step008.js.map +1 -0
- package/dist/tests/step009.d.ts +3 -0
- package/dist/tests/step009.js +119 -0
- package/dist/tests/step009.js.map +1 -0
- package/dist/tests/step010.d.ts +3 -0
- package/dist/tests/step010.js +168 -0
- package/dist/tests/step010.js.map +1 -0
- package/dist/tests/step011.d.ts +3 -0
- package/dist/tests/step011.js +164 -0
- package/dist/tests/step011.js.map +1 -0
- package/dist/tests/step012.d.ts +3 -0
- package/dist/tests/step012.js +177 -0
- package/dist/tests/step012.js.map +1 -0
- package/dist/utils/assertion.d.ts +39 -0
- package/dist/utils/assertion.js +151 -0
- package/dist/utils/assertion.js.map +1 -0
- package/dist/utils/browser.d.ts +20 -0
- package/dist/utils/browser.js +142 -0
- package/dist/utils/browser.js.map +1 -0
- package/dist/utils/console-api.d.ts +43 -0
- package/dist/utils/console-api.js +154 -0
- package/dist/utils/console-api.js.map +1 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.js +35 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/pages/app.d.ts +37 -0
- package/dist/utils/pages/app.js +133 -0
- package/dist/utils/pages/app.js.map +1 -0
- package/dist/utils/pages/index.d.ts +1 -0
- package/dist/utils/pages/index.js +14 -0
- package/dist/utils/pages/index.js.map +1 -0
- package/dist/utils/pages/view/admin-dashboard.d.ts +17 -0
- package/dist/utils/pages/view/admin-dashboard.js +91 -0
- package/dist/utils/pages/view/admin-dashboard.js.map +1 -0
- package/dist/utils/pages/view/agent-desktop.d.ts +17 -0
- package/dist/utils/pages/view/agent-desktop.js +91 -0
- package/dist/utils/pages/view/agent-desktop.js.map +1 -0
- package/dist/utils/pages/view/base.d.ts +29 -0
- package/dist/utils/pages/view/base.js +124 -0
- package/dist/utils/pages/view/base.js.map +1 -0
- package/dist/utils/pages/view/plugins.d.ts +31 -0
- package/dist/utils/pages/view/plugins.js +112 -0
- package/dist/utils/pages/view/plugins.js.map +1 -0
- package/dist/utils/pages/view/twilio-console.d.ts +26 -0
- package/dist/utils/pages/view/twilio-console.js +143 -0
- package/dist/utils/pages/view/twilio-console.js.map +1 -0
- package/dist/utils/plugin-helper.d.ts +6 -0
- package/dist/utils/plugin-helper.js +131 -0
- package/dist/utils/plugin-helper.js.map +1 -0
- package/dist/utils/plugins-api.d.ts +11 -0
- package/dist/utils/plugins-api.js +195 -0
- package/dist/utils/plugins-api.js.map +1 -0
- package/dist/utils/serverless-api.d.ts +7 -0
- package/dist/utils/serverless-api.js +117 -0
- package/dist/utils/serverless-api.js.map +1 -0
- package/dist/utils/spawn.d.ts +26 -0
- package/dist/utils/spawn.js +169 -0
- package/dist/utils/spawn.js.map +1 -0
- package/dist/utils/timers.d.ts +5 -0
- package/dist/utils/timers.js +48 -0
- package/dist/utils/timers.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
var utils_1 = require("../utils");
|
|
40
|
+
// Install Twilio CLI and Plugins CLI
|
|
41
|
+
var testSuite = function (_a) {
|
|
42
|
+
var environment = _a.environment, scenario = _a.scenario;
|
|
43
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
44
|
+
var cliInstallArgs;
|
|
45
|
+
return __generator(this, function (_b) {
|
|
46
|
+
switch (_b.label) {
|
|
47
|
+
case 0:
|
|
48
|
+
cliInstallArgs = ['install', '-g', 'twilio-cli'];
|
|
49
|
+
if (!environment.ignorePrefix) {
|
|
50
|
+
cliInstallArgs.push("--prefix=" + environment.homeDir);
|
|
51
|
+
}
|
|
52
|
+
return [4 /*yield*/, utils_1.spawn('npm', cliInstallArgs)];
|
|
53
|
+
case 1:
|
|
54
|
+
_b.sent();
|
|
55
|
+
return [4 /*yield*/, utils_1.spawn('twilio', ['plugins:install', "@twilio-labs/plugin-flex@" + scenario.packageVersion])];
|
|
56
|
+
case 2:
|
|
57
|
+
_b.sent();
|
|
58
|
+
return [2 /*return*/];
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
testSuite.description = 'Installing Twilio CLI and Plugins CLI';
|
|
64
|
+
exports.default = testSuite;
|
|
65
|
+
//# sourceMappingURL=step001.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step001.js","sourceRoot":"","sources":["../../src/tests/step001.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,kCAAiC;AAEjC,qCAAqC;AACrC,IAAM,SAAS,GAAc,UAAO,EAAqC;QAAnC,WAAW,iBAAA,EAAE,QAAQ,cAAA;;;;;;oBACnD,cAAc,GAAG,CAAC,SAAS,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;oBAEvD,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE;wBAC7B,cAAc,CAAC,IAAI,CAAC,cAAY,WAAW,CAAC,OAAS,CAAC,CAAC;qBACxD;oBAED,qBAAM,aAAK,CAAC,KAAK,EAAE,cAAc,CAAC,EAAA;;oBAAlC,SAAkC,CAAC;oBAEnC,qBAAM,aAAK,CAAC,QAAQ,EAAE,CAAC,iBAAiB,EAAE,8BAA4B,QAAQ,CAAC,cAAgB,CAAC,CAAC,EAAA;;oBAAjG,SAAiG,CAAC;;;;;CACnG,CAAC;AACF,SAAS,CAAC,WAAW,GAAG,uCAAuC,CAAC;AAEhE,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
60
|
+
var utils_1 = require("../utils");
|
|
61
|
+
// Create a plugin
|
|
62
|
+
var testSuite = function (_a) {
|
|
63
|
+
var scenario = _a.scenario, config = _a.config;
|
|
64
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
65
|
+
var flags, plugin, region, appConfig;
|
|
66
|
+
return __generator(this, function (_b) {
|
|
67
|
+
switch (_b.label) {
|
|
68
|
+
case 0:
|
|
69
|
+
flags = [];
|
|
70
|
+
if (scenario.isTS) {
|
|
71
|
+
flags.push('--typescript');
|
|
72
|
+
}
|
|
73
|
+
plugin = scenario.plugins[0];
|
|
74
|
+
utils_1.assertion.not.isNull(plugin);
|
|
75
|
+
return [4 /*yield*/, utils_1.spawn('twilio', __spreadArray(['flex:plugins:create', plugin.name], __read(flags)))];
|
|
76
|
+
case 1:
|
|
77
|
+
_b.sent();
|
|
78
|
+
// Assert files/directories exist
|
|
79
|
+
utils_1.assertion.fileExists([plugin.dir], 'Plugin directory does not exist');
|
|
80
|
+
utils_1.assertion.fileExists([plugin.dir], 'Plugin directory does not exist');
|
|
81
|
+
utils_1.assertion.fileExists([plugin.dir, 'src']);
|
|
82
|
+
utils_1.assertion.fileExists([plugin.dir, 'src', 'components']);
|
|
83
|
+
utils_1.assertion.fileExists([plugin.dir, 'src', 'components', '__tests__']);
|
|
84
|
+
utils_1.assertion.not.dirIsEmpty([plugin.dir, 'src', 'components', '__tests__']);
|
|
85
|
+
utils_1.assertion.fileExists([plugin.dir, 'public']);
|
|
86
|
+
utils_1.assertion.fileExists([plugin.dir, 'package.json']);
|
|
87
|
+
utils_1.assertion.fileExists([plugin.dir, 'webpack.config.js']);
|
|
88
|
+
utils_1.assertion.fileExists([plugin.dir, 'webpack.dev.js']);
|
|
89
|
+
utils_1.assertion.fileExists([plugin.dir, 'jest.config.js']);
|
|
90
|
+
utils_1.assertion.fileExists([plugin.dir, 'public', 'appConfig.js']);
|
|
91
|
+
utils_1.assertion.fileExists([plugin.dir, 'public', 'appConfig.example.js']);
|
|
92
|
+
// Assert package.json
|
|
93
|
+
utils_1.assertion.jsonFileContains([plugin.dir, 'package.json'], "dependencies['@twilio/flex-plugin-scripts']", scenario.packageVersion);
|
|
94
|
+
utils_1.assertion.jsonFileContains([plugin.dir, 'package.json'], "dependencies['react']", "16.5.2");
|
|
95
|
+
utils_1.assertion.jsonFileContains([plugin.dir, 'package.json'], "dependencies['react-dom']", "16.5.2");
|
|
96
|
+
utils_1.assertion.jsonFileContains([plugin.dir, 'package.json'], "devDependencies['react-test-renderer']", "16.5.2");
|
|
97
|
+
region = config.region;
|
|
98
|
+
if (region) {
|
|
99
|
+
appConfig = {
|
|
100
|
+
pluginService: {
|
|
101
|
+
enabled: true,
|
|
102
|
+
url: '/plugins',
|
|
103
|
+
},
|
|
104
|
+
logLevel: 'info',
|
|
105
|
+
flexConfigServiceUrl: "https://flex-api." + region + ".twilio.com/v1/Configuration",
|
|
106
|
+
sdkOptions: {
|
|
107
|
+
chat: {
|
|
108
|
+
region: 'stage-us1',
|
|
109
|
+
},
|
|
110
|
+
worker: {
|
|
111
|
+
ebServer: "https://event-bridge." + region + "-us1.twilio.com/v1/wschannels",
|
|
112
|
+
wsServer: "wss://event-bridge." + region + "-us1.twilio.com/v1/wschannels",
|
|
113
|
+
},
|
|
114
|
+
insights: {
|
|
115
|
+
productId: 'flex_insights',
|
|
116
|
+
region: region + "-us1",
|
|
117
|
+
},
|
|
118
|
+
voice: {
|
|
119
|
+
chunderw: "chunderw-vpc-gll." + region + ".twilio.com",
|
|
120
|
+
eventgw: "eventgw." + region + ".twilio.com",
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
utils_1.writeFileSync(utils_1.joinPath(plugin.dir, 'public', 'appConfig.js'), "var appConfig = " + JSON.stringify(appConfig));
|
|
125
|
+
}
|
|
126
|
+
return [2 /*return*/];
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
testSuite.description = 'Creating a Plugin';
|
|
132
|
+
exports.default = testSuite;
|
|
133
|
+
//# sourceMappingURL=step002.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step002.js","sourceRoot":"","sources":["../../src/tests/step002.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,kCAAqE;AAErE,kBAAkB;AAClB,IAAM,SAAS,GAAc,U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AM,EAAE,WAAW;iCACpB;gCACD,MAAM,EAAE;oCACN,QAAQ,EAAE,0BAAwB,MAAM,kCAA+B;oCACvE,QAAQ,EAAE,wBAAsB,MAAM,kCAA+B;iCACtE;gCACD,QAAQ,EAAE;oCACR,SAAS,EAAE,eAAe;oCAC1B,MAAM,EAAK,MAAM,SAAM;iCACxB;gCACD,KAAK,EAAE;oCACL,QAAQ,EAAE,sBAAoB,MAAM,gBAAa;oCACjD,OAAO,EAAE,aAAW,MAAM,gBAAa;iCACxC;6BACF;yBACF,CAAC;wBAEF,qBAAa,CAAC,gBAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,QAAQ,EAAE,cAAc,CAAC,EAAE,qBAAmB,IAAI,CAAC,SAAS,CAAC,SAAS,CAAG,CAAC,CAAC;qBAC/G;;;;;CACF,CAAC;AAEF,SAAS,CAAC,WAAW,GAAG,mBAAmB,CAAC;AAE5C,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
var utils_1 = require("../utils");
|
|
40
|
+
// Install dependencies
|
|
41
|
+
var testSuite = function (_a) {
|
|
42
|
+
var scenario = _a.scenario;
|
|
43
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
44
|
+
var plugin;
|
|
45
|
+
return __generator(this, function (_b) {
|
|
46
|
+
switch (_b.label) {
|
|
47
|
+
case 0:
|
|
48
|
+
plugin = scenario.plugins[0];
|
|
49
|
+
utils_1.assertion.not.isNull(plugin);
|
|
50
|
+
return [4 /*yield*/, utils_1.spawn('npm', ['i'], { cwd: plugin.dir })];
|
|
51
|
+
case 1:
|
|
52
|
+
_b.sent();
|
|
53
|
+
utils_1.assertion.fileExists([plugin.dir, 'node_modules']);
|
|
54
|
+
utils_1.assertion.fileExists([plugin.dir, 'node_modules', '@twilio/flex-plugin-scripts']);
|
|
55
|
+
utils_1.assertion.jsonFileContains([plugin.dir, 'node_modules', '@twilio/flex-plugin-scripts', 'package.json'], 'version', scenario.packageVersion);
|
|
56
|
+
return [2 /*return*/];
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
testSuite.description = 'Running {{npm i}}';
|
|
62
|
+
exports.default = testSuite;
|
|
63
|
+
//# sourceMappingURL=step003.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step003.js","sourceRoot":"","sources":["../../src/tests/step003.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,kCAA4C;AAE5C,uBAAuB;AACvB,IAAM,SAAS,GAAc,UAAO,EAAwB;QAAtB,QAAQ,cAAA;;;;;;oBACtC,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;oBACnC,iBAAS,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;oBAE7B,qBAAM,aAAK,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,CAAC,EAAA;;oBAA9C,SAA8C,CAAC;oBAE/C,iBAAS,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC,CAAC;oBACnD,iBAAS,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,cAAc,EAAE,6BAA6B,CAAC,CAAC,CAAC;oBAClF,iBAAS,CAAC,gBAAgB,CACxB,CAAC,MAAM,CAAC,GAAG,EAAE,cAAc,EAAE,6BAA6B,EAAE,cAAc,CAAC,EAC3E,SAAS,EACT,QAAQ,CAAC,cAAc,CACxB,CAAC;;;;;CACH,CAAC;AACF,SAAS,CAAC,WAAW,GAAG,mBAAmB,CAAC;AAE5C,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
/* eslint-disable import/no-unused-modules */
|
|
40
|
+
var flex_dev_utils_1 = require("@twilio/flex-dev-utils");
|
|
41
|
+
var utils_1 = require("../utils");
|
|
42
|
+
// Run plugin tests
|
|
43
|
+
var testSuite = function (_a) {
|
|
44
|
+
var scenario = _a.scenario, environment = _a.environment;
|
|
45
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
46
|
+
return __generator(this, function (_b) {
|
|
47
|
+
switch (_b.label) {
|
|
48
|
+
case 0:
|
|
49
|
+
if (!(environment.operatingSystem === 'win32')) return [3 /*break*/, 1];
|
|
50
|
+
flex_dev_utils_1.logger.warning('Skipping [flex:plugins:test] on Win32');
|
|
51
|
+
return [3 /*break*/, 3];
|
|
52
|
+
case 1: return [4 /*yield*/, utils_1.spawn('twilio', ['flex:plugins:test', '-l', 'debug'], {
|
|
53
|
+
cwd: scenario.plugins[0].dir,
|
|
54
|
+
})];
|
|
55
|
+
case 2:
|
|
56
|
+
_b.sent();
|
|
57
|
+
_b.label = 3;
|
|
58
|
+
case 3: return [2 /*return*/];
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
testSuite.description = 'Running {{twilio flex:plugins:test}}';
|
|
64
|
+
exports.default = testSuite;
|
|
65
|
+
//# sourceMappingURL=step004.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step004.js","sourceRoot":"","sources":["../../src/tests/step004.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA6C;AAC7C,yDAAgD;AAGhD,kCAAiC;AAEjC,mBAAmB;AACnB,IAAM,SAAS,GAAc,UAAO,EAAqC;QAAnC,QAAQ,cAAA,EAAE,WAAW,iBAAA;;;;;yBAErD,CAAA,WAAW,CAAC,eAAe,KAAK,OAAO,CAAA,EAAvC,wBAAuC;oBACzC,uBAAM,CAAC,OAAO,CAAC,uCAAuC,CAAC,CAAC;;wBAExD,qBAAM,aAAK,CAAC,QAAQ,EAAE,CAAC,mBAAmB,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE;wBAC1D,GAAG,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG;qBAC7B,CAAC,EAAA;;oBAFF,SAEE,CAAC;;;;;;CAEN,CAAC;AACF,SAAS,CAAC,WAAW,GAAG,sCAAsC,CAAC;AAE/D,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
/* eslint-disable import/no-unused-modules */
|
|
40
|
+
var fs_1 = require("fs");
|
|
41
|
+
var replace_in_file_1 = require("replace-in-file");
|
|
42
|
+
var utils_1 = require("../utils");
|
|
43
|
+
// Build plugin
|
|
44
|
+
var testSuite = function (_a) {
|
|
45
|
+
var scenario = _a.scenario;
|
|
46
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
47
|
+
var plugin, ext, envVariableValue;
|
|
48
|
+
return __generator(this, function (_b) {
|
|
49
|
+
switch (_b.label) {
|
|
50
|
+
case 0:
|
|
51
|
+
plugin = scenario.plugins[0];
|
|
52
|
+
utils_1.assertion.not.isNull(plugin);
|
|
53
|
+
ext = scenario.isTS ? 'tsx' : 'jsx';
|
|
54
|
+
return [4 /*yield*/, replace_in_file_1.replaceInFile({
|
|
55
|
+
files: utils_1.joinPath(plugin.dir, 'src', 'components', 'CustomTaskList', "CustomTaskList." + ext),
|
|
56
|
+
from: /This is a dismissible demo component.*/,
|
|
57
|
+
to: plugin.componentText,
|
|
58
|
+
})];
|
|
59
|
+
case 1:
|
|
60
|
+
_b.sent();
|
|
61
|
+
envVariableValue = "" + Date.now();
|
|
62
|
+
fs_1.writeFileSync(plugin.dir + "/.env", "FLEX_APP_ENVIRONMENT_TEST=" + envVariableValue);
|
|
63
|
+
return [4 /*yield*/, replace_in_file_1.replaceInFile({
|
|
64
|
+
files: utils_1.joinPath(plugin.dir, 'src', 'components', 'CustomTaskList', "CustomTaskList." + ext),
|
|
65
|
+
from: /close.*/,
|
|
66
|
+
to: "close-{process.env.FLEX_APP_ENVIRONMENT_TEST}",
|
|
67
|
+
countMatches: true,
|
|
68
|
+
})];
|
|
69
|
+
case 2:
|
|
70
|
+
_b.sent();
|
|
71
|
+
return [4 /*yield*/, utils_1.spawn('twilio', ['flex:plugins:build', '-l', 'debug'], { cwd: plugin.dir })];
|
|
72
|
+
case 3:
|
|
73
|
+
_b.sent();
|
|
74
|
+
utils_1.assertion.not.dirIsEmpty([plugin.dir, 'build']);
|
|
75
|
+
utils_1.assertion.fileExists([plugin.dir, 'build', plugin.name + ".js"]);
|
|
76
|
+
utils_1.assertion.fileExists([plugin.dir, 'build', plugin.name + ".js.map"]);
|
|
77
|
+
utils_1.assertion.fileContains([plugin.dir, 'build', plugin.name + ".js"], plugin.componentText);
|
|
78
|
+
utils_1.assertion.fileContains([plugin.dir, 'build', plugin.name + ".js"], envVariableValue);
|
|
79
|
+
return [2 /*return*/];
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
testSuite.description = 'Running {{twilio flex:plugins:build}}';
|
|
85
|
+
exports.default = testSuite;
|
|
86
|
+
//# sourceMappingURL=step005.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step005.js","sourceRoot":"","sources":["../../src/tests/step005.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA6C;AAC7C,yBAAmC;AAEnC,mDAAgD;AAGhD,kCAAsD;AAEtD,eAAe;AACf,IAAM,SAAS,GAAc,UAAO,EAAwB;QAAtB,QAAQ,cAAA;;;;;;oBACtC,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;oBACnC,iBAAS,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;oBAEvB,GAAG,GAAG,QAAQ,C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AAC,YAAY,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,EAAK,MAAM,CAAC,IAAI,QAAK,CAAC,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;oBACzF,iBAAS,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,EAAK,MAAM,CAAC,IAAI,QAAK,CAAC,EAAE,gBAAgB,CAAC,CAAC;;;;;CACtF,CAAC;AACF,SAAS,CAAC,WAAW,GAAG,uCAAuC,CAAC;AAEhE,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,122 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
/* eslint-disable */
|
|
40
|
+
var replace_in_file_1 = require("replace-in-file");
|
|
41
|
+
var core_1 = require("../core");
|
|
42
|
+
var utils_1 = require("../utils");
|
|
43
|
+
// Plugin start
|
|
44
|
+
var testSuite = function (_a) {
|
|
45
|
+
var scenario = _a.scenario, config = _a.config, secrets = _a.secrets, environment = _a.environment;
|
|
46
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
47
|
+
var plugin, ext, tmpComponentText, twilioCliResult, consoleApi, cookies, e_1;
|
|
48
|
+
return __generator(this, function (_b) {
|
|
49
|
+
switch (_b.label) {
|
|
50
|
+
case 0:
|
|
51
|
+
plugin = scenario.plugins[0];
|
|
52
|
+
utils_1.assertion.not.isNull(plugin);
|
|
53
|
+
ext = scenario.isTS ? 'tsx' : 'jsx';
|
|
54
|
+
tmpComponentText = 'hot reload works';
|
|
55
|
+
return [4 /*yield*/, utils_1.spawn('twilio', ['flex:plugins:start', '-l', 'debug'], { detached: true, cwd: plugin.dir })];
|
|
56
|
+
case 1:
|
|
57
|
+
twilioCliResult = _b.sent();
|
|
58
|
+
return [4 /*yield*/, utils_1.pluginHelper.waitForPluginToStart(plugin.localhostUrl, core_1.testParams.config.start.timeout, core_1.testParams.config.start.pollInterval)];
|
|
59
|
+
case 2:
|
|
60
|
+
_b.sent();
|
|
61
|
+
consoleApi = new utils_1.ConsoleAPI(config.consoleBaseUrl, secrets.console);
|
|
62
|
+
return [4 /*yield*/, consoleApi.getCookies()];
|
|
63
|
+
case 3:
|
|
64
|
+
cookies = _b.sent();
|
|
65
|
+
return [4 /*yield*/, utils_1.Browser.create({ flex: plugin.localhostUrl, twilioConsole: config.consoleBaseUrl })];
|
|
66
|
+
case 4:
|
|
67
|
+
_b.sent();
|
|
68
|
+
_b.label = 5;
|
|
69
|
+
case 5:
|
|
70
|
+
_b.trys.push([5, 11, 13, 16]);
|
|
71
|
+
// Plugin loads
|
|
72
|
+
return [4 /*yield*/, utils_1.Browser.app.twilioConsole.login(cookies, 'agent-desktop', secrets.api.accountSid, config.localhostPort)];
|
|
73
|
+
case 6:
|
|
74
|
+
// Plugin loads
|
|
75
|
+
_b.sent();
|
|
76
|
+
return [4 /*yield*/, utils_1.assertion.app.view.agentDesktop.isVisible()];
|
|
77
|
+
case 7:
|
|
78
|
+
_b.sent();
|
|
79
|
+
return [4 /*yield*/, utils_1.assertion.app.view.plugins.plugin.isVisible(plugin.componentText)];
|
|
80
|
+
case 8:
|
|
81
|
+
_b.sent();
|
|
82
|
+
// Verify hot reload
|
|
83
|
+
return [4 /*yield*/, replace_in_file_1.replaceInFile({
|
|
84
|
+
files: utils_1.joinPath(plugin.dir, 'src', 'components', 'CustomTaskList', "CustomTaskList." + ext),
|
|
85
|
+
from: plugin.componentText,
|
|
86
|
+
to: tmpComponentText,
|
|
87
|
+
})];
|
|
88
|
+
case 9:
|
|
89
|
+
// Verify hot reload
|
|
90
|
+
_b.sent();
|
|
91
|
+
return [4 /*yield*/, utils_1.assertion.app.view.plugins.plugin.isVisible(tmpComponentText)];
|
|
92
|
+
case 10:
|
|
93
|
+
_b.sent();
|
|
94
|
+
return [3 /*break*/, 16];
|
|
95
|
+
case 11:
|
|
96
|
+
e_1 = _b.sent();
|
|
97
|
+
return [4 /*yield*/, utils_1.Browser.app.takeScreenshot(environment.cwd)];
|
|
98
|
+
case 12:
|
|
99
|
+
_b.sent();
|
|
100
|
+
throw e_1;
|
|
101
|
+
case 13: return [4 /*yield*/, utils_1.Browser.kill()];
|
|
102
|
+
case 14:
|
|
103
|
+
_b.sent();
|
|
104
|
+
return [4 /*yield*/, utils_1.killChildProcess(twilioCliResult.child, environment.operatingSystem)];
|
|
105
|
+
case 15:
|
|
106
|
+
_b.sent();
|
|
107
|
+
return [7 /*endfinally*/];
|
|
108
|
+
case 16: return [4 /*yield*/, replace_in_file_1.replaceInFile({
|
|
109
|
+
files: utils_1.joinPath(plugin.dir, 'src', 'components', 'CustomTaskList', "CustomTaskList." + ext),
|
|
110
|
+
from: tmpComponentText,
|
|
111
|
+
to: plugin.componentText,
|
|
112
|
+
})];
|
|
113
|
+
case 17:
|
|
114
|
+
_b.sent();
|
|
115
|
+
return [2 /*return*/];
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
testSuite.description = 'Running {{twilio flex:plugins:start}}';
|
|
121
|
+
exports.default = testSuite;
|
|
122
|
+
//# sourceMappingURL=step006.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step006.js","sourceRoot":"","sources":["../../src/tests/step006.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;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