@bigbinary/neeto-playwright-commons 1.10.9 → 1.10.10
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 +67 -54
- package/index.cjs.js.map +1 -1
- package/index.js +67 -54
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -6231,7 +6231,7 @@ var utils$k = {};
|
|
|
6231
6231
|
*/
|
|
6232
6232
|
|
|
6233
6233
|
exports.escapeNode = (block, n = 0, type) => {
|
|
6234
|
-
|
|
6234
|
+
const node = block.nodes[n];
|
|
6235
6235
|
if (!node) return;
|
|
6236
6236
|
|
|
6237
6237
|
if ((type && node.type === type) || node.type === 'open' || node.type === 'close') {
|
|
@@ -6300,13 +6300,23 @@ var utils$k = {};
|
|
|
6300
6300
|
|
|
6301
6301
|
exports.flatten = (...args) => {
|
|
6302
6302
|
const result = [];
|
|
6303
|
+
|
|
6303
6304
|
const flat = arr => {
|
|
6304
6305
|
for (let i = 0; i < arr.length; i++) {
|
|
6305
|
-
|
|
6306
|
-
|
|
6306
|
+
const ele = arr[i];
|
|
6307
|
+
|
|
6308
|
+
if (Array.isArray(ele)) {
|
|
6309
|
+
flat(ele);
|
|
6310
|
+
continue;
|
|
6311
|
+
}
|
|
6312
|
+
|
|
6313
|
+
if (ele !== undefined) {
|
|
6314
|
+
result.push(ele);
|
|
6315
|
+
}
|
|
6307
6316
|
}
|
|
6308
6317
|
return result;
|
|
6309
6318
|
};
|
|
6319
|
+
|
|
6310
6320
|
flat(args);
|
|
6311
6321
|
return result;
|
|
6312
6322
|
};
|
|
@@ -6315,9 +6325,9 @@ var utils$k = {};
|
|
|
6315
6325
|
const utils$j = utils$k;
|
|
6316
6326
|
|
|
6317
6327
|
var stringify$4 = (ast, options = {}) => {
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6328
|
+
const stringify = (node, parent = {}) => {
|
|
6329
|
+
const invalidBlock = options.escapeInvalid && utils$j.isInvalidBrace(parent);
|
|
6330
|
+
const invalidNode = node.invalid === true && options.escapeInvalid === true;
|
|
6321
6331
|
let output = '';
|
|
6322
6332
|
|
|
6323
6333
|
if (node.value) {
|
|
@@ -6332,7 +6342,7 @@ var stringify$4 = (ast, options = {}) => {
|
|
|
6332
6342
|
}
|
|
6333
6343
|
|
|
6334
6344
|
if (node.nodes) {
|
|
6335
|
-
for (
|
|
6345
|
+
for (const child of node.nodes) {
|
|
6336
6346
|
output += stringify(child);
|
|
6337
6347
|
}
|
|
6338
6348
|
}
|
|
@@ -6706,7 +6716,7 @@ const toMaxLen = (input, maxLength) => {
|
|
|
6706
6716
|
return negative ? ('-' + input) : input;
|
|
6707
6717
|
};
|
|
6708
6718
|
|
|
6709
|
-
const toSequence = (parts, options) => {
|
|
6719
|
+
const toSequence = (parts, options, maxLen) => {
|
|
6710
6720
|
parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
6711
6721
|
parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
6712
6722
|
|
|
@@ -6716,11 +6726,11 @@ const toSequence = (parts, options) => {
|
|
|
6716
6726
|
let result;
|
|
6717
6727
|
|
|
6718
6728
|
if (parts.positives.length) {
|
|
6719
|
-
positives = parts.positives.join('|');
|
|
6729
|
+
positives = parts.positives.map(v => toMaxLen(String(v), maxLen)).join('|');
|
|
6720
6730
|
}
|
|
6721
6731
|
|
|
6722
6732
|
if (parts.negatives.length) {
|
|
6723
|
-
negatives = `-(${prefix}${parts.negatives.join('|')})`;
|
|
6733
|
+
negatives = `-(${prefix}${parts.negatives.map(v => toMaxLen(String(v), maxLen)).join('|')})`;
|
|
6724
6734
|
}
|
|
6725
6735
|
|
|
6726
6736
|
if (positives && negatives) {
|
|
@@ -6818,7 +6828,7 @@ const fillNumbers = (start, end, step = 1, options = {}) => {
|
|
|
6818
6828
|
|
|
6819
6829
|
if (options.toRegex === true) {
|
|
6820
6830
|
return step > 1
|
|
6821
|
-
? toSequence(parts, options)
|
|
6831
|
+
? toSequence(parts, options, maxLen)
|
|
6822
6832
|
: toRegex(range, null, { wrap: false, ...options });
|
|
6823
6833
|
}
|
|
6824
6834
|
|
|
@@ -6830,7 +6840,6 @@ const fillLetters = (start, end, step = 1, options = {}) => {
|
|
|
6830
6840
|
return invalidRange(start, end, options);
|
|
6831
6841
|
}
|
|
6832
6842
|
|
|
6833
|
-
|
|
6834
6843
|
let format = options.transform || (val => String.fromCharCode(val));
|
|
6835
6844
|
let a = `${start}`.charCodeAt(0);
|
|
6836
6845
|
let b = `${end}`.charCodeAt(0);
|
|
@@ -6898,30 +6907,32 @@ const fill$1 = fillRange;
|
|
|
6898
6907
|
const utils$i = utils$k;
|
|
6899
6908
|
|
|
6900
6909
|
const compile$1 = (ast, options = {}) => {
|
|
6901
|
-
|
|
6902
|
-
|
|
6903
|
-
|
|
6904
|
-
|
|
6905
|
-
|
|
6910
|
+
const walk = (node, parent = {}) => {
|
|
6911
|
+
const invalidBlock = utils$i.isInvalidBrace(parent);
|
|
6912
|
+
const invalidNode = node.invalid === true && options.escapeInvalid === true;
|
|
6913
|
+
const invalid = invalidBlock === true || invalidNode === true;
|
|
6914
|
+
const prefix = options.escapeInvalid === true ? '\\' : '';
|
|
6906
6915
|
let output = '';
|
|
6907
6916
|
|
|
6908
6917
|
if (node.isOpen === true) {
|
|
6909
6918
|
return prefix + node.value;
|
|
6910
6919
|
}
|
|
6920
|
+
|
|
6911
6921
|
if (node.isClose === true) {
|
|
6922
|
+
console.log('node.isClose', prefix, node.value);
|
|
6912
6923
|
return prefix + node.value;
|
|
6913
6924
|
}
|
|
6914
6925
|
|
|
6915
6926
|
if (node.type === 'open') {
|
|
6916
|
-
return invalid ?
|
|
6927
|
+
return invalid ? prefix + node.value : '(';
|
|
6917
6928
|
}
|
|
6918
6929
|
|
|
6919
6930
|
if (node.type === 'close') {
|
|
6920
|
-
return invalid ?
|
|
6931
|
+
return invalid ? prefix + node.value : ')';
|
|
6921
6932
|
}
|
|
6922
6933
|
|
|
6923
6934
|
if (node.type === 'comma') {
|
|
6924
|
-
return node.prev.type === 'comma' ? '' :
|
|
6935
|
+
return node.prev.type === 'comma' ? '' : invalid ? node.value : '|';
|
|
6925
6936
|
}
|
|
6926
6937
|
|
|
6927
6938
|
if (node.value) {
|
|
@@ -6929,8 +6940,8 @@ const compile$1 = (ast, options = {}) => {
|
|
|
6929
6940
|
}
|
|
6930
6941
|
|
|
6931
6942
|
if (node.nodes && node.ranges > 0) {
|
|
6932
|
-
|
|
6933
|
-
|
|
6943
|
+
const args = utils$i.reduce(node.nodes);
|
|
6944
|
+
const range = fill$1(...args, { ...options, wrap: false, toRegex: true, strictZeros: true });
|
|
6934
6945
|
|
|
6935
6946
|
if (range.length !== 0) {
|
|
6936
6947
|
return args.length > 1 && range.length > 1 ? `(${range})` : range;
|
|
@@ -6938,10 +6949,11 @@ const compile$1 = (ast, options = {}) => {
|
|
|
6938
6949
|
}
|
|
6939
6950
|
|
|
6940
6951
|
if (node.nodes) {
|
|
6941
|
-
for (
|
|
6952
|
+
for (const child of node.nodes) {
|
|
6942
6953
|
output += walk(child, node);
|
|
6943
6954
|
}
|
|
6944
6955
|
}
|
|
6956
|
+
|
|
6945
6957
|
return output;
|
|
6946
6958
|
};
|
|
6947
6959
|
|
|
@@ -6955,7 +6967,7 @@ const stringify$2 = stringify$4;
|
|
|
6955
6967
|
const utils$h = utils$k;
|
|
6956
6968
|
|
|
6957
6969
|
const append = (queue = '', stash = '', enclose = false) => {
|
|
6958
|
-
|
|
6970
|
+
const result = [];
|
|
6959
6971
|
|
|
6960
6972
|
queue = [].concat(queue);
|
|
6961
6973
|
stash = [].concat(stash);
|
|
@@ -6965,15 +6977,15 @@ const append = (queue = '', stash = '', enclose = false) => {
|
|
|
6965
6977
|
return enclose ? utils$h.flatten(stash).map(ele => `{${ele}}`) : stash;
|
|
6966
6978
|
}
|
|
6967
6979
|
|
|
6968
|
-
for (
|
|
6980
|
+
for (const item of queue) {
|
|
6969
6981
|
if (Array.isArray(item)) {
|
|
6970
|
-
for (
|
|
6982
|
+
for (const value of item) {
|
|
6971
6983
|
result.push(append(value, stash, enclose));
|
|
6972
6984
|
}
|
|
6973
6985
|
} else {
|
|
6974
6986
|
for (let ele of stash) {
|
|
6975
6987
|
if (enclose === true && typeof ele === 'string') ele = `{${ele}}`;
|
|
6976
|
-
result.push(Array.isArray(ele) ? append(item, ele, enclose) :
|
|
6988
|
+
result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
|
|
6977
6989
|
}
|
|
6978
6990
|
}
|
|
6979
6991
|
}
|
|
@@ -6981,9 +6993,9 @@ const append = (queue = '', stash = '', enclose = false) => {
|
|
|
6981
6993
|
};
|
|
6982
6994
|
|
|
6983
6995
|
const expand$2 = (ast, options = {}) => {
|
|
6984
|
-
|
|
6996
|
+
const rangeLimit = options.rangeLimit === undefined ? 1000 : options.rangeLimit;
|
|
6985
6997
|
|
|
6986
|
-
|
|
6998
|
+
const walk = (node, parent = {}) => {
|
|
6987
6999
|
node.queue = [];
|
|
6988
7000
|
|
|
6989
7001
|
let p = parent;
|
|
@@ -7005,7 +7017,7 @@ const expand$2 = (ast, options = {}) => {
|
|
|
7005
7017
|
}
|
|
7006
7018
|
|
|
7007
7019
|
if (node.nodes && node.ranges > 0) {
|
|
7008
|
-
|
|
7020
|
+
const args = utils$h.reduce(node.nodes);
|
|
7009
7021
|
|
|
7010
7022
|
if (utils$h.exceedsLimit(...args, options.step, rangeLimit)) {
|
|
7011
7023
|
throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.');
|
|
@@ -7021,7 +7033,7 @@ const expand$2 = (ast, options = {}) => {
|
|
|
7021
7033
|
return;
|
|
7022
7034
|
}
|
|
7023
7035
|
|
|
7024
|
-
|
|
7036
|
+
const enclose = utils$h.encloseBrace(node);
|
|
7025
7037
|
let queue = node.queue;
|
|
7026
7038
|
let block = node;
|
|
7027
7039
|
|
|
@@ -7031,7 +7043,7 @@ const expand$2 = (ast, options = {}) => {
|
|
|
7031
7043
|
}
|
|
7032
7044
|
|
|
7033
7045
|
for (let i = 0; i < node.nodes.length; i++) {
|
|
7034
|
-
|
|
7046
|
+
const child = node.nodes[i];
|
|
7035
7047
|
|
|
7036
7048
|
if (child.type === 'comma' && node.type === 'brace') {
|
|
7037
7049
|
if (i === 1) queue.push('');
|
|
@@ -7063,7 +7075,7 @@ const expand$2 = (ast, options = {}) => {
|
|
|
7063
7075
|
var expand_1 = expand$2;
|
|
7064
7076
|
|
|
7065
7077
|
var constants$c = {
|
|
7066
|
-
MAX_LENGTH:
|
|
7078
|
+
MAX_LENGTH: 10000,
|
|
7067
7079
|
|
|
7068
7080
|
// Digits
|
|
7069
7081
|
CHAR_0: '0', /* 0 */
|
|
@@ -7151,18 +7163,18 @@ const parse$5 = (input, options = {}) => {
|
|
|
7151
7163
|
throw new TypeError('Expected a string');
|
|
7152
7164
|
}
|
|
7153
7165
|
|
|
7154
|
-
|
|
7155
|
-
|
|
7166
|
+
const opts = options || {};
|
|
7167
|
+
const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH$1, opts.maxLength) : MAX_LENGTH$1;
|
|
7156
7168
|
if (input.length > max) {
|
|
7157
7169
|
throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
|
|
7158
7170
|
}
|
|
7159
7171
|
|
|
7160
|
-
|
|
7161
|
-
|
|
7172
|
+
const ast = { type: 'root', input, nodes: [] };
|
|
7173
|
+
const stack = [ast];
|
|
7162
7174
|
let block = ast;
|
|
7163
7175
|
let prev = ast;
|
|
7164
7176
|
let brackets = 0;
|
|
7165
|
-
|
|
7177
|
+
const length = input.length;
|
|
7166
7178
|
let index = 0;
|
|
7167
7179
|
let depth = 0;
|
|
7168
7180
|
let value;
|
|
@@ -7227,6 +7239,7 @@ const parse$5 = (input, options = {}) => {
|
|
|
7227
7239
|
|
|
7228
7240
|
if (value === CHAR_LEFT_SQUARE_BRACKET$1) {
|
|
7229
7241
|
brackets++;
|
|
7242
|
+
|
|
7230
7243
|
let next;
|
|
7231
7244
|
|
|
7232
7245
|
while (index < length && (next = advance())) {
|
|
@@ -7282,7 +7295,7 @@ const parse$5 = (input, options = {}) => {
|
|
|
7282
7295
|
*/
|
|
7283
7296
|
|
|
7284
7297
|
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
|
7285
|
-
|
|
7298
|
+
const open = value;
|
|
7286
7299
|
let next;
|
|
7287
7300
|
|
|
7288
7301
|
if (options.keepQuotes !== true) {
|
|
@@ -7314,8 +7327,8 @@ const parse$5 = (input, options = {}) => {
|
|
|
7314
7327
|
if (value === CHAR_LEFT_CURLY_BRACE$1) {
|
|
7315
7328
|
depth++;
|
|
7316
7329
|
|
|
7317
|
-
|
|
7318
|
-
|
|
7330
|
+
const dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true;
|
|
7331
|
+
const brace = {
|
|
7319
7332
|
type: 'brace',
|
|
7320
7333
|
open: true,
|
|
7321
7334
|
close: false,
|
|
@@ -7342,7 +7355,7 @@ const parse$5 = (input, options = {}) => {
|
|
|
7342
7355
|
continue;
|
|
7343
7356
|
}
|
|
7344
7357
|
|
|
7345
|
-
|
|
7358
|
+
const type = 'close';
|
|
7346
7359
|
block = stack.pop();
|
|
7347
7360
|
block.close = true;
|
|
7348
7361
|
|
|
@@ -7360,7 +7373,7 @@ const parse$5 = (input, options = {}) => {
|
|
|
7360
7373
|
if (value === CHAR_COMMA$1 && depth > 0) {
|
|
7361
7374
|
if (block.ranges > 0) {
|
|
7362
7375
|
block.ranges = 0;
|
|
7363
|
-
|
|
7376
|
+
const open = block.nodes.shift();
|
|
7364
7377
|
block.nodes = [open, { type: 'text', value: stringify$1(block) }];
|
|
7365
7378
|
}
|
|
7366
7379
|
|
|
@@ -7374,7 +7387,7 @@ const parse$5 = (input, options = {}) => {
|
|
|
7374
7387
|
*/
|
|
7375
7388
|
|
|
7376
7389
|
if (value === CHAR_DOT$1 && depth > 0 && block.commas === 0) {
|
|
7377
|
-
|
|
7390
|
+
const siblings = block.nodes;
|
|
7378
7391
|
|
|
7379
7392
|
if (depth === 0 || siblings.length === 0) {
|
|
7380
7393
|
push({ type: 'text', value });
|
|
@@ -7401,7 +7414,7 @@ const parse$5 = (input, options = {}) => {
|
|
|
7401
7414
|
if (prev.type === 'range') {
|
|
7402
7415
|
siblings.pop();
|
|
7403
7416
|
|
|
7404
|
-
|
|
7417
|
+
const before = siblings[siblings.length - 1];
|
|
7405
7418
|
before.value += prev.value + value;
|
|
7406
7419
|
prev = before;
|
|
7407
7420
|
block.ranges--;
|
|
@@ -7434,8 +7447,8 @@ const parse$5 = (input, options = {}) => {
|
|
|
7434
7447
|
});
|
|
7435
7448
|
|
|
7436
7449
|
// get the location of the block on parent.nodes (block's siblings)
|
|
7437
|
-
|
|
7438
|
-
|
|
7450
|
+
const parent = stack[stack.length - 1];
|
|
7451
|
+
const index = parent.nodes.indexOf(block);
|
|
7439
7452
|
// replace the (invalid) block with it's nodes
|
|
7440
7453
|
parent.nodes.splice(index, 1, ...block.nodes);
|
|
7441
7454
|
}
|
|
@@ -7470,8 +7483,8 @@ const braces$1 = (input, options = {}) => {
|
|
|
7470
7483
|
let output = [];
|
|
7471
7484
|
|
|
7472
7485
|
if (Array.isArray(input)) {
|
|
7473
|
-
for (
|
|
7474
|
-
|
|
7486
|
+
for (const pattern of input) {
|
|
7487
|
+
const result = braces$1.create(pattern, options);
|
|
7475
7488
|
if (Array.isArray(result)) {
|
|
7476
7489
|
output.push(...result);
|
|
7477
7490
|
} else {
|
|
@@ -7605,7 +7618,7 @@ braces$1.create = (input, options = {}) => {
|
|
|
7605
7618
|
return [input];
|
|
7606
7619
|
}
|
|
7607
7620
|
|
|
7608
|
-
|
|
7621
|
+
return options.expand !== true
|
|
7609
7622
|
? braces$1.compile(input, options)
|
|
7610
7623
|
: braces$1.expand(input, options);
|
|
7611
7624
|
};
|
|
@@ -14142,13 +14155,13 @@ class ImageUploader {
|
|
|
14142
14155
|
await test$1.expect(this.page.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.uploadedImage)).toBeHidden();
|
|
14143
14156
|
};
|
|
14144
14157
|
this.openImageLibrary = async () => {
|
|
14145
|
-
const fetchImages = this.neetoPlaywrightUtilities.interceptMultipleResponses({
|
|
14146
|
-
responseUrl: NEETO_ROUTES.imageUploader,
|
|
14147
|
-
});
|
|
14148
14158
|
await this.page
|
|
14149
14159
|
.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.openAssetLibraryButton)
|
|
14150
14160
|
.click();
|
|
14151
|
-
await
|
|
14161
|
+
await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.modalHeader)).toBeVisible({ timeout: 30000 });
|
|
14162
|
+
await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.spinner)).toBeHidden({
|
|
14163
|
+
timeout: 30000,
|
|
14164
|
+
});
|
|
14152
14165
|
};
|
|
14153
14166
|
this.cropImage = async ({ toggleAspectRatioLock = false, width = "100", height = "100", aspectRatioHeight = "9", aspectRatioWidth = "16", } = {}) => {
|
|
14154
14167
|
toggleAspectRatioLock &&
|