@twilio/flex-plugin-e2e-tests 6.4.2-alpha.202406101158 → 6.4.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/tests/step006.js +1 -4
- package/dist/tests/step006.js.map +1 -1
- package/dist/tests/step007.d.ts +0 -3
- package/dist/tests/step007.js +39 -33
- package/dist/tests/step007.js.map +1 -1
- package/dist/tests/step008.js +25 -130
- package/dist/tests/step008.js.map +1 -1
- package/dist/tests/step009.js +59 -47
- package/dist/tests/step009.js.map +1 -1
- package/dist/tests/step010.js +88 -36
- package/dist/tests/step010.js.map +1 -1
- package/dist/tests/step011.js +50 -55
- package/dist/tests/step011.js.map +1 -1
- package/dist/tests/step012.js +52 -38
- package/dist/tests/step012.js.map +1 -1
- package/dist/utils/pages/view/twilio-console.d.ts +0 -1
- package/dist/utils/pages/view/twilio-console.js +10 -14
- package/dist/utils/pages/view/twilio-console.js.map +1 -1
- package/package.json +5 -5
- package/dist/tests/step013.d.ts +0 -3
- package/dist/tests/step013.js +0 -175
- package/dist/tests/step013.js.map +0 -1
package/dist/tests/step010.js
CHANGED
|
@@ -35,66 +35,115 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
36
|
}
|
|
37
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
|
+
};
|
|
38
59
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
60
|
+
/* eslint-disable import/no-unused-modules */
|
|
61
|
+
var replace_in_file_1 = require("replace-in-file");
|
|
62
|
+
var core_1 = require("../core");
|
|
39
63
|
var utils_1 = require("../utils");
|
|
40
|
-
|
|
41
|
-
var PLUGIN_RELEASED_POLL_INTERVAL = 5000;
|
|
42
|
-
// Plugin visible on the Hosted Flex
|
|
64
|
+
// Starting multiple plugins using 2 local and one remote works
|
|
43
65
|
var testSuite = function (_a) {
|
|
44
66
|
var scenario = _a.scenario, config = _a.config, secrets = _a.secrets, environment = _a.environment;
|
|
45
67
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
46
|
-
var
|
|
68
|
+
var plugin1, plugin2, plugin3, flags, ext, startPlugin, setup, twilioCliResult, e_1;
|
|
47
69
|
return __generator(this, function (_b) {
|
|
48
70
|
switch (_b.label) {
|
|
49
71
|
case 0:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
72
|
+
plugin1 = scenario.plugins[0];
|
|
73
|
+
plugin2 = scenario.plugins[1];
|
|
74
|
+
plugin3 = scenario.plugins[2];
|
|
75
|
+
utils_1.assertion.not.isNull(plugin1);
|
|
76
|
+
utils_1.assertion.not.isNull(plugin2);
|
|
77
|
+
utils_1.assertion.not.isNull(plugin3);
|
|
78
|
+
if (!plugin1.newlineValue) {
|
|
79
|
+
throw new Error('scenario.plugin.newlineValue does not have a valid value');
|
|
54
80
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
81
|
+
flags = [];
|
|
82
|
+
ext = scenario.isTS ? 'tsx' : 'jsx';
|
|
83
|
+
startPlugin = function (url) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
84
|
+
return [2 /*return*/, utils_1.pluginHelper.waitForPluginToStart(url, core_1.testParams.config.start.timeout, core_1.testParams.config.start.pollInterval)];
|
|
85
|
+
}); }); };
|
|
86
|
+
if (scenario.isTS) {
|
|
87
|
+
flags.push('--typescript');
|
|
60
88
|
}
|
|
61
|
-
return
|
|
89
|
+
setup = function (plugin) { return __awaiter(void 0, void 0, void 0, function () {
|
|
90
|
+
return __generator(this, function (_a) {
|
|
91
|
+
switch (_a.label) {
|
|
92
|
+
case 0: return [4 /*yield*/, utils_1.spawn('twilio', __spreadArray(['flex:plugins:create', plugin.name], __read(flags)))];
|
|
93
|
+
case 1:
|
|
94
|
+
_a.sent();
|
|
95
|
+
utils_1.pluginHelper.changeFlexUIVersionIfRequired(scenario, plugin);
|
|
96
|
+
return [4 /*yield*/, utils_1.spawn('npm', ['i'], { cwd: plugin.dir })];
|
|
97
|
+
case 2:
|
|
98
|
+
_a.sent();
|
|
99
|
+
return [4 /*yield*/, replace_in_file_1.replaceInFile({
|
|
100
|
+
files: utils_1.joinPath(plugin.dir, 'src', 'components', 'CustomTaskList', "CustomTaskList." + ext),
|
|
101
|
+
from: /This is a dismissible demo component.*/,
|
|
102
|
+
to: plugin.componentText,
|
|
103
|
+
})];
|
|
104
|
+
case 3:
|
|
105
|
+
_a.sent();
|
|
106
|
+
return [2 /*return*/];
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
}); };
|
|
110
|
+
// Set up two new plugins
|
|
111
|
+
return [4 /*yield*/, Promise.all([setup(plugin2), setup(plugin3)])];
|
|
112
|
+
case 1:
|
|
113
|
+
// Set up two new plugins
|
|
114
|
+
_b.sent();
|
|
115
|
+
return [4 /*yield*/, utils_1.spawn('twilio', ['flex:plugins:start', '--name', plugin1.name + "@" + plugin1.version, '--name', plugin2.name, '-l', 'debug'], { detached: true, cwd: plugin3.dir })];
|
|
62
116
|
case 2:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
if (!releasedPlugin) {
|
|
66
|
-
throw new Error("Did not find plugin with name: " + plugin.name + " in released plugins");
|
|
67
|
-
}
|
|
68
|
-
return [4 /*yield*/, utils_1.Browser.create({ flex: config.hostedFlexBaseUrl, twilioConsole: config.consoleBaseUrl })];
|
|
117
|
+
twilioCliResult = _b.sent();
|
|
118
|
+
return [4 /*yield*/, Promise.all([startPlugin(plugin2.localhostUrl), startPlugin(plugin3.localhostUrl)])];
|
|
69
119
|
case 3:
|
|
70
120
|
_b.sent();
|
|
71
121
|
_b.label = 4;
|
|
72
122
|
case 4:
|
|
73
|
-
_b.trys.push([4, 11, 13,
|
|
74
|
-
//
|
|
75
|
-
return [4 /*yield*/, utils_1.Browser.
|
|
123
|
+
_b.trys.push([4, 11, 13, 16]);
|
|
124
|
+
// Load local plugin
|
|
125
|
+
return [4 /*yield*/, utils_1.Browser.create({ flex: plugin3.localhostUrl, twilioConsole: config.consoleBaseUrl })];
|
|
76
126
|
case 5:
|
|
77
|
-
//
|
|
127
|
+
// Load local plugin
|
|
78
128
|
_b.sent();
|
|
79
|
-
return [4 /*yield*/, utils_1.
|
|
129
|
+
return [4 /*yield*/, utils_1.Browser.app.twilioConsole.login('admin', secrets.api.accountSid, config.localhostPort)];
|
|
80
130
|
case 6:
|
|
81
131
|
_b.sent();
|
|
82
|
-
|
|
132
|
+
// Check if local plugin loaded okay
|
|
133
|
+
return [4 /*yield*/, utils_1.assertion.app.view.agentDesktop.isVisible()];
|
|
83
134
|
case 7:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
return [4 /*yield*/, utils_1.pluginHelper.waitForPluginToRelease(releasedPlugin, PLUGIN_RELEASED_TIMEOUT, PLUGIN_RELEASED_POLL_INTERVAL)];
|
|
135
|
+
// Check if local plugin loaded okay
|
|
136
|
+
_b.sent();
|
|
137
|
+
return [4 /*yield*/, utils_1.assertion.app.view.plugins.plugin.isVisible(plugin1.newlineValue)];
|
|
88
138
|
case 8:
|
|
89
|
-
// Make sure that /plugins contain the plugin
|
|
90
139
|
_b.sent();
|
|
91
|
-
return [4 /*yield*/, utils_1.
|
|
140
|
+
return [4 /*yield*/, utils_1.assertion.app.view.plugins.plugin.isVisible(plugin2.componentText)];
|
|
92
141
|
case 9:
|
|
93
142
|
_b.sent();
|
|
94
|
-
return [4 /*yield*/, utils_1.assertion.app.view.plugins.plugin.isVisible(
|
|
143
|
+
return [4 /*yield*/, utils_1.assertion.app.view.plugins.plugin.isVisible(plugin3.componentText)];
|
|
95
144
|
case 10:
|
|
96
145
|
_b.sent();
|
|
97
|
-
return [3 /*break*/,
|
|
146
|
+
return [3 /*break*/, 16];
|
|
98
147
|
case 11:
|
|
99
148
|
e_1 = _b.sent();
|
|
100
149
|
return [4 /*yield*/, utils_1.Browser.app.takeScreenshot(environment.cwd)];
|
|
@@ -103,13 +152,16 @@ var testSuite = function (_a) {
|
|
|
103
152
|
throw e_1;
|
|
104
153
|
case 13: return [4 /*yield*/, utils_1.Browser.kill()];
|
|
105
154
|
case 14:
|
|
155
|
+
_b.sent();
|
|
156
|
+
return [4 /*yield*/, utils_1.killChildProcess(twilioCliResult.child, environment.operatingSystem)];
|
|
157
|
+
case 15:
|
|
106
158
|
_b.sent();
|
|
107
159
|
return [7 /*endfinally*/];
|
|
108
|
-
case
|
|
160
|
+
case 16: return [2 /*return*/];
|
|
109
161
|
}
|
|
110
162
|
});
|
|
111
163
|
});
|
|
112
164
|
};
|
|
113
|
-
testSuite.description = '
|
|
165
|
+
testSuite.description = 'Running {{twilio flex:plugins:start}} with multiple plugins: 2 local and 1 remote';
|
|
114
166
|
exports.default = testSuite;
|
|
115
167
|
//# sourceMappingURL=step010.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step010.js","sourceRoot":"","sources":["../../src/tests/step010.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"step010.js","s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;;CAE9E,CAAC;AACF,SAAS,CAAC,WAAW,GAAG,mFAAmF,CAAC;AAE5G,kBAAe,SAAS,CAAC"}
|
package/dist/tests/step011.js
CHANGED
|
@@ -56,16 +56,19 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
|
56
56
|
to[j] = from[i];
|
|
57
57
|
return to;
|
|
58
58
|
};
|
|
59
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
60
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
61
|
+
};
|
|
59
62
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
60
63
|
/* eslint-disable import/no-unused-modules */
|
|
61
|
-
var
|
|
64
|
+
var semver_1 = __importDefault(require("semver"));
|
|
62
65
|
var core_1 = require("../core");
|
|
63
66
|
var utils_1 = require("../utils");
|
|
64
|
-
// Starting multiple plugins using
|
|
67
|
+
// Starting multiple plugins using --include-remote works
|
|
65
68
|
var testSuite = function (_a) {
|
|
66
69
|
var scenario = _a.scenario, config = _a.config, secrets = _a.secrets, environment = _a.environment;
|
|
67
70
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
68
|
-
var plugin1, plugin2, plugin3,
|
|
71
|
+
var plugin1, plugin2, plugin3, resource, oldVersion, twilioCliResult, e_1;
|
|
69
72
|
return __generator(this, function (_b) {
|
|
70
73
|
switch (_b.label) {
|
|
71
74
|
case 0:
|
|
@@ -78,90 +81,82 @@ var testSuite = function (_a) {
|
|
|
78
81
|
if (!plugin1.newlineValue) {
|
|
79
82
|
throw new Error('scenario.plugin.newlineValue does not have a valid value');
|
|
80
83
|
}
|
|
81
|
-
|
|
82
|
-
ext = scenario.isTS ? 'tsx' : 'jsx';
|
|
83
|
-
startPlugin = function (url) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
84
|
-
return [2 /*return*/, utils_1.pluginHelper.waitForPluginToStart(url, core_1.testParams.config.start.timeout, core_1.testParams.config.start.pollInterval)];
|
|
85
|
-
}); }); };
|
|
86
|
-
if (scenario.isTS) {
|
|
87
|
-
flags.push('--typescript');
|
|
88
|
-
}
|
|
89
|
-
setup = function (plugin) { return __awaiter(void 0, void 0, void 0, function () {
|
|
90
|
-
return __generator(this, function (_a) {
|
|
91
|
-
switch (_a.label) {
|
|
92
|
-
case 0: return [4 /*yield*/, utils_1.spawn('twilio', __spreadArray(['flex:plugins:create', plugin.name], __read(flags)))];
|
|
93
|
-
case 1:
|
|
94
|
-
_a.sent();
|
|
95
|
-
utils_1.pluginHelper.changeFlexUIVersionIfRequired(scenario, plugin);
|
|
96
|
-
return [4 /*yield*/, utils_1.spawn('npm', ['i'], { cwd: plugin.dir })];
|
|
97
|
-
case 2:
|
|
98
|
-
_a.sent();
|
|
99
|
-
return [4 /*yield*/, replace_in_file_1.replaceInFile({
|
|
100
|
-
files: utils_1.joinPath(plugin.dir, 'src', 'components', 'CustomTaskList', "CustomTaskList." + ext),
|
|
101
|
-
from: /This is a dismissible demo component.*/,
|
|
102
|
-
to: plugin.componentText,
|
|
103
|
-
})];
|
|
104
|
-
case 3:
|
|
105
|
-
_a.sent();
|
|
106
|
-
return [2 /*return*/];
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
}); };
|
|
110
|
-
// Set up two new plugins
|
|
111
|
-
return [4 /*yield*/, Promise.all([setup(plugin2), setup(plugin3)])];
|
|
84
|
+
return [4 /*yield*/, utils_1.api.getLatestPluginVersion(plugin2.name)];
|
|
112
85
|
case 1:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
86
|
+
resource = _b.sent();
|
|
87
|
+
oldVersion = (resource === null || resource === void 0 ? void 0 : resource.version) || '0.0.0';
|
|
88
|
+
plugin2.changelog = "e2e test " + Date.now();
|
|
89
|
+
plugin2.version = semver_1.default.inc(oldVersion, 'patch');
|
|
90
|
+
return [4 /*yield*/, utils_1.spawn('twilio', __spreadArray(['flex:plugins:deploy', '--changelog', "\"" + plugin2.changelog + "\"", '--patch', '-l', 'debug'], __read(config.regionFlag)), {
|
|
91
|
+
cwd: plugin2.dir,
|
|
92
|
+
})];
|
|
116
93
|
case 2:
|
|
117
|
-
|
|
118
|
-
|
|
94
|
+
_b.sent();
|
|
95
|
+
// Release plugin2
|
|
96
|
+
return [4 /*yield*/, utils_1.spawn('twilio', __spreadArray([
|
|
97
|
+
'flex:plugins:release',
|
|
98
|
+
'--plugin',
|
|
99
|
+
plugin2.name + "@" + plugin2.version,
|
|
100
|
+
'-l',
|
|
101
|
+
'debug'
|
|
102
|
+
], __read(config.regionFlag)))];
|
|
119
103
|
case 3:
|
|
104
|
+
// Release plugin2
|
|
120
105
|
_b.sent();
|
|
121
|
-
|
|
106
|
+
return [4 /*yield*/, utils_1.spawn('twilio', ['flex:plugins:start --include-remote'], {
|
|
107
|
+
detached: true,
|
|
108
|
+
cwd: plugin3.dir,
|
|
109
|
+
})];
|
|
122
110
|
case 4:
|
|
123
|
-
_b.
|
|
111
|
+
twilioCliResult = _b.sent();
|
|
112
|
+
return [4 /*yield*/, utils_1.pluginHelper.waitForPluginToStart(plugin3.localhostUrl, core_1.testParams.config.start.timeout, core_1.testParams.config.start.pollInterval)];
|
|
113
|
+
case 5:
|
|
114
|
+
_b.sent();
|
|
115
|
+
_b.label = 6;
|
|
116
|
+
case 6:
|
|
117
|
+
_b.trys.push([6, 13, 15, 18]);
|
|
124
118
|
// Load local plugin
|
|
125
119
|
return [4 /*yield*/, utils_1.Browser.create({ flex: plugin3.localhostUrl, twilioConsole: config.consoleBaseUrl })];
|
|
126
|
-
case
|
|
120
|
+
case 7:
|
|
127
121
|
// Load local plugin
|
|
128
122
|
_b.sent();
|
|
129
123
|
return [4 /*yield*/, utils_1.Browser.app.twilioConsole.login('admin', secrets.api.accountSid, config.localhostPort)];
|
|
130
|
-
case
|
|
124
|
+
case 8:
|
|
131
125
|
_b.sent();
|
|
132
126
|
// Check if local plugin loaded okay
|
|
133
127
|
return [4 /*yield*/, utils_1.assertion.app.view.agentDesktop.isVisible()];
|
|
134
|
-
case
|
|
128
|
+
case 9:
|
|
135
129
|
// Check if local plugin loaded okay
|
|
136
130
|
_b.sent();
|
|
137
131
|
return [4 /*yield*/, utils_1.assertion.app.view.plugins.plugin.isVisible(plugin1.newlineValue)];
|
|
138
|
-
case
|
|
132
|
+
case 10:
|
|
139
133
|
_b.sent();
|
|
140
134
|
return [4 /*yield*/, utils_1.assertion.app.view.plugins.plugin.isVisible(plugin2.componentText)];
|
|
141
|
-
case
|
|
135
|
+
case 11:
|
|
142
136
|
_b.sent();
|
|
143
137
|
return [4 /*yield*/, utils_1.assertion.app.view.plugins.plugin.isVisible(plugin3.componentText)];
|
|
144
|
-
case
|
|
138
|
+
case 12:
|
|
145
139
|
_b.sent();
|
|
146
|
-
return [3 /*break*/,
|
|
147
|
-
case
|
|
140
|
+
return [3 /*break*/, 18];
|
|
141
|
+
case 13:
|
|
148
142
|
e_1 = _b.sent();
|
|
149
143
|
return [4 /*yield*/, utils_1.Browser.app.takeScreenshot(environment.cwd)];
|
|
150
|
-
case
|
|
144
|
+
case 14:
|
|
151
145
|
_b.sent();
|
|
152
146
|
throw e_1;
|
|
153
|
-
case
|
|
154
|
-
case
|
|
147
|
+
case 15: return [4 /*yield*/, utils_1.Browser.kill()];
|
|
148
|
+
case 16:
|
|
155
149
|
_b.sent();
|
|
156
150
|
return [4 /*yield*/, utils_1.killChildProcess(twilioCliResult.child, environment.operatingSystem)];
|
|
157
|
-
case
|
|
151
|
+
case 17:
|
|
158
152
|
_b.sent();
|
|
159
153
|
return [7 /*endfinally*/];
|
|
160
|
-
case
|
|
154
|
+
case 18: return [2 /*return*/];
|
|
161
155
|
}
|
|
162
156
|
});
|
|
163
157
|
});
|
|
164
158
|
};
|
|
165
|
-
testSuite.description =
|
|
159
|
+
testSuite.description =
|
|
160
|
+
'Running {{twilio flex:plugins:start --include-remote}} with 1 local plugin and all remote plugins';
|
|
166
161
|
exports.default = testSuite;
|
|
167
162
|
//# sourceMappingURL=step011.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step011.js","sourceRoot":"","sources":["../../src/tests/step011.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"step011.js","sourceRoot":"","sources":["../../src/tests/step011.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA6C;AAC7C,kDAA4B;AAE5B,gCAA4D;AAC5D,kCAA0F;AAE1F,yDAAyD;AACzD,IAAM,SAAS,GAAc,UAAO,EAAsD;QAApD,QAAQ,cAAA,EAAE,MAAM,YAAA,EAAE,OAAO,aAAA,EAAE,WAAW,iBAAA;;;;;;oBACpE,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;oBAE9B,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE;wBACzB,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;qBAC7E;oBAGgB,qBAAM,WAAG,CAAC,sBAAsB,CAAC,OAAO,CAAC,IAAI,CAAC,EAAA;;oBAAzD,QAAQ,GAAG,SAA8C;oBACzD,UAAU,GAAG,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,OAAO,KAAI,OAAO,CAAC;oBAChD,OAAO,CAAC,SAAS,GAAG,cAAY,IAAI,CAAC,GAAG,EAAI,CAAC;oBAC7C,OAAO,CAAC,OAAO,GAAG,gBAAM,CAAC,GAAG,CAAC,UAA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qBAAM,iBAAS,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,EAAA;;oBADjD,oCAAoC;oBACpC,SAAiD,CAAC;oBAElD,qBAAM,iBAAS,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,YAAY,CAAC,EAAA;;oBAAvE,SAAuE,CAAC;oBACxE,qBAAM,iBAAS,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,aAAa,CAAC,EAAA;;oBAAxE,SAAwE,CAAC;oBACzE,qBAAM,iBAAS,CAAC,GAAG,CAAC,IAAI,CAAC,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;AACF,SAAS,CAAC,WAAW;IACnB,mGAAmG,CAAC;AAEtG,kBAAe,SAAS,CAAC"}
|
package/dist/tests/step012.js
CHANGED
|
@@ -61,102 +61,116 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
61
61
|
};
|
|
62
62
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
63
63
|
/* eslint-disable import/no-unused-modules */
|
|
64
|
+
var replace_in_file_1 = require("replace-in-file");
|
|
64
65
|
var semver_1 = __importDefault(require("semver"));
|
|
65
66
|
var core_1 = require("../core");
|
|
66
67
|
var utils_1 = require("../utils");
|
|
67
|
-
//
|
|
68
|
+
// Start the 2 local plugins and 1 versioned plugin
|
|
68
69
|
var testSuite = function (_a) {
|
|
69
70
|
var scenario = _a.scenario, config = _a.config, secrets = _a.secrets, environment = _a.environment;
|
|
70
71
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
71
|
-
var plugin1, plugin2, plugin3, resource, oldVersion, twilioCliResult, e_1;
|
|
72
|
+
var ext, tmpComponentText, startPlugin, plugin1, plugin2, plugin3, resource, oldVersion, flags, twilioCliResult, e_1;
|
|
72
73
|
return __generator(this, function (_b) {
|
|
73
74
|
switch (_b.label) {
|
|
74
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
|
+
}); }); };
|
|
75
81
|
plugin1 = scenario.plugins[0];
|
|
76
82
|
plugin2 = scenario.plugins[1];
|
|
77
83
|
plugin3 = scenario.plugins[2];
|
|
78
84
|
utils_1.assertion.not.isNull(plugin1);
|
|
79
85
|
utils_1.assertion.not.isNull(plugin2);
|
|
80
86
|
utils_1.assertion.not.isNull(plugin3);
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
+
})];
|
|
85
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:
|
|
86
99
|
resource = _b.sent();
|
|
87
100
|
oldVersion = (resource === null || resource === void 0 ? void 0 : resource.version) || '0.0.0';
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
cwd: plugin2.dir,
|
|
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,
|
|
92
104
|
})];
|
|
93
|
-
case
|
|
105
|
+
case 3:
|
|
94
106
|
_b.sent();
|
|
95
|
-
// Release
|
|
107
|
+
// Release the edited plugin
|
|
96
108
|
return [4 /*yield*/, utils_1.spawn('twilio', __spreadArray([
|
|
97
109
|
'flex:plugins:release',
|
|
98
110
|
'--plugin',
|
|
99
|
-
plugin2.name + "@" + plugin2.version,
|
|
100
111
|
'-l',
|
|
101
|
-
'debug'
|
|
112
|
+
'debug',
|
|
113
|
+
plugin1.name + "@" + plugin1.version
|
|
102
114
|
], __read(config.regionFlag)))];
|
|
103
|
-
case
|
|
104
|
-
// Release
|
|
115
|
+
case 4:
|
|
116
|
+
// Release the edited plugin
|
|
105
117
|
_b.sent();
|
|
106
|
-
|
|
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)), {
|
|
107
120
|
detached: true,
|
|
108
121
|
cwd: plugin3.dir,
|
|
109
122
|
})];
|
|
110
|
-
case 4:
|
|
111
|
-
twilioCliResult = _b.sent();
|
|
112
|
-
return [4 /*yield*/, utils_1.pluginHelper.waitForPluginToStart(plugin3.localhostUrl, core_1.testParams.config.start.timeout, core_1.testParams.config.start.pollInterval)];
|
|
113
123
|
case 5:
|
|
114
|
-
_b.sent();
|
|
115
|
-
|
|
124
|
+
twilioCliResult = _b.sent();
|
|
125
|
+
return [4 /*yield*/, Promise.all([startPlugin(plugin2.localhostUrl), startPlugin(plugin3.localhostUrl)])];
|
|
116
126
|
case 6:
|
|
117
|
-
_b.
|
|
127
|
+
_b.sent();
|
|
128
|
+
_b.label = 7;
|
|
129
|
+
case 7:
|
|
130
|
+
_b.trys.push([7, 14, 16, 19]);
|
|
118
131
|
// Load local plugin
|
|
119
132
|
return [4 /*yield*/, utils_1.Browser.create({ flex: plugin3.localhostUrl, twilioConsole: config.consoleBaseUrl })];
|
|
120
|
-
case
|
|
133
|
+
case 8:
|
|
121
134
|
// Load local plugin
|
|
122
135
|
_b.sent();
|
|
123
136
|
return [4 /*yield*/, utils_1.Browser.app.twilioConsole.login('admin', secrets.api.accountSid, config.localhostPort)];
|
|
124
|
-
case
|
|
137
|
+
case 9:
|
|
125
138
|
_b.sent();
|
|
126
139
|
// Check if local plugin loaded okay
|
|
127
140
|
return [4 /*yield*/, utils_1.assertion.app.view.agentDesktop.isVisible()];
|
|
128
|
-
case
|
|
141
|
+
case 10:
|
|
129
142
|
// Check if local plugin loaded okay
|
|
130
143
|
_b.sent();
|
|
144
|
+
// @ts-ignore
|
|
131
145
|
return [4 /*yield*/, utils_1.assertion.app.view.plugins.plugin.isVisible(plugin1.newlineValue)];
|
|
132
|
-
case 10:
|
|
133
|
-
_b.sent();
|
|
134
|
-
return [4 /*yield*/, utils_1.assertion.app.view.plugins.plugin.isVisible(plugin2.componentText)];
|
|
135
146
|
case 11:
|
|
147
|
+
// @ts-ignore
|
|
136
148
|
_b.sent();
|
|
137
|
-
return [4 /*yield*/, utils_1.assertion.app.view.plugins.plugin.isVisible(
|
|
149
|
+
return [4 /*yield*/, utils_1.assertion.app.view.plugins.plugin.isVisible(plugin2.componentText)];
|
|
138
150
|
case 12:
|
|
139
151
|
_b.sent();
|
|
140
|
-
return [
|
|
152
|
+
return [4 /*yield*/, utils_1.assertion.app.view.plugins.plugin.isVisible(plugin3.componentText)];
|
|
141
153
|
case 13:
|
|
154
|
+
_b.sent();
|
|
155
|
+
return [3 /*break*/, 19];
|
|
156
|
+
case 14:
|
|
142
157
|
e_1 = _b.sent();
|
|
143
158
|
return [4 /*yield*/, utils_1.Browser.app.takeScreenshot(environment.cwd)];
|
|
144
|
-
case
|
|
159
|
+
case 15:
|
|
145
160
|
_b.sent();
|
|
146
161
|
throw e_1;
|
|
147
|
-
case
|
|
148
|
-
case
|
|
162
|
+
case 16: return [4 /*yield*/, utils_1.Browser.kill()];
|
|
163
|
+
case 17:
|
|
149
164
|
_b.sent();
|
|
150
165
|
return [4 /*yield*/, utils_1.killChildProcess(twilioCliResult.child, environment.operatingSystem)];
|
|
151
|
-
case
|
|
166
|
+
case 18:
|
|
152
167
|
_b.sent();
|
|
153
168
|
return [7 /*endfinally*/];
|
|
154
|
-
case
|
|
169
|
+
case 19: return [2 /*return*/];
|
|
155
170
|
}
|
|
156
171
|
});
|
|
157
172
|
});
|
|
158
173
|
};
|
|
159
|
-
testSuite.description =
|
|
160
|
-
'Running {{twilio flex:plugins:start --include-remote}} with 1 local plugin and all remote plugins';
|
|
174
|
+
testSuite.description = 'Running {{twilio flex:plugins:start}} with multiple plugins: 2 local and 1 versioned';
|
|
161
175
|
exports.default = testSuite;
|
|
162
176
|
//# sourceMappingURL=step012.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step012.js","sourceRoot":"","sources":["../../src/tests/step012.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA6C;AAC7C,kDAA4B;AAE5B,gCAA4D;AAC5D,
|
|
1
|
+
{"version":3,"file":"step012.js","sourceRoot":"","sources":["../../src/tests/step012.ts"],"names":[],"mappings":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,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"}
|
|
@@ -52,8 +52,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
52
52
|
};
|
|
53
53
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
54
|
exports.TwilioConsole = void 0;
|
|
55
|
-
var core_1 = require("../../../core");
|
|
56
55
|
var base_1 = require("./base");
|
|
56
|
+
var core_1 = require("../../../core");
|
|
57
57
|
var timers_1 = require("../../timers");
|
|
58
58
|
var TwilioConsole = /** @class */ (function (_super) {
|
|
59
59
|
__extends(TwilioConsole, _super);
|
|
@@ -67,7 +67,6 @@ var TwilioConsole = /** @class */ (function (_super) {
|
|
|
67
67
|
}
|
|
68
68
|
/**
|
|
69
69
|
* Logs user in through service-login
|
|
70
|
-
* @param cookies
|
|
71
70
|
* @param flexBaseUrl
|
|
72
71
|
* @param flexPath
|
|
73
72
|
* @param accountSid
|
|
@@ -86,17 +85,14 @@ var TwilioConsole = /** @class */ (function (_super) {
|
|
|
86
85
|
return [4 /*yield*/, this.goto({ baseUrl: this._baseUrl, path: path })];
|
|
87
86
|
case 1:
|
|
88
87
|
_a.sent();
|
|
89
|
-
if (!firstLoad) return [3 /*break*/,
|
|
90
|
-
return [4 /*yield*/, this.elementVisible(TwilioConsole._loginForm, "Twilio Console's Login form")];
|
|
91
|
-
case 2:
|
|
92
|
-
_a.sent();
|
|
88
|
+
if (!firstLoad) return [3 /*break*/, 7];
|
|
93
89
|
return [4 /*yield*/, this.page.evaluate(function () {
|
|
94
90
|
var _a;
|
|
95
91
|
return (_a = document.head.querySelector('meta[name="csrfToken"]')) === null || _a === void 0 ? void 0 : _a.getAttribute('content');
|
|
96
92
|
})];
|
|
97
|
-
case
|
|
93
|
+
case 2:
|
|
98
94
|
csrfToken = _a.sent();
|
|
99
|
-
if (!csrfToken) return [3 /*break*/,
|
|
95
|
+
if (!csrfToken) return [3 /*break*/, 6];
|
|
100
96
|
loginURL = this._baseUrl + "/userauth/submitLoginPassword";
|
|
101
97
|
return [4 /*yield*/, this.page.evaluate(
|
|
102
98
|
// eslint-disable-next-line @typescript-eslint/promise-function-async
|
|
@@ -118,19 +114,19 @@ var TwilioConsole = /** @class */ (function (_super) {
|
|
|
118
114
|
password: core_1.testParams.secrets.console.password,
|
|
119
115
|
csrfToken: csrfToken,
|
|
120
116
|
})];
|
|
121
|
-
case
|
|
117
|
+
case 3:
|
|
122
118
|
_a.sent();
|
|
123
119
|
// Log in Flex via service login
|
|
124
120
|
return [4 /*yield*/, this.goto({ baseUrl: this._baseUrl, path: path })];
|
|
125
|
-
case
|
|
121
|
+
case 4:
|
|
126
122
|
// Log in Flex via service login
|
|
127
123
|
_a.sent();
|
|
128
124
|
return [4 /*yield*/, timers_1.sleep(30000)];
|
|
129
|
-
case
|
|
125
|
+
case 5:
|
|
130
126
|
_a.sent();
|
|
131
|
-
return [3 /*break*/,
|
|
132
|
-
case
|
|
133
|
-
case
|
|
127
|
+
return [3 /*break*/, 7];
|
|
128
|
+
case 6: throw new Error('Unable to fetch CSRF token to login to Twilio Console');
|
|
129
|
+
case 7: return [2 /*return*/];
|
|
134
130
|
}
|
|
135
131
|
});
|
|
136
132
|
});
|