@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.cjs.js CHANGED
@@ -8902,6 +8902,7 @@ class OrganizationPage {
8902
8902
  if (IS_DEV_ENV)
8903
8903
  return;
8904
8904
  const subdomainError = this.page.getByTestId(SIGNUP_SELECTORS.subdomainError);
8905
+ const subdomainAvailabilityMsg = this.page.getByTestId(SIGNUP_SELECTORS.subdomainAvailabilityMsg);
8905
8906
  const organizationSubmitButton = this.page.getByTestId(SIGNUP_SELECTORS.organizationSubmitButton);
8906
8907
  await this.neetoPlaywrightUtilities.waitForPageLoad();
8907
8908
  await this.page
@@ -8910,9 +8911,12 @@ class OrganizationPage {
8910
8911
  await this.page
8911
8912
  .getByTestId(SIGNUP_SELECTORS.subdomainNameTextField)
8912
8913
  .fill(credentials.subdomainName);
8914
+ await test.expect(subdomainAvailabilityMsg.or(subdomainError)).toBeVisible({
8915
+ timeout: 15_000,
8916
+ });
8913
8917
  const subdomainErrorCount = await subdomainError.count();
8914
8918
  subdomainErrorCount !== 0 && (await this.updateSubdomainIfExists(appName));
8915
- await test.expect(this.page.getByTestId(SIGNUP_SELECTORS.subdomainAvailabilityMsg)).toBeVisible({ timeout: 45_000 });
8919
+ await test.expect(subdomainAvailabilityMsg).toBeVisible({ timeout: 45_000 });
8916
8920
  await organizationSubmitButton.click();
8917
8921
  await Promise.all([
8918
8922
  test.expect(organizationSubmitButton).toBeHidden({ timeout: 45 * 1000 }),
@@ -111496,6 +111500,8 @@ function requireConstants$1 () {
111496
111500
  const WIN_SLASH = '\\\\/';
111497
111501
  const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
111498
111502
 
111503
+ const DEFAULT_MAX_EXTGLOB_RECURSION = 0;
111504
+
111499
111505
  /**
111500
111506
  * Posix glob regex
111501
111507
  */
@@ -111559,6 +111565,7 @@ function requireConstants$1 () {
111559
111565
  */
111560
111566
 
111561
111567
  const POSIX_REGEX_SOURCE = {
111568
+ __proto__: null,
111562
111569
  alnum: 'a-zA-Z0-9',
111563
111570
  alpha: 'a-zA-Z',
111564
111571
  ascii: '\\x00-\\x7F',
@@ -111576,6 +111583,7 @@ function requireConstants$1 () {
111576
111583
  };
111577
111584
 
111578
111585
  constants$1 = {
111586
+ DEFAULT_MAX_EXTGLOB_RECURSION,
111579
111587
  MAX_LENGTH: 1024 * 64,
111580
111588
  POSIX_REGEX_SOURCE,
111581
111589
 
@@ -111589,6 +111597,7 @@ function requireConstants$1 () {
111589
111597
 
111590
111598
  // Replace globs with equivalent patterns to reduce parsing time.
111591
111599
  REPLACEMENTS: {
111600
+ __proto__: null,
111592
111601
  '***': '*',
111593
111602
  '**/**': '**',
111594
111603
  '**/**/**': '**'
@@ -112196,6 +112205,277 @@ function requireParse () {
112196
112205
  return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
112197
112206
  };
112198
112207
 
112208
+ const splitTopLevel = input => {
112209
+ const parts = [];
112210
+ let bracket = 0;
112211
+ let paren = 0;
112212
+ let quote = 0;
112213
+ let value = '';
112214
+ let escaped = false;
112215
+
112216
+ for (const ch of input) {
112217
+ if (escaped === true) {
112218
+ value += ch;
112219
+ escaped = false;
112220
+ continue;
112221
+ }
112222
+
112223
+ if (ch === '\\') {
112224
+ value += ch;
112225
+ escaped = true;
112226
+ continue;
112227
+ }
112228
+
112229
+ if (ch === '"') {
112230
+ quote = quote === 1 ? 0 : 1;
112231
+ value += ch;
112232
+ continue;
112233
+ }
112234
+
112235
+ if (quote === 0) {
112236
+ if (ch === '[') {
112237
+ bracket++;
112238
+ } else if (ch === ']' && bracket > 0) {
112239
+ bracket--;
112240
+ } else if (bracket === 0) {
112241
+ if (ch === '(') {
112242
+ paren++;
112243
+ } else if (ch === ')' && paren > 0) {
112244
+ paren--;
112245
+ } else if (ch === '|' && paren === 0) {
112246
+ parts.push(value);
112247
+ value = '';
112248
+ continue;
112249
+ }
112250
+ }
112251
+ }
112252
+
112253
+ value += ch;
112254
+ }
112255
+
112256
+ parts.push(value);
112257
+ return parts;
112258
+ };
112259
+
112260
+ const isPlainBranch = branch => {
112261
+ let escaped = false;
112262
+
112263
+ for (const ch of branch) {
112264
+ if (escaped === true) {
112265
+ escaped = false;
112266
+ continue;
112267
+ }
112268
+
112269
+ if (ch === '\\') {
112270
+ escaped = true;
112271
+ continue;
112272
+ }
112273
+
112274
+ if (/[?*+@!()[\]{}]/.test(ch)) {
112275
+ return false;
112276
+ }
112277
+ }
112278
+
112279
+ return true;
112280
+ };
112281
+
112282
+ const normalizeSimpleBranch = branch => {
112283
+ let value = branch.trim();
112284
+ let changed = true;
112285
+
112286
+ while (changed === true) {
112287
+ changed = false;
112288
+
112289
+ if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
112290
+ value = value.slice(2, -1);
112291
+ changed = true;
112292
+ }
112293
+ }
112294
+
112295
+ if (!isPlainBranch(value)) {
112296
+ return;
112297
+ }
112298
+
112299
+ return value.replace(/\\(.)/g, '$1');
112300
+ };
112301
+
112302
+ const hasRepeatedCharPrefixOverlap = branches => {
112303
+ const values = branches.map(normalizeSimpleBranch).filter(Boolean);
112304
+
112305
+ for (let i = 0; i < values.length; i++) {
112306
+ for (let j = i + 1; j < values.length; j++) {
112307
+ const a = values[i];
112308
+ const b = values[j];
112309
+ const char = a[0];
112310
+
112311
+ if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) {
112312
+ continue;
112313
+ }
112314
+
112315
+ if (a === b || a.startsWith(b) || b.startsWith(a)) {
112316
+ return true;
112317
+ }
112318
+ }
112319
+ }
112320
+
112321
+ return false;
112322
+ };
112323
+
112324
+ const parseRepeatedExtglob = (pattern, requireEnd = true) => {
112325
+ if ((pattern[0] !== '+' && pattern[0] !== '*') || pattern[1] !== '(') {
112326
+ return;
112327
+ }
112328
+
112329
+ let bracket = 0;
112330
+ let paren = 0;
112331
+ let quote = 0;
112332
+ let escaped = false;
112333
+
112334
+ for (let i = 1; i < pattern.length; i++) {
112335
+ const ch = pattern[i];
112336
+
112337
+ if (escaped === true) {
112338
+ escaped = false;
112339
+ continue;
112340
+ }
112341
+
112342
+ if (ch === '\\') {
112343
+ escaped = true;
112344
+ continue;
112345
+ }
112346
+
112347
+ if (ch === '"') {
112348
+ quote = quote === 1 ? 0 : 1;
112349
+ continue;
112350
+ }
112351
+
112352
+ if (quote === 1) {
112353
+ continue;
112354
+ }
112355
+
112356
+ if (ch === '[') {
112357
+ bracket++;
112358
+ continue;
112359
+ }
112360
+
112361
+ if (ch === ']' && bracket > 0) {
112362
+ bracket--;
112363
+ continue;
112364
+ }
112365
+
112366
+ if (bracket > 0) {
112367
+ continue;
112368
+ }
112369
+
112370
+ if (ch === '(') {
112371
+ paren++;
112372
+ continue;
112373
+ }
112374
+
112375
+ if (ch === ')') {
112376
+ paren--;
112377
+
112378
+ if (paren === 0) {
112379
+ if (requireEnd === true && i !== pattern.length - 1) {
112380
+ return;
112381
+ }
112382
+
112383
+ return {
112384
+ type: pattern[0],
112385
+ body: pattern.slice(2, i),
112386
+ end: i
112387
+ };
112388
+ }
112389
+ }
112390
+ }
112391
+ };
112392
+
112393
+ const getStarExtglobSequenceOutput = pattern => {
112394
+ let index = 0;
112395
+ const chars = [];
112396
+
112397
+ while (index < pattern.length) {
112398
+ const match = parseRepeatedExtglob(pattern.slice(index), false);
112399
+
112400
+ if (!match || match.type !== '*') {
112401
+ return;
112402
+ }
112403
+
112404
+ const branches = splitTopLevel(match.body).map(branch => branch.trim());
112405
+ if (branches.length !== 1) {
112406
+ return;
112407
+ }
112408
+
112409
+ const branch = normalizeSimpleBranch(branches[0]);
112410
+ if (!branch || branch.length !== 1) {
112411
+ return;
112412
+ }
112413
+
112414
+ chars.push(branch);
112415
+ index += match.end + 1;
112416
+ }
112417
+
112418
+ if (chars.length < 1) {
112419
+ return;
112420
+ }
112421
+
112422
+ const source = chars.length === 1
112423
+ ? utils.escapeRegex(chars[0])
112424
+ : `[${chars.map(ch => utils.escapeRegex(ch)).join('')}]`;
112425
+
112426
+ return `${source}*`;
112427
+ };
112428
+
112429
+ const repeatedExtglobRecursion = pattern => {
112430
+ let depth = 0;
112431
+ let value = pattern.trim();
112432
+ let match = parseRepeatedExtglob(value);
112433
+
112434
+ while (match) {
112435
+ depth++;
112436
+ value = match.body.trim();
112437
+ match = parseRepeatedExtglob(value);
112438
+ }
112439
+
112440
+ return depth;
112441
+ };
112442
+
112443
+ const analyzeRepeatedExtglob = (body, options) => {
112444
+ if (options.maxExtglobRecursion === false) {
112445
+ return { risky: false };
112446
+ }
112447
+
112448
+ const max =
112449
+ typeof options.maxExtglobRecursion === 'number'
112450
+ ? options.maxExtglobRecursion
112451
+ : constants.DEFAULT_MAX_EXTGLOB_RECURSION;
112452
+
112453
+ const branches = splitTopLevel(body).map(branch => branch.trim());
112454
+
112455
+ if (branches.length > 1) {
112456
+ if (
112457
+ branches.some(branch => branch === '') ||
112458
+ branches.some(branch => /^[*?]+$/.test(branch)) ||
112459
+ hasRepeatedCharPrefixOverlap(branches)
112460
+ ) {
112461
+ return { risky: true };
112462
+ }
112463
+ }
112464
+
112465
+ for (const branch of branches) {
112466
+ const safeOutput = getStarExtglobSequenceOutput(branch);
112467
+ if (safeOutput) {
112468
+ return { risky: true, safeOutput };
112469
+ }
112470
+
112471
+ if (repeatedExtglobRecursion(branch) > max) {
112472
+ return { risky: true };
112473
+ }
112474
+ }
112475
+
112476
+ return { risky: false };
112477
+ };
112478
+
112199
112479
  /**
112200
112480
  * Parse the given input string.
112201
112481
  * @param {String} input
@@ -112377,6 +112657,8 @@ function requireParse () {
112377
112657
  token.prev = prev;
112378
112658
  token.parens = state.parens;
112379
112659
  token.output = state.output;
112660
+ token.startIndex = state.index;
112661
+ token.tokensIndex = tokens.length;
112380
112662
  const output = (opts.capture ? '(' : '') + token.open;
112381
112663
 
112382
112664
  increment('parens');
@@ -112386,6 +112668,34 @@ function requireParse () {
112386
112668
  };
112387
112669
 
112388
112670
  const extglobClose = token => {
112671
+ const literal = input.slice(token.startIndex, state.index + 1);
112672
+ const body = input.slice(token.startIndex + 2, state.index);
112673
+ const analysis = analyzeRepeatedExtglob(body, opts);
112674
+
112675
+ if ((token.type === 'plus' || token.type === 'star') && analysis.risky) {
112676
+ const safeOutput = analysis.safeOutput
112677
+ ? (token.output ? '' : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput)
112678
+ : undefined;
112679
+ const open = tokens[token.tokensIndex];
112680
+
112681
+ open.type = 'text';
112682
+ open.value = literal;
112683
+ open.output = safeOutput || utils.escapeRegex(literal);
112684
+
112685
+ for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
112686
+ tokens[i].value = '';
112687
+ tokens[i].output = '';
112688
+ delete tokens[i].suffix;
112689
+ }
112690
+
112691
+ state.output = token.output + open.output;
112692
+ state.backtrack = true;
112693
+
112694
+ push({ type: 'paren', extglob: true, value, output: '' });
112695
+ decrement('parens');
112696
+ return;
112697
+ }
112698
+
112389
112699
  let output = token.close + (opts.capture ? ')' : '');
112390
112700
  let rest;
112391
112701