@twilio/flex-plugin-e2e-tests 6.3.3-alpha.202403191805 → 6.3.3-alpha.202404010631
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/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 -109
- 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.d.ts +7 -1
- package/dist/tests/step010.js +121 -39
- package/dist/tests/step010.js.map +1 -1
- package/dist/tests/step011.d.ts +1 -7
- package/dist/tests/step011.js +53 -82
- package/dist/tests/step011.js.map +1 -1
- package/dist/tests/step012.js +54 -41
- package/dist/tests/step012.js.map +1 -1
- package/package.json +5 -5
- package/dist/tests/step013.d.ts +0 -3
- package/dist/tests/step013.js +0 -181
- package/dist/tests/step013.js.map +0 -1
package/dist/tests/step007.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import { TestSuite } from '../core';
|
|
2
|
-
export declare const originalCode = "const [isOpen, setIsOpen] = useState(true);";
|
|
3
|
-
export declare const codeWithViolation = "const config = {\n colorTheme: {\n baseLight: \"white\",\n },\n sdkOptions: {\n voice: {\n iceServers: [],\n },\n },\n };\n const [isOpen, setIsOpen] = useState(true);";
|
|
4
|
-
export declare const WARNING_REGEX: RegExp;
|
|
5
2
|
declare const testSuite: TestSuite;
|
|
6
3
|
export default testSuite;
|
package/dist/tests/step007.js
CHANGED
|
@@ -56,61 +56,67 @@ 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
|
-
exports.WARNING_REGEX = exports.codeWithViolation = exports.originalCode = void 0;
|
|
61
63
|
/* eslint-disable import/no-unused-modules */
|
|
62
64
|
var replace_in_file_1 = require("replace-in-file");
|
|
63
|
-
var
|
|
65
|
+
var semver_1 = __importDefault(require("semver"));
|
|
64
66
|
var utils_1 = require("../utils");
|
|
65
|
-
|
|
66
|
-
exports.codeWithViolation = "const config = {\n colorTheme: {\n baseLight: \"white\",\n },\n sdkOptions: {\n voice: {\n iceServers: [],\n },\n },\n };\n const [isOpen, setIsOpen] = useState(true);";
|
|
67
|
-
exports.WARNING_REGEX = /(Warning:)/;
|
|
68
|
-
// Validate plugin
|
|
67
|
+
// Deploy plugin
|
|
69
68
|
var testSuite = function (_a) {
|
|
70
69
|
var scenario = _a.scenario, config = _a.config;
|
|
71
70
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
72
|
-
var plugin, ext, result,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
switch (_d.label) {
|
|
71
|
+
var plugin, ext, resource, result, apiPlugin, pluginVersion, latest;
|
|
72
|
+
return __generator(this, function (_b) {
|
|
73
|
+
switch (_b.label) {
|
|
76
74
|
case 0:
|
|
77
75
|
plugin = scenario.plugins[0];
|
|
76
|
+
utils_1.assertion.not.isNull(plugin);
|
|
78
77
|
ext = scenario.isTS ? 'tsx' : 'jsx';
|
|
78
|
+
plugin.newlineValue = "This is a dismissible demo component " + Date.now();
|
|
79
|
+
plugin.changelog = "e2e test " + Date.now();
|
|
79
80
|
return [4 /*yield*/, replace_in_file_1.replaceInFile({
|
|
80
81
|
files: utils_1.joinPath(plugin.dir, 'src', 'components', 'CustomTaskList', "CustomTaskList." + ext),
|
|
81
|
-
from:
|
|
82
|
-
to:
|
|
82
|
+
from: /This is a dismissible demo component.*/,
|
|
83
|
+
to: plugin.newlineValue,
|
|
83
84
|
})];
|
|
84
85
|
case 1:
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
return [4 /*yield*/, utils_1.spawn('twilio', __spreadArray(['flex:plugins:validate', '-l', 'debug'], __read(config.regionFlag)), {
|
|
88
|
-
cwd: plugin.dir,
|
|
89
|
-
})];
|
|
86
|
+
_b.sent();
|
|
87
|
+
return [4 /*yield*/, utils_1.api.getLatestPluginVersion(plugin.name)];
|
|
90
88
|
case 2:
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
utils_1.
|
|
94
|
-
return [4 /*yield*/, replace_in_file_1.replaceInFile({
|
|
95
|
-
files: utils_1.joinPath(plugin.dir, 'src', 'components', 'CustomTaskList', "CustomTaskList." + ext),
|
|
96
|
-
from: exports.codeWithViolation,
|
|
97
|
-
to: exports.originalCode,
|
|
98
|
-
})];
|
|
99
|
-
case 3:
|
|
100
|
-
_d.sent();
|
|
101
|
-
flex_dev_utils_1.logger.info('Running {{twilio flex:plugins:validate}} on a plugin with 0 validation issues');
|
|
102
|
-
return [4 /*yield*/, utils_1.spawn('twilio', __spreadArray(['flex:plugins:validate', '-l', 'debug'], __read(config.regionFlag)), {
|
|
89
|
+
resource = _b.sent();
|
|
90
|
+
plugin.version = semver_1.default.inc((resource === null || resource === void 0 ? void 0 : resource.version) || '0.0.0', 'patch');
|
|
91
|
+
return [4 /*yield*/, utils_1.spawn('twilio', __spreadArray(['flex:plugins:deploy', '--changelog', "\"" + plugin.changelog + "\"", '--patch', '-l', 'debug'], __read(config.regionFlag)), {
|
|
103
92
|
cwd: plugin.dir,
|
|
104
93
|
})];
|
|
94
|
+
case 3:
|
|
95
|
+
result = _b.sent();
|
|
96
|
+
utils_1.assertion.fileExists([plugin.dir, 'build', plugin.name + ".js"]);
|
|
97
|
+
utils_1.assertion.fileContains([plugin.dir, 'build', plugin.name + ".js"], plugin.newlineValue);
|
|
98
|
+
utils_1.assertion.jsonFileContains([plugin.dir, 'package.json'], 'version', plugin.version);
|
|
99
|
+
utils_1.assertion.stringContains(result.stdout, 'Next Steps');
|
|
100
|
+
utils_1.assertion.stringContains(result.stdout, 'twilio flex:plugins:release');
|
|
101
|
+
utils_1.assertion.stringContains(result.stdout, plugin.name);
|
|
102
|
+
return [4 /*yield*/, utils_1.api.getPlugin(plugin.name)];
|
|
105
103
|
case 4:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
104
|
+
apiPlugin = _b.sent();
|
|
105
|
+
return [4 /*yield*/, utils_1.api.getPluginVersion(plugin.name, plugin.version)];
|
|
106
|
+
case 5:
|
|
107
|
+
pluginVersion = _b.sent();
|
|
108
|
+
return [4 /*yield*/, utils_1.api.getLatestPluginVersion(plugin.name)];
|
|
109
|
+
case 6:
|
|
110
|
+
latest = _b.sent();
|
|
111
|
+
utils_1.assertion.equal(apiPlugin.unique_name, plugin.name);
|
|
112
|
+
utils_1.assertion.equal(pluginVersion.version, plugin.version);
|
|
113
|
+
utils_1.assertion.equal(pluginVersion.changelog, plugin.changelog);
|
|
114
|
+
utils_1.assertion.equal(pluginVersion, latest);
|
|
109
115
|
return [2 /*return*/];
|
|
110
116
|
}
|
|
111
117
|
});
|
|
112
118
|
});
|
|
113
119
|
};
|
|
114
|
-
testSuite.description = 'Running {{twilio flex:plugins:
|
|
120
|
+
testSuite.description = 'Running {{twilio flex:plugins:deploy}}';
|
|
115
121
|
exports.default = testSuite;
|
|
116
122
|
//# sourceMappingURL=step007.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step007.js","sourceRoot":"","sources":["../../src/tests/step007.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"step007.js","sourceRoot":"","sources":["../../src/tests/step007.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA6C;AAC7C,mDAAgD;AAChD,kDAA4B;AAE5B,kCAA2D;AAG3D,gBAAgB;AAChB,IAAM,SAAS,GAAc,UAAO,EAAgC;QAA9B,QAAQ,cAAA,EAAE,MAAM,YAAA;;;;;;oBAC9C,MAAM,GAAG,QAAQ,CAAC,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131 +57,47 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
|
57
57
|
return to;
|
|
58
58
|
};
|
|
59
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 flex_dev_utils_1 = require("@twilio/flex-dev-utils");
|
|
60
|
+
/* eslint-disable import/no-unused-modules, @typescript-eslint/no-non-null-assertion */
|
|
63
61
|
var utils_1 = require("../utils");
|
|
64
|
-
|
|
65
|
-
// Deploy plugin
|
|
62
|
+
// Release plugin
|
|
66
63
|
var testSuite = function (_a) {
|
|
67
64
|
var scenario = _a.scenario, config = _a.config;
|
|
68
65
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
69
|
-
var plugin,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
switch (_e.label) {
|
|
66
|
+
var plugin, result, release, plugins;
|
|
67
|
+
return __generator(this, function (_b) {
|
|
68
|
+
switch (_b.label) {
|
|
73
69
|
case 0:
|
|
74
70
|
plugin = scenario.plugins[0];
|
|
75
71
|
utils_1.assertion.not.isNull(plugin);
|
|
76
|
-
ext = scenario.isTS ? 'tsx' : 'jsx';
|
|
77
|
-
plugin.newlineValue = "This is a dismissible demo component " + Date.now();
|
|
78
|
-
plugin.changelog = "e2e test " + Date.now();
|
|
79
|
-
return [4 /*yield*/, replace_in_file_1.replaceInFile({
|
|
80
|
-
files: utils_1.joinPath(plugin.dir, 'src', 'components', 'CustomTaskList', "CustomTaskList." + ext),
|
|
81
|
-
from: /This is a dismissible demo component.*/,
|
|
82
|
-
to: plugin.newlineValue,
|
|
83
|
-
})];
|
|
84
|
-
case 1:
|
|
85
|
-
_e.sent();
|
|
86
|
-
// Deploy with validation errors in the plugin with option fix
|
|
87
|
-
return [4 /*yield*/, replace_in_file_1.replaceInFile({
|
|
88
|
-
files: utils_1.joinPath(plugin.dir, 'src', 'components', 'CustomTaskList', "CustomTaskList." + ext),
|
|
89
|
-
from: step007_1.originalCode,
|
|
90
|
-
to: step007_1.codeWithViolation,
|
|
91
|
-
})];
|
|
92
|
-
case 2:
|
|
93
|
-
// Deploy with validation errors in the plugin with option fix
|
|
94
|
-
_e.sent();
|
|
95
|
-
flex_dev_utils_1.logger.info('Running {{flex:plugins:deploy}} with --option {{fix}}');
|
|
96
72
|
return [4 /*yield*/, utils_1.spawn('twilio', __spreadArray([
|
|
97
|
-
'flex:plugins:
|
|
98
|
-
'--
|
|
99
|
-
"
|
|
100
|
-
'--patch',
|
|
101
|
-
'--option',
|
|
102
|
-
'fix',
|
|
73
|
+
'flex:plugins:release',
|
|
74
|
+
'--plugin',
|
|
75
|
+
plugin.name + "@" + plugin.version,
|
|
103
76
|
'-l',
|
|
104
77
|
'debug'
|
|
105
|
-
], __read(config.regionFlag))
|
|
106
|
-
|
|
107
|
-
|
|
78
|
+
], __read(config.regionFlag)))];
|
|
79
|
+
case 1:
|
|
80
|
+
result = _b.sent();
|
|
81
|
+
return [4 /*yield*/, utils_1.sleep(1000)];
|
|
82
|
+
case 2:
|
|
83
|
+
_b.sent();
|
|
84
|
+
return [4 /*yield*/, utils_1.api.getActiveRelease()];
|
|
108
85
|
case 3:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
// Should display violations
|
|
112
|
-
utils_1.assertion.equal(noWarnings, 2);
|
|
113
|
-
// Should not deploy the plugin
|
|
114
|
-
utils_1.assertion.not.stringContains(result.stdout, 'Next Steps');
|
|
115
|
-
utils_1.assertion.not.stringContains(result.stdout, 'twilio flex:plugins:release');
|
|
116
|
-
// Deploy with validation errors in the plugin with option deploy
|
|
117
|
-
flex_dev_utils_1.logger.info('Running {{flex:plugins:deploy}} with --option {{deploy}}');
|
|
118
|
-
return [4 /*yield*/, utils_1.spawn('twilio', __spreadArray([
|
|
119
|
-
'flex:plugins:deploy',
|
|
120
|
-
'--changelog',
|
|
121
|
-
"\"" + plugin.changelog + "\"",
|
|
122
|
-
'--patch',
|
|
123
|
-
'--option',
|
|
124
|
-
'deploy',
|
|
125
|
-
'-l',
|
|
126
|
-
'debug'
|
|
127
|
-
], __read(config.regionFlag)), {
|
|
128
|
-
cwd: plugin.dir,
|
|
129
|
-
})];
|
|
86
|
+
release = _b.sent();
|
|
87
|
+
return [4 /*yield*/, utils_1.api.getActivePlugins(release.configuration_sid)];
|
|
130
88
|
case 4:
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
utils_1.assertion.
|
|
135
|
-
|
|
136
|
-
utils_1.assertion.
|
|
137
|
-
utils_1.assertion.
|
|
138
|
-
// Deploy without validation errors in the plugin
|
|
139
|
-
return [4 /*yield*/, replace_in_file_1.replaceInFile({
|
|
140
|
-
files: utils_1.joinPath(plugin.dir, 'src', 'components', 'CustomTaskList', "CustomTaskList." + ext),
|
|
141
|
-
from: step007_1.codeWithViolation,
|
|
142
|
-
to: step007_1.originalCode,
|
|
143
|
-
})];
|
|
144
|
-
case 5:
|
|
145
|
-
// Deploy without validation errors in the plugin
|
|
146
|
-
_e.sent();
|
|
147
|
-
flex_dev_utils_1.logger.info('Running {{flex:plugins:deploy}} on a plugin with 0 valdiation issues');
|
|
148
|
-
return [4 /*yield*/, utils_1.spawn('twilio', __spreadArray(['flex:plugins:deploy', '--changelog', "\"" + plugin.changelog + "\"", '--patch', '-l', 'debug'], __read(config.regionFlag)), {
|
|
149
|
-
cwd: plugin.dir,
|
|
150
|
-
})];
|
|
151
|
-
case 6:
|
|
152
|
-
result = _e.sent();
|
|
153
|
-
return [4 /*yield*/, utils_1.api.getLatestPluginVersion(plugin.name)];
|
|
154
|
-
case 7:
|
|
155
|
-
resource = _e.sent();
|
|
156
|
-
plugin.version = (resource === null || resource === void 0 ? void 0 : resource.version) || '0.0.2'; // 0.0.2 is the default for first time plugin deployment in a Flex account
|
|
157
|
-
noWarnings = ((_d = result.stdout.match(step007_1.WARNING_REGEX)) === null || _d === void 0 ? void 0 : _d.length) || 0;
|
|
158
|
-
// Should display 0 violations
|
|
159
|
-
utils_1.assertion.equal(noWarnings, 0);
|
|
160
|
-
// Should deploy plugin
|
|
161
|
-
utils_1.assertion.fileExists([plugin.dir, 'build', plugin.name + ".js"]);
|
|
162
|
-
utils_1.assertion.fileContains([plugin.dir, 'build', plugin.name + ".js"], plugin.newlineValue);
|
|
163
|
-
utils_1.assertion.jsonFileContains([plugin.dir, 'package.json'], 'version', plugin.version);
|
|
164
|
-
utils_1.assertion.stringContains(result.stdout, 'Next Steps');
|
|
165
|
-
utils_1.assertion.stringContains(result.stdout, 'twilio flex:plugins:release');
|
|
166
|
-
utils_1.assertion.stringContains(result.stdout, plugin.name);
|
|
167
|
-
return [4 /*yield*/, utils_1.api.getPlugin(plugin.name)];
|
|
168
|
-
case 8:
|
|
169
|
-
apiPlugin = _e.sent();
|
|
170
|
-
return [4 /*yield*/, utils_1.api.getPluginVersion(plugin.name, plugin.version)];
|
|
171
|
-
case 9:
|
|
172
|
-
pluginVersion = _e.sent();
|
|
173
|
-
return [4 /*yield*/, utils_1.api.getLatestPluginVersion(plugin.name)];
|
|
174
|
-
case 10:
|
|
175
|
-
latest = _e.sent();
|
|
176
|
-
utils_1.assertion.equal(apiPlugin.unique_name, plugin.name);
|
|
177
|
-
utils_1.assertion.equal(pluginVersion.version, plugin.version);
|
|
178
|
-
utils_1.assertion.equal(pluginVersion.changelog, plugin.changelog);
|
|
179
|
-
utils_1.assertion.equal(pluginVersion, latest);
|
|
89
|
+
plugins = _b.sent();
|
|
90
|
+
utils_1.assertion.stringContains(result.stdout, 'successful');
|
|
91
|
+
utils_1.assertion.stringContains(result.stdout, 'Configuration FJ');
|
|
92
|
+
utils_1.assertion.stringContains(result.stdout, 'enabled');
|
|
93
|
+
utils_1.assertion.equal(1, plugins.plugins.length);
|
|
94
|
+
utils_1.assertion.equal(plugins.plugins[0].unique_name, plugin.name);
|
|
95
|
+
utils_1.assertion.equal(plugins.plugins[0].version, plugin.version);
|
|
180
96
|
return [2 /*return*/];
|
|
181
97
|
}
|
|
182
98
|
});
|
|
183
99
|
});
|
|
184
100
|
};
|
|
185
|
-
testSuite.description = 'Running {{twilio flex:plugins:
|
|
101
|
+
testSuite.description = 'Running {{twilio flex:plugins:release}}';
|
|
186
102
|
exports.default = testSuite;
|
|
187
103
|
//# sourceMappingURL=step008.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step008.js","sourceRoot":"","sources":["../../src/tests/step008.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"step008.js","sourceRoot":"","sources":["../../src/tests/step008.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uFAAuF;AACvF,kCAAwD;AAGxD,iBAAiB;AACjB,IAAM,SAAS,GAAc,UAAO,EAAgC;QAA9B,QAAQ,cAAA,EAAE,MAAM,YAAA;;;;;;oBAC9C,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;oBACnC,iBAAS,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;oBAEd,qBAAM,aAAK,CAAC,QAAQ;4BACjC,sBAAsB;4BACtB,UAAU;4BACP,MAAM,CAAC,IAAI,SAAI,MAAM,CAAC,OAAS;4BAClC,IAAI;4BACJ,OAAO;kCACJ,MAAM,CAAC,UAAU,GACpB,EAAA;;oBAPI,MAAM,GAAG,SAOb;oBACF,qBAAM,aAAK,CAAC,IAAI,CAAC,EAAA;;oBAAjB,SAAiB,CAAC;oBAEF,qBAAM,WAAG,CAAC,gBAAgB,EAAE,EAAA;;oBAAtC,OAAO,GAAG,SAA4B;oBAC5B,qBAAM,WAAG,CAAC,gBAAgB,CAAC,OAAQ,CAAC,iBAAiB,CAAC,EAAA;;oBAAhE,OAAO,GAAG,SAAsD;oBAEtE,iBAAS,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;oBACtD,iBAAS,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;oBAC5D,iBAAS,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;oBACnD,iBAAS,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;oBAC3C,iBAAS,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;oBAC7D,iBAAS,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;;;;;CAC7D,CAAC;AACF,SAAS,CAAC,WAAW,GAAG,yCAAyC,CAAC;AAElE,kBAAe,SAAS,CAAC"}
|
package/dist/tests/step009.js
CHANGED
|
@@ -35,69 +35,81 @@ 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
|
-
};
|
|
59
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
60
|
-
/* eslint-disable import/no-unused-modules, @typescript-eslint/no-non-null-assertion */
|
|
61
39
|
var utils_1 = require("../utils");
|
|
62
|
-
|
|
40
|
+
var PLUGIN_RELEASED_TIMEOUT = 30000;
|
|
41
|
+
var PLUGIN_RELEASED_POLL_INTERVAL = 5000;
|
|
42
|
+
// Plugin visible on the Hosted Flex
|
|
63
43
|
var testSuite = function (_a) {
|
|
64
|
-
var scenario = _a.scenario, config = _a.config;
|
|
44
|
+
var scenario = _a.scenario, config = _a.config, secrets = _a.secrets, environment = _a.environment;
|
|
65
45
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
66
|
-
var plugin,
|
|
46
|
+
var plugin, release, plugins, releasedPlugin, accountSid, e_1;
|
|
67
47
|
return __generator(this, function (_b) {
|
|
68
48
|
switch (_b.label) {
|
|
69
49
|
case 0:
|
|
70
50
|
plugin = scenario.plugins[0];
|
|
71
51
|
utils_1.assertion.not.isNull(plugin);
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
plugin.name + "@" + plugin.version,
|
|
76
|
-
'-l',
|
|
77
|
-
'debug'
|
|
78
|
-
], __read(config.regionFlag)))];
|
|
79
|
-
case 1:
|
|
80
|
-
result = _b.sent();
|
|
81
|
-
return [4 /*yield*/, utils_1.sleep(1000)];
|
|
82
|
-
case 2:
|
|
83
|
-
_b.sent();
|
|
52
|
+
if (!plugin.newlineValue) {
|
|
53
|
+
throw new Error("scenario.plugin.newlineValue does not have a valid value");
|
|
54
|
+
}
|
|
84
55
|
return [4 /*yield*/, utils_1.api.getActiveRelease()];
|
|
85
|
-
case
|
|
56
|
+
case 1:
|
|
86
57
|
release = _b.sent();
|
|
58
|
+
if (!release) {
|
|
59
|
+
throw new Error('Account does not have an active release');
|
|
60
|
+
}
|
|
87
61
|
return [4 /*yield*/, utils_1.api.getActivePlugins(release.configuration_sid)];
|
|
88
|
-
case
|
|
62
|
+
case 2:
|
|
89
63
|
plugins = _b.sent();
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
utils_1.
|
|
95
|
-
|
|
96
|
-
|
|
64
|
+
releasedPlugin = plugins.plugins.find(function (plgin) { return plgin.unique_name === plugin.name; });
|
|
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 })];
|
|
69
|
+
case 3:
|
|
70
|
+
_b.sent();
|
|
71
|
+
_b.label = 4;
|
|
72
|
+
case 4:
|
|
73
|
+
_b.trys.push([4, 11, 13, 15]);
|
|
74
|
+
// Log into Flex
|
|
75
|
+
return [4 /*yield*/, utils_1.Browser.app.twilioConsole.login('admin', secrets.api.accountSid, config.localhostPort)];
|
|
76
|
+
case 5:
|
|
77
|
+
// Log into Flex
|
|
78
|
+
_b.sent();
|
|
79
|
+
return [4 /*yield*/, utils_1.assertion.app.view.adminDashboard.isVisible()];
|
|
80
|
+
case 6:
|
|
81
|
+
_b.sent();
|
|
82
|
+
return [4 /*yield*/, utils_1.Browser.app.getFlexAccountSid()];
|
|
83
|
+
case 7:
|
|
84
|
+
accountSid = _b.sent();
|
|
85
|
+
utils_1.assertion.equal(accountSid, secrets.api.accountSid);
|
|
86
|
+
// Make sure that /plugins contain the plugin
|
|
87
|
+
return [4 /*yield*/, utils_1.pluginHelper.waitForPluginToRelease(releasedPlugin, PLUGIN_RELEASED_TIMEOUT, PLUGIN_RELEASED_POLL_INTERVAL)];
|
|
88
|
+
case 8:
|
|
89
|
+
// Make sure that /plugins contain the plugin
|
|
90
|
+
_b.sent();
|
|
91
|
+
return [4 /*yield*/, utils_1.Browser.app.agentDesktop.open()];
|
|
92
|
+
case 9:
|
|
93
|
+
_b.sent();
|
|
94
|
+
return [4 /*yield*/, utils_1.assertion.app.view.plugins.plugin.isVisible(plugin.newlineValue)];
|
|
95
|
+
case 10:
|
|
96
|
+
_b.sent();
|
|
97
|
+
return [3 /*break*/, 15];
|
|
98
|
+
case 11:
|
|
99
|
+
e_1 = _b.sent();
|
|
100
|
+
return [4 /*yield*/, utils_1.Browser.app.takeScreenshot(environment.cwd)];
|
|
101
|
+
case 12:
|
|
102
|
+
_b.sent();
|
|
103
|
+
throw e_1;
|
|
104
|
+
case 13: return [4 /*yield*/, utils_1.Browser.kill()];
|
|
105
|
+
case 14:
|
|
106
|
+
_b.sent();
|
|
107
|
+
return [7 /*endfinally*/];
|
|
108
|
+
case 15: return [2 /*return*/];
|
|
97
109
|
}
|
|
98
110
|
});
|
|
99
111
|
});
|
|
100
112
|
};
|
|
101
|
-
testSuite.description = '
|
|
113
|
+
testSuite.description = 'Released Plugin visible on the Hosted Flex';
|
|
102
114
|
exports.default = testSuite;
|
|
103
115
|
//# sourceMappingURL=step009.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step009.js","sourceRoot":"","sources":["../../src/tests/step009.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"step009.js","sourceRoot":"","sources":["../../src/tests/step009.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,kCAAiE;AAEjE,IAAM,uBAAuB,GAAG,KAAK,CAAC;AACtC,IAAM,6BAA6B,GAAG,IAAI,CAAC;AAE3C,oCAAoC;AACpC,IAAM,SAAS,GAAc,UAAO,EAAsD;QAApD,QAAQ,cAAA,EAAE,MAAM,YAAA,EAAE,OAAO,aAAA,EAAE,WAAW,iBAAA;;;;;;oBACpE,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,C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AAlD,UAAU,GAAG,SAAqC;oBACxD,iBAAS,CAAC,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;oBAEpD,6CAA6C;oBAC7C,qBAAM,oBAAY,CAAC,sBAAsB,CAAC,cAAc,EAAE,uBAAuB,EAAE,6BAA6B,CAAC,EAAA;;oBADjH,6CAA6C;oBAC7C,SAAiH,CAAC;oBAClH,qBAAM,eAAO,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,EAAA;;oBAArC,SAAqC,CAAC;oBAEtC,qBAAM,iBAAS,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,EAAA;;oBAAtE,SAAsE,CAAC;;;;oBAEvE,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;;;;;;CAExB,CAAC;AACF,SAAS,CAAC,WAAW,GAAG,4CAA4C,CAAC;AAErE,kBAAe,SAAS,CAAC"}
|
package/dist/tests/step010.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
import { TestSuite } from '../core';
|
|
1
|
+
import { TestSuite, TestParams } from '../core';
|
|
2
|
+
/**
|
|
3
|
+
* Log into Flex to set the required flex.twilio.com cookies
|
|
4
|
+
* @param config Contains the urls requires to load in the browser
|
|
5
|
+
* @param secrets Contains account info
|
|
6
|
+
*/
|
|
7
|
+
export declare const setupFlexBeforeLocalhost: (config: TestParams['config'], secrets: TestParams['secrets']) => Promise<void>;
|
|
2
8
|
declare const testSuite: TestSuite;
|
|
3
9
|
export default testSuite;
|