@bigbinary/neeto-playwright-commons 3.1.1 → 3.1.3

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/index.js CHANGED
@@ -8881,6 +8881,7 @@ class OrganizationPage {
8881
8881
  if (IS_DEV_ENV)
8882
8882
  return;
8883
8883
  const subdomainError = this.page.getByTestId(SIGNUP_SELECTORS.subdomainError);
8884
+ const subdomainAvailabilityMsg = this.page.getByTestId(SIGNUP_SELECTORS.subdomainAvailabilityMsg);
8884
8885
  const organizationSubmitButton = this.page.getByTestId(SIGNUP_SELECTORS.organizationSubmitButton);
8885
8886
  await this.neetoPlaywrightUtilities.waitForPageLoad();
8886
8887
  await this.page
@@ -8889,9 +8890,12 @@ class OrganizationPage {
8889
8890
  await this.page
8890
8891
  .getByTestId(SIGNUP_SELECTORS.subdomainNameTextField)
8891
8892
  .fill(credentials.subdomainName);
8893
+ await expect(subdomainAvailabilityMsg.or(subdomainError)).toBeVisible({
8894
+ timeout: 15_000,
8895
+ });
8892
8896
  const subdomainErrorCount = await subdomainError.count();
8893
8897
  subdomainErrorCount !== 0 && (await this.updateSubdomainIfExists(appName));
8894
- await expect(this.page.getByTestId(SIGNUP_SELECTORS.subdomainAvailabilityMsg)).toBeVisible({ timeout: 45_000 });
8898
+ await expect(subdomainAvailabilityMsg).toBeVisible({ timeout: 45_000 });
8895
8899
  await organizationSubmitButton.click();
8896
8900
  await Promise.all([
8897
8901
  expect(organizationSubmitButton).toBeHidden({ timeout: 45 * 1000 }),
@@ -111475,6 +111479,8 @@ function requireConstants$1 () {
111475
111479
  const WIN_SLASH = '\\\\/';
111476
111480
  const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
111477
111481
 
111482
+ const DEFAULT_MAX_EXTGLOB_RECURSION = 0;
111483
+
111478
111484
  /**
111479
111485
  * Posix glob regex
111480
111486
  */
@@ -111538,6 +111544,7 @@ function requireConstants$1 () {
111538
111544
  */
111539
111545
 
111540
111546
  const POSIX_REGEX_SOURCE = {
111547
+ __proto__: null,
111541
111548
  alnum: 'a-zA-Z0-9',
111542
111549
  alpha: 'a-zA-Z',
111543
111550
  ascii: '\\x00-\\x7F',
@@ -111555,6 +111562,7 @@ function requireConstants$1 () {
111555
111562
  };
111556
111563
 
111557
111564
  constants$1 = {
111565
+ DEFAULT_MAX_EXTGLOB_RECURSION,
111558
111566
  MAX_LENGTH: 1024 * 64,
111559
111567
  POSIX_REGEX_SOURCE,
111560
111568
 
@@ -111568,6 +111576,7 @@ function requireConstants$1 () {
111568
111576
 
111569
111577
  // Replace globs with equivalent patterns to reduce parsing time.
111570
111578
  REPLACEMENTS: {
111579
+ __proto__: null,
111571
111580
  '***': '*',
111572
111581
  '**/**': '**',
111573
111582
  '**/**/**': '**'
@@ -112175,6 +112184,277 @@ function requireParse () {
112175
112184
  return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
112176
112185
  };
112177
112186
 
112187
+ const splitTopLevel = input => {
112188
+ const parts = [];
112189
+ let bracket = 0;
112190
+ let paren = 0;
112191
+ let quote = 0;
112192
+ let value = '';
112193
+ let escaped = false;
112194
+
112195
+ for (const ch of input) {
112196
+ if (escaped === true) {
112197
+ value += ch;
112198
+ escaped = false;
112199
+ continue;
112200
+ }
112201
+
112202
+ if (ch === '\\') {
112203
+ value += ch;
112204
+ escaped = true;
112205
+ continue;
112206
+ }
112207
+
112208
+ if (ch === '"') {
112209
+ quote = quote === 1 ? 0 : 1;
112210
+ value += ch;
112211
+ continue;
112212
+ }
112213
+
112214
+ if (quote === 0) {
112215
+ if (ch === '[') {
112216
+ bracket++;
112217
+ } else if (ch === ']' && bracket > 0) {
112218
+ bracket--;
112219
+ } else if (bracket === 0) {
112220
+ if (ch === '(') {
112221
+ paren++;
112222
+ } else if (ch === ')' && paren > 0) {
112223
+ paren--;
112224
+ } else if (ch === '|' && paren === 0) {
112225
+ parts.push(value);
112226
+ value = '';
112227
+ continue;
112228
+ }
112229
+ }
112230
+ }
112231
+
112232
+ value += ch;
112233
+ }
112234
+
112235
+ parts.push(value);
112236
+ return parts;
112237
+ };
112238
+
112239
+ const isPlainBranch = branch => {
112240
+ let escaped = false;
112241
+
112242
+ for (const ch of branch) {
112243
+ if (escaped === true) {
112244
+ escaped = false;
112245
+ continue;
112246
+ }
112247
+
112248
+ if (ch === '\\') {
112249
+ escaped = true;
112250
+ continue;
112251
+ }
112252
+
112253
+ if (/[?*+@!()[\]{}]/.test(ch)) {
112254
+ return false;
112255
+ }
112256
+ }
112257
+
112258
+ return true;
112259
+ };
112260
+
112261
+ const normalizeSimpleBranch = branch => {
112262
+ let value = branch.trim();
112263
+ let changed = true;
112264
+
112265
+ while (changed === true) {
112266
+ changed = false;
112267
+
112268
+ if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
112269
+ value = value.slice(2, -1);
112270
+ changed = true;
112271
+ }
112272
+ }
112273
+
112274
+ if (!isPlainBranch(value)) {
112275
+ return;
112276
+ }
112277
+
112278
+ return value.replace(/\\(.)/g, '$1');
112279
+ };
112280
+
112281
+ const hasRepeatedCharPrefixOverlap = branches => {
112282
+ const values = branches.map(normalizeSimpleBranch).filter(Boolean);
112283
+
112284
+ for (let i = 0; i < values.length; i++) {
112285
+ for (let j = i + 1; j < values.length; j++) {
112286
+ const a = values[i];
112287
+ const b = values[j];
112288
+ const char = a[0];
112289
+
112290
+ if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) {
112291
+ continue;
112292
+ }
112293
+
112294
+ if (a === b || a.startsWith(b) || b.startsWith(a)) {
112295
+ return true;
112296
+ }
112297
+ }
112298
+ }
112299
+
112300
+ return false;
112301
+ };
112302
+
112303
+ const parseRepeatedExtglob = (pattern, requireEnd = true) => {
112304
+ if ((pattern[0] !== '+' && pattern[0] !== '*') || pattern[1] !== '(') {
112305
+ return;
112306
+ }
112307
+
112308
+ let bracket = 0;
112309
+ let paren = 0;
112310
+ let quote = 0;
112311
+ let escaped = false;
112312
+
112313
+ for (let i = 1; i < pattern.length; i++) {
112314
+ const ch = pattern[i];
112315
+
112316
+ if (escaped === true) {
112317
+ escaped = false;
112318
+ continue;
112319
+ }
112320
+
112321
+ if (ch === '\\') {
112322
+ escaped = true;
112323
+ continue;
112324
+ }
112325
+
112326
+ if (ch === '"') {
112327
+ quote = quote === 1 ? 0 : 1;
112328
+ continue;
112329
+ }
112330
+
112331
+ if (quote === 1) {
112332
+ continue;
112333
+ }
112334
+
112335
+ if (ch === '[') {
112336
+ bracket++;
112337
+ continue;
112338
+ }
112339
+
112340
+ if (ch === ']' && bracket > 0) {
112341
+ bracket--;
112342
+ continue;
112343
+ }
112344
+
112345
+ if (bracket > 0) {
112346
+ continue;
112347
+ }
112348
+
112349
+ if (ch === '(') {
112350
+ paren++;
112351
+ continue;
112352
+ }
112353
+
112354
+ if (ch === ')') {
112355
+ paren--;
112356
+
112357
+ if (paren === 0) {
112358
+ if (requireEnd === true && i !== pattern.length - 1) {
112359
+ return;
112360
+ }
112361
+
112362
+ return {
112363
+ type: pattern[0],
112364
+ body: pattern.slice(2, i),
112365
+ end: i
112366
+ };
112367
+ }
112368
+ }
112369
+ }
112370
+ };
112371
+
112372
+ const getStarExtglobSequenceOutput = pattern => {
112373
+ let index = 0;
112374
+ const chars = [];
112375
+
112376
+ while (index < pattern.length) {
112377
+ const match = parseRepeatedExtglob(pattern.slice(index), false);
112378
+
112379
+ if (!match || match.type !== '*') {
112380
+ return;
112381
+ }
112382
+
112383
+ const branches = splitTopLevel(match.body).map(branch => branch.trim());
112384
+ if (branches.length !== 1) {
112385
+ return;
112386
+ }
112387
+
112388
+ const branch = normalizeSimpleBranch(branches[0]);
112389
+ if (!branch || branch.length !== 1) {
112390
+ return;
112391
+ }
112392
+
112393
+ chars.push(branch);
112394
+ index += match.end + 1;
112395
+ }
112396
+
112397
+ if (chars.length < 1) {
112398
+ return;
112399
+ }
112400
+
112401
+ const source = chars.length === 1
112402
+ ? utils.escapeRegex(chars[0])
112403
+ : `[${chars.map(ch => utils.escapeRegex(ch)).join('')}]`;
112404
+
112405
+ return `${source}*`;
112406
+ };
112407
+
112408
+ const repeatedExtglobRecursion = pattern => {
112409
+ let depth = 0;
112410
+ let value = pattern.trim();
112411
+ let match = parseRepeatedExtglob(value);
112412
+
112413
+ while (match) {
112414
+ depth++;
112415
+ value = match.body.trim();
112416
+ match = parseRepeatedExtglob(value);
112417
+ }
112418
+
112419
+ return depth;
112420
+ };
112421
+
112422
+ const analyzeRepeatedExtglob = (body, options) => {
112423
+ if (options.maxExtglobRecursion === false) {
112424
+ return { risky: false };
112425
+ }
112426
+
112427
+ const max =
112428
+ typeof options.maxExtglobRecursion === 'number'
112429
+ ? options.maxExtglobRecursion
112430
+ : constants.DEFAULT_MAX_EXTGLOB_RECURSION;
112431
+
112432
+ const branches = splitTopLevel(body).map(branch => branch.trim());
112433
+
112434
+ if (branches.length > 1) {
112435
+ if (
112436
+ branches.some(branch => branch === '') ||
112437
+ branches.some(branch => /^[*?]+$/.test(branch)) ||
112438
+ hasRepeatedCharPrefixOverlap(branches)
112439
+ ) {
112440
+ return { risky: true };
112441
+ }
112442
+ }
112443
+
112444
+ for (const branch of branches) {
112445
+ const safeOutput = getStarExtglobSequenceOutput(branch);
112446
+ if (safeOutput) {
112447
+ return { risky: true, safeOutput };
112448
+ }
112449
+
112450
+ if (repeatedExtglobRecursion(branch) > max) {
112451
+ return { risky: true };
112452
+ }
112453
+ }
112454
+
112455
+ return { risky: false };
112456
+ };
112457
+
112178
112458
  /**
112179
112459
  * Parse the given input string.
112180
112460
  * @param {String} input
@@ -112356,6 +112636,8 @@ function requireParse () {
112356
112636
  token.prev = prev;
112357
112637
  token.parens = state.parens;
112358
112638
  token.output = state.output;
112639
+ token.startIndex = state.index;
112640
+ token.tokensIndex = tokens.length;
112359
112641
  const output = (opts.capture ? '(' : '') + token.open;
112360
112642
 
112361
112643
  increment('parens');
@@ -112365,6 +112647,34 @@ function requireParse () {
112365
112647
  };
112366
112648
 
112367
112649
  const extglobClose = token => {
112650
+ const literal = input.slice(token.startIndex, state.index + 1);
112651
+ const body = input.slice(token.startIndex + 2, state.index);
112652
+ const analysis = analyzeRepeatedExtglob(body, opts);
112653
+
112654
+ if ((token.type === 'plus' || token.type === 'star') && analysis.risky) {
112655
+ const safeOutput = analysis.safeOutput
112656
+ ? (token.output ? '' : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput)
112657
+ : undefined;
112658
+ const open = tokens[token.tokensIndex];
112659
+
112660
+ open.type = 'text';
112661
+ open.value = literal;
112662
+ open.output = safeOutput || utils.escapeRegex(literal);
112663
+
112664
+ for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
112665
+ tokens[i].value = '';
112666
+ tokens[i].output = '';
112667
+ delete tokens[i].suffix;
112668
+ }
112669
+
112670
+ state.output = token.output + open.output;
112671
+ state.backtrack = true;
112672
+
112673
+ push({ type: 'paren', extglob: true, value, output: '' });
112674
+ decrement('parens');
112675
+ return;
112676
+ }
112677
+
112368
112678
  let output = token.close + (opts.capture ? ')' : '');
112369
112679
  let rest;
112370
112680