@twilio/flex-plugin-e2e-tests 6.4.2-alpha.202408160957 → 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.
@@ -52,10 +52,7 @@ var testSuite = function (_a) {
52
52
  utils_1.assertion.not.isNull(plugin);
53
53
  ext = scenario.isTS ? 'tsx' : 'jsx';
54
54
  tmpComponentText = 'hot reload works';
55
- return [4 /*yield*/, utils_1.spawn('twilio', ['flex:plugins:start', '-l', 'debug'], {
56
- detached: true,
57
- cwd: plugin.dir,
58
- })];
55
+ return [4 /*yield*/, utils_1.spawn('twilio', ['flex:plugins:start', '-l', 'debug'], { detached: true, cwd: plugin.dir })];
59
56
  case 1:
60
57
  twilioCliResult = _b.sent();
61
58
  return [4 /*yield*/, utils_1.pluginHelper.waitForPluginToStart(plugin.localhostUrl, core_1.testParams.config.start.timeout, core_1.testParams.config.start.pollInterval)];
@@ -1 +1 @@
1
- {"version":3,"file":"step006.js","sourceRoot":"","sources":["../../src/tests/step006.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oBAAoB;AACpB,mDAAgD;AAEhD,gCAA4D;AAC5D,kCAA+F;AAE/F,eAAe;AACf,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,CAAC;oBACnC,iBAAS,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;oBAEvB,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;oBACpC,gBAAgB,GAAG,kBAAkB,CAAC;oBACpB,qBAAM,aAAK,CAAC,QAAQ,EAAE,CAAC,oBAAoB,EAAE,IAAI,EAAE,OAAO,CAA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,EAAE,EAAE,gBAAgB;yBACrB,CAAC,EAAA;;oBALF,oBAAoB;oBACpB,SAIE,CAAC;oBAEH,qBAAM,iBAAS,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAA;;oBAAnE,SAAmE,CAAC;;;;oBAEpE,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;;yBAG7E,qBAAM,+BAAa,CAAC;wBAClB,KAAK,EAAE,gBAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,oBAAkB,GAAK,CAAC;wBAC3F,IAAI,EAAE,gBAAgB;wBACtB,EAAE,EAAE,MAAM,CAAC,aAAa;qBACzB,CAAC,EAAA;;oBAJF,SAIE,CAAC;;;;;CACJ,CAAC;AACF,SAAS,CAAC,WAAW,GAAG,uCAAuC,CAAC;AAEhE,kBAAe,SAAS,CAAC"}
@@ -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;
@@ -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 flex_dev_utils_1 = require("@twilio/flex-dev-utils");
65
+ var semver_1 = __importDefault(require("semver"));
64
66
  var utils_1 = require("../utils");
65
- exports.originalCode = 'const [isOpen, setIsOpen] = useState(true);';
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, noWarnings;
73
- var _b, _c;
74
- return __generator(this, function (_d) {
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: exports.originalCode,
82
- to: exports.codeWithViolation,
82
+ from: /This is a dismissible demo component.*/,
83
+ to: plugin.newlineValue,
83
84
  })];
84
85
  case 1:
85
- _d.sent();
86
- flex_dev_utils_1.logger.info('Running {{twilio flex:plugins:validate}} on a plugin with validation issues');
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
- result = _d.sent();
92
- noWarnings = ((_b = result.stdout.match(exports.WARNING_REGEX)) === null || _b === void 0 ? void 0 : _b.length) || 0;
93
- utils_1.assertion.equal(noWarnings, 2);
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
- result = _d.sent();
107
- noWarnings = ((_c = result.stdout.match(exports.WARNING_REGEX)) === null || _c === void 0 ? void 0 : _c.length) || 0;
108
- utils_1.assertion.equal(noWarnings, 0);
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:validate}}';
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA6C;AAC7C,mDAAgD;AAChD,yDAAgD;AAEhD,kCAAsD;AAGzC,QAAA,YAAY,GAAG,6CAA6C,CAAC;AAC7D,QAAA,iBAAiB,GAAG,6MAA6M,CAAC;AAClO,QAAA,aAAa,GAAG,YAAY,CAAC;AAE1C,kBAAkB;AAClB,IAAM,SAAS,GAAc,UAAO,EAAgC;QAA9B,QAAQ,cAAA,EAAE,MAAM,YAAA;;;;;;;oBAC9C,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;oBAE7B,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;oBAE1C,qBAAM,+BAAa,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AAC,EAAA;;oBAAtD,MAAM,GAAG,SAA6C;oBAE5D,iBAAS,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;oBACpD,iBAAS,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;oBACvD,iBAAS,CAAC,KAAK,CAAC,aAAa,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;oBAC3D,iBAAS,CAAC,KAAK,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;;;;;CACxC,CAAC;AACF,SAAS,CAAC,WAAW,GAAG,wCAAwC,CAAC;AAEjE,kBAAe,SAAS,CAAC"}
@@ -57,152 +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
- var step007_1 = require("./step007");
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, ext, result, noWarnings, resource, apiPlugin, pluginVersion, latest;
70
- var _b, _c, _d, _e;
71
- return __generator(this, function (_f) {
72
- switch (_f.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
- _f.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
- _f.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:deploy',
98
- '--changelog',
99
- "\"" + plugin.changelog + "\"",
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
- cwd: plugin.dir,
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
- result = _f.sent();
110
- noWarnings = ((_b = result.stdout.match(step007_1.WARNING_REGEX)) === null || _b === void 0 ? void 0 : _b.length) || 0;
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
- result = _f.sent();
132
- noWarnings = ((_c = result.stdout.match(step007_1.WARNING_REGEX)) === null || _c === void 0 ? void 0 : _c.length) || 0;
133
- // Should display violations
134
- utils_1.assertion.equal(noWarnings, 2);
135
- // Should deploy the plugin
136
- utils_1.assertion.stringContains(result.stdout, 'Next Steps');
137
- utils_1.assertion.stringContains(result.stdout, 'twilio flex:plugins:release');
138
- // Deploy the plugin bypassing validation issues found in the plugin
139
- flex_dev_utils_1.logger.info('Running {{flex:plugins:deploy}} with --bypass-validation');
140
- return [4 /*yield*/, utils_1.spawn('twilio', __spreadArray([
141
- 'flex:plugins:deploy',
142
- '--changelog',
143
- "\"" + plugin.changelog + "\"",
144
- '--patch',
145
- '--bypass-validation',
146
- '-l',
147
- 'debug'
148
- ], __read(config.regionFlag)), {
149
- cwd: plugin.dir,
150
- })];
151
- case 5:
152
- result = _f.sent();
153
- noWarnings = ((_d = result.stdout.match(step007_1.WARNING_REGEX)) === null || _d === void 0 ? void 0 : _d.length) || 0;
154
- // Should display violations
155
- utils_1.assertion.equal(noWarnings, 2);
156
- // Should deploy the plugin
157
- utils_1.assertion.stringContains(result.stdout, 'Next Steps');
158
- utils_1.assertion.stringContains(result.stdout, 'twilio flex:plugins:release');
159
- // Deploy without validation errors in the plugin
160
- return [4 /*yield*/, replace_in_file_1.replaceInFile({
161
- files: utils_1.joinPath(plugin.dir, 'src', 'components', 'CustomTaskList', "CustomTaskList." + ext),
162
- from: step007_1.codeWithViolation,
163
- to: step007_1.originalCode,
164
- })];
165
- case 6:
166
- // Deploy without validation errors in the plugin
167
- _f.sent();
168
- flex_dev_utils_1.logger.info('Running {{flex:plugins:deploy}} on a plugin with 0 valdiation issues');
169
- return [4 /*yield*/, utils_1.spawn('twilio', __spreadArray(['flex:plugins:deploy', '--changelog', "\"" + plugin.changelog + "\"", '--patch', '-l', 'debug'], __read(config.regionFlag)), {
170
- cwd: plugin.dir,
171
- })];
172
- case 7:
173
- result = _f.sent();
174
- return [4 /*yield*/, utils_1.api.getLatestPluginVersion(plugin.name)];
175
- case 8:
176
- resource = _f.sent();
177
- 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
178
- noWarnings = ((_e = result.stdout.match(step007_1.WARNING_REGEX)) === null || _e === void 0 ? void 0 : _e.length) || 0;
179
- // Should display 0 violations
180
- utils_1.assertion.equal(noWarnings, 0);
181
- // Should deploy plugin
182
- utils_1.assertion.fileExists([plugin.dir, 'build', plugin.name + ".js"]);
183
- utils_1.assertion.fileContains([plugin.dir, 'build', plugin.name + ".js"], plugin.newlineValue);
184
- utils_1.assertion.jsonFileContains([plugin.dir, 'package.json'], 'version', plugin.version);
185
- utils_1.assertion.stringContains(result.stdout, 'Next Steps');
186
- utils_1.assertion.stringContains(result.stdout, 'twilio flex:plugins:release');
187
- utils_1.assertion.stringContains(result.stdout, plugin.name);
188
- return [4 /*yield*/, utils_1.api.getPlugin(plugin.name)];
189
- case 9:
190
- apiPlugin = _f.sent();
191
- return [4 /*yield*/, utils_1.api.getPluginVersion(plugin.name, plugin.version)];
192
- case 10:
193
- pluginVersion = _f.sent();
194
- return [4 /*yield*/, utils_1.api.getLatestPluginVersion(plugin.name)];
195
- case 11:
196
- latest = _f.sent();
197
- utils_1.assertion.equal(apiPlugin.unique_name, plugin.name);
198
- utils_1.assertion.equal(pluginVersion.version, plugin.version);
199
- utils_1.assertion.equal(pluginVersion.changelog, plugin.changelog);
200
- 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);
201
96
  return [2 /*return*/];
202
97
  }
203
98
  });
204
99
  });
205
100
  };
206
- testSuite.description = 'Running {{twilio flex:plugins:deploy}}';
101
+ testSuite.description = 'Running {{twilio flex:plugins:release}}';
207
102
  exports.default = testSuite;
208
103
  //# sourceMappingURL=step008.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"step008.js","sourceRoot":"","sources":["../../src/tests/step008.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA6C;AAC7C,mDAAgD;AAChD,yDAAgD;AAEhD,kCAA2D;AAE3D,qCAA2E;AAE3E,gBAAgB;AAChB,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;oBAEvB,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;oBAC1C,MAAM,CAAC,YAAY,GAAG,0CAAwC,IAAI,CAAC,GAAG,EAAI,CAAC;oBAC3E,MAAM,CAAC,SAAS,GAAG,cAAY,IAAI,CAAC,GAAG,EAAI,CAAC;oBAE5C,qBAAM,+BAAa,CAAC;4BAClB,KAAK,EAAE,gBAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,oBAAkB,GAAK,CAAC;4BAC3F,IAAI,EAAE,wCAAwC;4BAC9C,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C,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"}
@@ -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
- // Release plugin
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, result, release, plugins;
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
- return [4 /*yield*/, utils_1.spawn('twilio', __spreadArray([
73
- 'flex:plugins:release',
74
- '--plugin',
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 3:
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 4:
62
+ case 2:
89
63
  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);
96
- return [2 /*return*/];
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 = 'Running {{twilio flex:plugins:release}}';
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,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