@bigbinary/neeto-playwright-commons 1.1.0 → 1.1.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.
- package/README.md +16 -0
- package/configs/eslint/common.js +88 -0
- package/configs/eslint/host.js +15 -0
- package/index.cjs.js +774 -214
- package/index.cjs.js.map +1 -1
- package/index.d.ts +142 -37
- package/index.js +744 -186
- package/index.js.map +1 -1
- package/package.json +25 -107
package/index.cjs.js
CHANGED
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var require$$0 = require('
|
|
7
|
-
var require$$
|
|
8
|
-
var require$$0
|
|
9
|
-
var require$$0$
|
|
5
|
+
var test = require('@playwright/test');
|
|
6
|
+
var require$$0$3 = require('fs');
|
|
7
|
+
var require$$2 = require('os');
|
|
8
|
+
var require$$0 = require('path');
|
|
9
|
+
var require$$0$1 = require('util');
|
|
10
|
+
var require$$0$2 = require('stream');
|
|
10
11
|
var require$$0$4 = require('events');
|
|
11
12
|
var ramda = require('ramda');
|
|
12
13
|
var dayjs = require('dayjs');
|
|
13
|
-
var
|
|
14
|
+
var require$$3 = require('crypto');
|
|
14
15
|
|
|
15
16
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
17
|
|
|
@@ -32,34 +33,17 @@ function _interopNamespace(e) {
|
|
|
32
33
|
return Object.freeze(n);
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
var
|
|
36
|
-
var
|
|
36
|
+
var require$$0__default$3 = /*#__PURE__*/_interopDefaultLegacy(require$$0$3);
|
|
37
|
+
var require$$0__namespace = /*#__PURE__*/_interopNamespace(require$$0$3);
|
|
38
|
+
var require$$2__default = /*#__PURE__*/_interopDefaultLegacy(require$$2);
|
|
37
39
|
var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
|
|
38
40
|
var require$$0__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$0$1);
|
|
39
41
|
var require$$0__default$2 = /*#__PURE__*/_interopDefaultLegacy(require$$0$2);
|
|
40
|
-
var require$$0__default$3 = /*#__PURE__*/_interopDefaultLegacy(require$$0$3);
|
|
41
42
|
var require$$0__default$4 = /*#__PURE__*/_interopDefaultLegacy(require$$0$4);
|
|
42
43
|
var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
|
|
44
|
+
var require$$3__default = /*#__PURE__*/_interopDefaultLegacy(require$$3);
|
|
43
45
|
|
|
44
|
-
const
|
|
45
|
-
development: "development",
|
|
46
|
-
staging: "staging",
|
|
47
|
-
review: "review",
|
|
48
|
-
};
|
|
49
|
-
const IS_STAGING_ENV = process.env.TEST_ENV === "staging";
|
|
50
|
-
const STORAGE_STATE$1 = "./e2e/auth/user.json";
|
|
51
|
-
const GLOBAL_TRANSLATIONS_PATTERN = "../node_modules/@bigbinary/**/translations/en.json";
|
|
52
|
-
const PROJECT_TRANSLATIONS_PATH = "../app/javascript/src/translations/en.json";
|
|
53
|
-
|
|
54
|
-
const BASE_URL = "/api/v1";
|
|
55
|
-
const PROFILE_PATH = "/profile";
|
|
56
|
-
const LOGIN_PATH = `${BASE_URL}/login`;
|
|
57
|
-
const SIGNUP_PATH = `${BASE_URL}/signups`;
|
|
58
|
-
const SUBDOMAIN_AVAILABILITY_PATH = `${BASE_URL}/subdomain_availability`;
|
|
59
|
-
const COUNTRIES_PATH = `${BASE_URL}/countries`;
|
|
60
|
-
const NEETO_APPS_PATH = `${BASE_URL}/neeto_apps`;
|
|
61
|
-
|
|
62
|
-
const COMMON_SELECTORS$1 = {
|
|
46
|
+
const COMMON_SELECTORS = {
|
|
63
47
|
toastMessage: "toastr-message-container",
|
|
64
48
|
toastIcon: ".Toastify__toast-icon",
|
|
65
49
|
toastCloseButton: "toastr-close-button",
|
|
@@ -72,21 +56,6 @@ const COMMON_SELECTORS$1 = {
|
|
|
72
56
|
subheaderText: "subheader-left",
|
|
73
57
|
};
|
|
74
58
|
|
|
75
|
-
const SIGNUP_SELECTORS = {
|
|
76
|
-
emailField: "signup-email-text-field",
|
|
77
|
-
signupButton: "signup-email-submit-button",
|
|
78
|
-
otpInput: "otpinput-otp-number",
|
|
79
|
-
organizationField: "signup-organization-name-text-field",
|
|
80
|
-
subdomainField: "signup-organization-subdomain-text-field",
|
|
81
|
-
submitButton: "signup-organization-submit-button",
|
|
82
|
-
firstNameField: "signup-profile-first-name-text-field",
|
|
83
|
-
lastNameField: "signup-profile-last-name-text-field",
|
|
84
|
-
profileSubmitButton: "signup-profile-submit-button",
|
|
85
|
-
subdomainInputError: "subdomain-input-error",
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
const COMMON_TEXTS = { edit: "Edit" };
|
|
89
|
-
|
|
90
59
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
91
60
|
|
|
92
61
|
var tasks = {};
|
|
@@ -126,10 +95,10 @@ function isEnoentCodeError(error) {
|
|
|
126
95
|
}
|
|
127
96
|
errno$1.isEnoentCodeError = isEnoentCodeError;
|
|
128
97
|
|
|
129
|
-
var fs$
|
|
98
|
+
var fs$8 = {};
|
|
130
99
|
|
|
131
|
-
Object.defineProperty(fs$
|
|
132
|
-
fs$
|
|
100
|
+
Object.defineProperty(fs$8, "__esModule", { value: true });
|
|
101
|
+
fs$8.createDirentFromStats = void 0;
|
|
133
102
|
class DirentFromStats$1 {
|
|
134
103
|
constructor(name, stats) {
|
|
135
104
|
this.name = name;
|
|
@@ -145,15 +114,15 @@ class DirentFromStats$1 {
|
|
|
145
114
|
function createDirentFromStats$1(name, stats) {
|
|
146
115
|
return new DirentFromStats$1(name, stats);
|
|
147
116
|
}
|
|
148
|
-
fs$
|
|
117
|
+
fs$8.createDirentFromStats = createDirentFromStats$1;
|
|
149
118
|
|
|
150
|
-
var path$
|
|
119
|
+
var path$a = {};
|
|
151
120
|
|
|
152
|
-
Object.defineProperty(path$
|
|
153
|
-
path$
|
|
154
|
-
const os = require$$
|
|
155
|
-
const path$
|
|
156
|
-
const IS_WINDOWS_PLATFORM = os.platform() === 'win32';
|
|
121
|
+
Object.defineProperty(path$a, "__esModule", { value: true });
|
|
122
|
+
path$a.convertPosixPathToPattern = path$a.convertWindowsPathToPattern = path$a.convertPathToPattern = path$a.escapePosixPath = path$a.escapeWindowsPath = path$a.escape = path$a.removeLeadingDotSegment = path$a.makeAbsolute = path$a.unixify = void 0;
|
|
123
|
+
const os$1 = require$$2__default["default"];
|
|
124
|
+
const path$9 = require$$0__default["default"];
|
|
125
|
+
const IS_WINDOWS_PLATFORM = os$1.platform() === 'win32';
|
|
157
126
|
const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\
|
|
158
127
|
/**
|
|
159
128
|
* All non-escaped special characters.
|
|
@@ -179,11 +148,11 @@ const WINDOWS_BACKSLASHES_RE = /\\(?![!()+@[\]{}])/g;
|
|
|
179
148
|
function unixify(filepath) {
|
|
180
149
|
return filepath.replace(/\\/g, '/');
|
|
181
150
|
}
|
|
182
|
-
path$
|
|
151
|
+
path$a.unixify = unixify;
|
|
183
152
|
function makeAbsolute(cwd, filepath) {
|
|
184
|
-
return path$
|
|
153
|
+
return path$9.resolve(cwd, filepath);
|
|
185
154
|
}
|
|
186
|
-
path$
|
|
155
|
+
path$a.makeAbsolute = makeAbsolute;
|
|
187
156
|
function removeLeadingDotSegment(entry) {
|
|
188
157
|
// We do not use `startsWith` because this is 10x slower than current implementation for some cases.
|
|
189
158
|
// eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with
|
|
@@ -195,27 +164,27 @@ function removeLeadingDotSegment(entry) {
|
|
|
195
164
|
}
|
|
196
165
|
return entry;
|
|
197
166
|
}
|
|
198
|
-
path$
|
|
199
|
-
path$
|
|
167
|
+
path$a.removeLeadingDotSegment = removeLeadingDotSegment;
|
|
168
|
+
path$a.escape = IS_WINDOWS_PLATFORM ? escapeWindowsPath : escapePosixPath;
|
|
200
169
|
function escapeWindowsPath(pattern) {
|
|
201
170
|
return pattern.replace(WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE, '\\$2');
|
|
202
171
|
}
|
|
203
|
-
path$
|
|
172
|
+
path$a.escapeWindowsPath = escapeWindowsPath;
|
|
204
173
|
function escapePosixPath(pattern) {
|
|
205
174
|
return pattern.replace(POSIX_UNESCAPED_GLOB_SYMBOLS_RE, '\\$2');
|
|
206
175
|
}
|
|
207
|
-
path$
|
|
208
|
-
path$
|
|
176
|
+
path$a.escapePosixPath = escapePosixPath;
|
|
177
|
+
path$a.convertPathToPattern = IS_WINDOWS_PLATFORM ? convertWindowsPathToPattern : convertPosixPathToPattern;
|
|
209
178
|
function convertWindowsPathToPattern(filepath) {
|
|
210
179
|
return escapeWindowsPath(filepath)
|
|
211
180
|
.replace(DOS_DEVICE_PATH_RE, '//$1')
|
|
212
181
|
.replace(WINDOWS_BACKSLASHES_RE, '/');
|
|
213
182
|
}
|
|
214
|
-
path$
|
|
183
|
+
path$a.convertWindowsPathToPattern = convertWindowsPathToPattern;
|
|
215
184
|
function convertPosixPathToPattern(filepath) {
|
|
216
185
|
return escapePosixPath(filepath);
|
|
217
186
|
}
|
|
218
|
-
path$
|
|
187
|
+
path$a.convertPosixPathToPattern = convertPosixPathToPattern;
|
|
219
188
|
|
|
220
189
|
var pattern$1 = {};
|
|
221
190
|
|
|
@@ -392,8 +361,8 @@ var isGlob$1 = function isGlob(str, options) {
|
|
|
392
361
|
};
|
|
393
362
|
|
|
394
363
|
var isGlob = isGlob$1;
|
|
395
|
-
var pathPosixDirname = require$$0__default
|
|
396
|
-
var isWin32 = require$$
|
|
364
|
+
var pathPosixDirname = require$$0__default["default"].posix.dirname;
|
|
365
|
+
var isWin32 = require$$2__default["default"].platform() === 'win32';
|
|
397
366
|
|
|
398
367
|
var slash = '/';
|
|
399
368
|
var backslash = /\\/g;
|
|
@@ -889,7 +858,7 @@ var toRegexRange_1 = toRegexRange$1;
|
|
|
889
858
|
* Licensed under the MIT License.
|
|
890
859
|
*/
|
|
891
860
|
|
|
892
|
-
const util$1 = require$$0__default$
|
|
861
|
+
const util$1 = require$$0__default$1["default"];
|
|
893
862
|
const toRegexRange = toRegexRange_1;
|
|
894
863
|
|
|
895
864
|
const isObject$1 = val => val !== null && typeof val === 'object' && !Array.isArray(val);
|
|
@@ -1382,7 +1351,7 @@ const {
|
|
|
1382
1351
|
* parse
|
|
1383
1352
|
*/
|
|
1384
1353
|
|
|
1385
|
-
const parse$
|
|
1354
|
+
const parse$4 = (input, options = {}) => {
|
|
1386
1355
|
if (typeof input !== 'string') {
|
|
1387
1356
|
throw new TypeError('Expected a string');
|
|
1388
1357
|
}
|
|
@@ -1681,12 +1650,12 @@ const parse$3 = (input, options = {}) => {
|
|
|
1681
1650
|
return ast;
|
|
1682
1651
|
};
|
|
1683
1652
|
|
|
1684
|
-
var parse_1$1 = parse$
|
|
1653
|
+
var parse_1$1 = parse$4;
|
|
1685
1654
|
|
|
1686
1655
|
const stringify = stringify$4;
|
|
1687
1656
|
const compile = compile_1;
|
|
1688
1657
|
const expand = expand_1;
|
|
1689
|
-
const parse$
|
|
1658
|
+
const parse$3 = parse_1$1;
|
|
1690
1659
|
|
|
1691
1660
|
/**
|
|
1692
1661
|
* Expand the given pattern or create a regex-compatible string.
|
|
@@ -1738,7 +1707,7 @@ const braces$1 = (input, options = {}) => {
|
|
|
1738
1707
|
* @api public
|
|
1739
1708
|
*/
|
|
1740
1709
|
|
|
1741
|
-
braces$1.parse = (input, options = {}) => parse$
|
|
1710
|
+
braces$1.parse = (input, options = {}) => parse$3(input, options);
|
|
1742
1711
|
|
|
1743
1712
|
/**
|
|
1744
1713
|
* Creates a braces string from an AST, or an AST node.
|
|
@@ -1856,7 +1825,7 @@ var picomatch$2 = {exports: {}};
|
|
|
1856
1825
|
|
|
1857
1826
|
var utils$f = {};
|
|
1858
1827
|
|
|
1859
|
-
const path$
|
|
1828
|
+
const path$8 = require$$0__default["default"];
|
|
1860
1829
|
const WIN_SLASH = '\\\\/';
|
|
1861
1830
|
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
1862
1831
|
|
|
@@ -2009,7 +1978,7 @@ var constants$3 = {
|
|
|
2009
1978
|
CHAR_VERTICAL_LINE: 124, /* | */
|
|
2010
1979
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */
|
|
2011
1980
|
|
|
2012
|
-
SEP: path$
|
|
1981
|
+
SEP: path$8.sep,
|
|
2013
1982
|
|
|
2014
1983
|
/**
|
|
2015
1984
|
* Create EXTGLOB_CHARS
|
|
@@ -2036,7 +2005,7 @@ var constants$3 = {
|
|
|
2036
2005
|
|
|
2037
2006
|
(function (exports) {
|
|
2038
2007
|
|
|
2039
|
-
const path = require$$0__default
|
|
2008
|
+
const path = require$$0__default["default"];
|
|
2040
2009
|
const win32 = process.platform === 'win32';
|
|
2041
2010
|
const {
|
|
2042
2011
|
REGEX_BACKSLASH,
|
|
@@ -2542,7 +2511,7 @@ const syntaxError = (type, char) => {
|
|
|
2542
2511
|
* @return {Object}
|
|
2543
2512
|
*/
|
|
2544
2513
|
|
|
2545
|
-
const parse$
|
|
2514
|
+
const parse$2 = (input, options) => {
|
|
2546
2515
|
if (typeof input !== 'string') {
|
|
2547
2516
|
throw new TypeError('Expected a string');
|
|
2548
2517
|
}
|
|
@@ -2745,7 +2714,7 @@ const parse$1 = (input, options) => {
|
|
|
2745
2714
|
// Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`.
|
|
2746
2715
|
//
|
|
2747
2716
|
// Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`.
|
|
2748
|
-
const expression = parse$
|
|
2717
|
+
const expression = parse$2(rest, { ...options, fastpaths: false }).output;
|
|
2749
2718
|
|
|
2750
2719
|
output = token.close = `)${expression})${extglobStar})`;
|
|
2751
2720
|
}
|
|
@@ -3491,7 +3460,7 @@ const parse$1 = (input, options) => {
|
|
|
3491
3460
|
* impact when none of the fast paths match.
|
|
3492
3461
|
*/
|
|
3493
3462
|
|
|
3494
|
-
parse$
|
|
3463
|
+
parse$2.fastpaths = (input, options) => {
|
|
3495
3464
|
const opts = { ...options };
|
|
3496
3465
|
const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
3497
3466
|
const len = input.length;
|
|
@@ -3578,11 +3547,11 @@ parse$1.fastpaths = (input, options) => {
|
|
|
3578
3547
|
return source;
|
|
3579
3548
|
};
|
|
3580
3549
|
|
|
3581
|
-
var parse_1 = parse$
|
|
3550
|
+
var parse_1 = parse$2;
|
|
3582
3551
|
|
|
3583
|
-
const path$
|
|
3552
|
+
const path$7 = require$$0__default["default"];
|
|
3584
3553
|
const scan = scan_1;
|
|
3585
|
-
const parse = parse_1;
|
|
3554
|
+
const parse$1 = parse_1;
|
|
3586
3555
|
const utils$c = utils$f;
|
|
3587
3556
|
const constants$1 = constants$3;
|
|
3588
3557
|
const isObject = val => val && typeof val === 'object' && !Array.isArray(val);
|
|
@@ -3740,7 +3709,7 @@ picomatch$1.test = (input, regex, options, { glob, posix } = {}) => {
|
|
|
3740
3709
|
|
|
3741
3710
|
picomatch$1.matchBase = (input, glob, options, posix = utils$c.isWindows(options)) => {
|
|
3742
3711
|
const regex = glob instanceof RegExp ? glob : picomatch$1.makeRe(glob, options);
|
|
3743
|
-
return regex.test(path$
|
|
3712
|
+
return regex.test(path$7.basename(input));
|
|
3744
3713
|
};
|
|
3745
3714
|
|
|
3746
3715
|
/**
|
|
@@ -3778,7 +3747,7 @@ picomatch$1.isMatch = (str, patterns, options) => picomatch$1(patterns, options)
|
|
|
3778
3747
|
|
|
3779
3748
|
picomatch$1.parse = (pattern, options) => {
|
|
3780
3749
|
if (Array.isArray(pattern)) return pattern.map(p => picomatch$1.parse(p, options));
|
|
3781
|
-
return parse(pattern, { ...options, fastpaths: false });
|
|
3750
|
+
return parse$1(pattern, { ...options, fastpaths: false });
|
|
3782
3751
|
};
|
|
3783
3752
|
|
|
3784
3753
|
/**
|
|
@@ -3871,11 +3840,11 @@ picomatch$1.makeRe = (input, options = {}, returnOutput = false, returnState = f
|
|
|
3871
3840
|
let parsed = { negated: false, fastpaths: true };
|
|
3872
3841
|
|
|
3873
3842
|
if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {
|
|
3874
|
-
parsed.output = parse.fastpaths(input, options);
|
|
3843
|
+
parsed.output = parse$1.fastpaths(input, options);
|
|
3875
3844
|
}
|
|
3876
3845
|
|
|
3877
3846
|
if (!parsed.output) {
|
|
3878
|
-
parsed = parse(input, options);
|
|
3847
|
+
parsed = parse$1(input, options);
|
|
3879
3848
|
}
|
|
3880
3849
|
|
|
3881
3850
|
return picomatch$1.compileRe(parsed, options, returnOutput, returnState);
|
|
@@ -3926,7 +3895,7 @@ var picomatch_1 = picomatch$1;
|
|
|
3926
3895
|
module.exports = picomatch_1;
|
|
3927
3896
|
} (picomatch$2));
|
|
3928
3897
|
|
|
3929
|
-
const util = require$$0__default$
|
|
3898
|
+
const util = require$$0__default$1["default"];
|
|
3930
3899
|
const braces = braces_1;
|
|
3931
3900
|
const picomatch = picomatch$2.exports;
|
|
3932
3901
|
const utils$b = utils$f;
|
|
@@ -4394,7 +4363,7 @@ var micromatch_1 = micromatch$1;
|
|
|
4394
4363
|
|
|
4395
4364
|
Object.defineProperty(pattern$1, "__esModule", { value: true });
|
|
4396
4365
|
pattern$1.removeDuplicateSlashes = pattern$1.matchAny = pattern$1.convertPatternsToRe = pattern$1.makeRe = pattern$1.getPatternParts = pattern$1.expandBraceExpansion = pattern$1.expandPatternsWithBraceExpansion = pattern$1.isAffectDepthOfReadingPattern = pattern$1.endsWithSlashGlobStar = pattern$1.hasGlobStar = pattern$1.getBaseDirectory = pattern$1.isPatternRelatedToParentDirectory = pattern$1.getPatternsOutsideCurrentDirectory = pattern$1.getPatternsInsideCurrentDirectory = pattern$1.getPositivePatterns = pattern$1.getNegativePatterns = pattern$1.isPositivePattern = pattern$1.isNegativePattern = pattern$1.convertToNegativePattern = pattern$1.convertToPositivePattern = pattern$1.isDynamicPattern = pattern$1.isStaticPattern = void 0;
|
|
4397
|
-
const path$
|
|
4366
|
+
const path$6 = require$$0__default["default"];
|
|
4398
4367
|
const globParent = globParent$1;
|
|
4399
4368
|
const micromatch = micromatch_1;
|
|
4400
4369
|
const GLOBSTAR = '**';
|
|
@@ -4516,7 +4485,7 @@ function endsWithSlashGlobStar(pattern) {
|
|
|
4516
4485
|
}
|
|
4517
4486
|
pattern$1.endsWithSlashGlobStar = endsWithSlashGlobStar;
|
|
4518
4487
|
function isAffectDepthOfReadingPattern(pattern) {
|
|
4519
|
-
const basename = path$
|
|
4488
|
+
const basename = path$6.basename(pattern);
|
|
4520
4489
|
return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
|
|
4521
4490
|
}
|
|
4522
4491
|
pattern$1.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
|
|
@@ -4589,7 +4558,7 @@ var stream$4 = {};
|
|
|
4589
4558
|
* Copyright (c) 2014-2020 Teambition
|
|
4590
4559
|
* Licensed under the MIT license.
|
|
4591
4560
|
*/
|
|
4592
|
-
const Stream = require$$0__default$
|
|
4561
|
+
const Stream = require$$0__default$2["default"];
|
|
4593
4562
|
const PassThrough = Stream.PassThrough;
|
|
4594
4563
|
const slice = Array.prototype.slice;
|
|
4595
4564
|
|
|
@@ -4762,10 +4731,10 @@ const array = array$1;
|
|
|
4762
4731
|
utils$k.array = array;
|
|
4763
4732
|
const errno = errno$1;
|
|
4764
4733
|
utils$k.errno = errno;
|
|
4765
|
-
const fs$
|
|
4766
|
-
utils$k.fs = fs$
|
|
4767
|
-
const path$
|
|
4768
|
-
utils$k.path = path$
|
|
4734
|
+
const fs$7 = fs$8;
|
|
4735
|
+
utils$k.fs = fs$7;
|
|
4736
|
+
const path$5 = path$a;
|
|
4737
|
+
utils$k.path = path$5;
|
|
4769
4738
|
const pattern = pattern$1;
|
|
4770
4739
|
utils$k.pattern = pattern;
|
|
4771
4740
|
const stream$3 = stream$4;
|
|
@@ -4964,12 +4933,12 @@ sync$7.read = read$2;
|
|
|
4964
4933
|
|
|
4965
4934
|
var settings$3 = {};
|
|
4966
4935
|
|
|
4967
|
-
var fs$
|
|
4936
|
+
var fs$6 = {};
|
|
4968
4937
|
|
|
4969
4938
|
(function (exports) {
|
|
4970
4939
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4971
4940
|
exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
|
|
4972
|
-
const fs =
|
|
4941
|
+
const fs = require$$0__default$3["default"];
|
|
4973
4942
|
exports.FILE_SYSTEM_ADAPTER = {
|
|
4974
4943
|
lstat: fs.lstat,
|
|
4975
4944
|
stat: fs.stat,
|
|
@@ -4983,15 +4952,15 @@ var fs$5 = {};
|
|
|
4983
4952
|
return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
|
|
4984
4953
|
}
|
|
4985
4954
|
exports.createFileSystemAdapter = createFileSystemAdapter;
|
|
4986
|
-
} (fs$
|
|
4955
|
+
} (fs$6));
|
|
4987
4956
|
|
|
4988
4957
|
Object.defineProperty(settings$3, "__esModule", { value: true });
|
|
4989
|
-
const fs$
|
|
4958
|
+
const fs$5 = fs$6;
|
|
4990
4959
|
class Settings$2 {
|
|
4991
4960
|
constructor(_options = {}) {
|
|
4992
4961
|
this._options = _options;
|
|
4993
4962
|
this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
|
|
4994
|
-
this.fs = fs$
|
|
4963
|
+
this.fs = fs$5.createFileSystemAdapter(this._options.fs);
|
|
4995
4964
|
this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
|
|
4996
4965
|
this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
|
|
4997
4966
|
}
|
|
@@ -5112,10 +5081,10 @@ constants.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED
|
|
|
5112
5081
|
|
|
5113
5082
|
var utils$9 = {};
|
|
5114
5083
|
|
|
5115
|
-
var fs$
|
|
5084
|
+
var fs$4 = {};
|
|
5116
5085
|
|
|
5117
|
-
Object.defineProperty(fs$
|
|
5118
|
-
fs$
|
|
5086
|
+
Object.defineProperty(fs$4, "__esModule", { value: true });
|
|
5087
|
+
fs$4.createDirentFromStats = void 0;
|
|
5119
5088
|
class DirentFromStats {
|
|
5120
5089
|
constructor(name, stats) {
|
|
5121
5090
|
this.name = name;
|
|
@@ -5131,12 +5100,12 @@ class DirentFromStats {
|
|
|
5131
5100
|
function createDirentFromStats(name, stats) {
|
|
5132
5101
|
return new DirentFromStats(name, stats);
|
|
5133
5102
|
}
|
|
5134
|
-
fs$
|
|
5103
|
+
fs$4.createDirentFromStats = createDirentFromStats;
|
|
5135
5104
|
|
|
5136
5105
|
Object.defineProperty(utils$9, "__esModule", { value: true });
|
|
5137
5106
|
utils$9.fs = void 0;
|
|
5138
|
-
const fs$
|
|
5139
|
-
utils$9.fs = fs$
|
|
5107
|
+
const fs$3 = fs$4;
|
|
5108
|
+
utils$9.fs = fs$3;
|
|
5140
5109
|
|
|
5141
5110
|
var common$6 = {};
|
|
5142
5111
|
|
|
@@ -5315,12 +5284,12 @@ sync$5.readdir = readdir;
|
|
|
5315
5284
|
|
|
5316
5285
|
var settings$2 = {};
|
|
5317
5286
|
|
|
5318
|
-
var fs$
|
|
5287
|
+
var fs$2 = {};
|
|
5319
5288
|
|
|
5320
5289
|
(function (exports) {
|
|
5321
5290
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5322
5291
|
exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
|
|
5323
|
-
const fs =
|
|
5292
|
+
const fs = require$$0__default$3["default"];
|
|
5324
5293
|
exports.FILE_SYSTEM_ADAPTER = {
|
|
5325
5294
|
lstat: fs.lstat,
|
|
5326
5295
|
stat: fs.stat,
|
|
@@ -5336,18 +5305,18 @@ var fs$1 = {};
|
|
|
5336
5305
|
return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
|
|
5337
5306
|
}
|
|
5338
5307
|
exports.createFileSystemAdapter = createFileSystemAdapter;
|
|
5339
|
-
} (fs$
|
|
5308
|
+
} (fs$2));
|
|
5340
5309
|
|
|
5341
5310
|
Object.defineProperty(settings$2, "__esModule", { value: true });
|
|
5342
|
-
const path$
|
|
5311
|
+
const path$4 = require$$0__default["default"];
|
|
5343
5312
|
const fsStat$3 = out$1;
|
|
5344
|
-
const fs = fs$
|
|
5313
|
+
const fs$1 = fs$2;
|
|
5345
5314
|
class Settings$1 {
|
|
5346
5315
|
constructor(_options = {}) {
|
|
5347
5316
|
this._options = _options;
|
|
5348
5317
|
this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
|
|
5349
|
-
this.fs = fs.createFileSystemAdapter(this._options.fs);
|
|
5350
|
-
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path$
|
|
5318
|
+
this.fs = fs$1.createFileSystemAdapter(this._options.fs);
|
|
5319
|
+
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path$4.sep);
|
|
5351
5320
|
this.stats = this._getValue(this._options.stats, false);
|
|
5352
5321
|
this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
|
|
5353
5322
|
this.fsStatSettings = new fsStat$3.Settings({
|
|
@@ -5886,7 +5855,7 @@ function callSuccessCallback(callback, entries) {
|
|
|
5886
5855
|
var stream$2 = {};
|
|
5887
5856
|
|
|
5888
5857
|
Object.defineProperty(stream$2, "__esModule", { value: true });
|
|
5889
|
-
const stream_1$5 = require$$0__default$
|
|
5858
|
+
const stream_1$5 = require$$0__default$2["default"];
|
|
5890
5859
|
const async_1$3 = async$4;
|
|
5891
5860
|
class StreamProvider {
|
|
5892
5861
|
constructor(_root, _settings) {
|
|
@@ -5999,7 +5968,7 @@ sync$3.default = SyncProvider;
|
|
|
5999
5968
|
var settings$1 = {};
|
|
6000
5969
|
|
|
6001
5970
|
Object.defineProperty(settings$1, "__esModule", { value: true });
|
|
6002
|
-
const path$
|
|
5971
|
+
const path$3 = require$$0__default["default"];
|
|
6003
5972
|
const fsScandir = out$2;
|
|
6004
5973
|
class Settings {
|
|
6005
5974
|
constructor(_options = {}) {
|
|
@@ -6009,7 +5978,7 @@ class Settings {
|
|
|
6009
5978
|
this.deepFilter = this._getValue(this._options.deepFilter, null);
|
|
6010
5979
|
this.entryFilter = this._getValue(this._options.entryFilter, null);
|
|
6011
5980
|
this.errorFilter = this._getValue(this._options.errorFilter, null);
|
|
6012
|
-
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path$
|
|
5981
|
+
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path$3.sep);
|
|
6013
5982
|
this.fsScandirSettings = new fsScandir.Settings({
|
|
6014
5983
|
followSymbolicLinks: this._options.followSymbolicLinks,
|
|
6015
5984
|
fs: this._options.fs,
|
|
@@ -6061,7 +6030,7 @@ function getSettings(settingsOrOptions = {}) {
|
|
|
6061
6030
|
var reader = {};
|
|
6062
6031
|
|
|
6063
6032
|
Object.defineProperty(reader, "__esModule", { value: true });
|
|
6064
|
-
const path$
|
|
6033
|
+
const path$2 = require$$0__default["default"];
|
|
6065
6034
|
const fsStat$2 = out$1;
|
|
6066
6035
|
const utils$6 = utils$k;
|
|
6067
6036
|
class Reader {
|
|
@@ -6074,7 +6043,7 @@ class Reader {
|
|
|
6074
6043
|
});
|
|
6075
6044
|
}
|
|
6076
6045
|
_getFullEntryPath(filepath) {
|
|
6077
|
-
return path$
|
|
6046
|
+
return path$2.resolve(this._settings.cwd, filepath);
|
|
6078
6047
|
}
|
|
6079
6048
|
_makeEntry(stats, pattern) {
|
|
6080
6049
|
const entry = {
|
|
@@ -6096,7 +6065,7 @@ reader.default = Reader;
|
|
|
6096
6065
|
var stream$1 = {};
|
|
6097
6066
|
|
|
6098
6067
|
Object.defineProperty(stream$1, "__esModule", { value: true });
|
|
6099
|
-
const stream_1$3 = require$$0__default$
|
|
6068
|
+
const stream_1$3 = require$$0__default$2["default"];
|
|
6100
6069
|
const fsStat$1 = out$1;
|
|
6101
6070
|
const fsWalk$2 = out$3;
|
|
6102
6071
|
const reader_1$2 = reader;
|
|
@@ -6449,7 +6418,7 @@ class EntryTransformer {
|
|
|
6449
6418
|
entry.default = EntryTransformer;
|
|
6450
6419
|
|
|
6451
6420
|
Object.defineProperty(provider, "__esModule", { value: true });
|
|
6452
|
-
const path = require$$0__default
|
|
6421
|
+
const path$1 = require$$0__default["default"];
|
|
6453
6422
|
const deep_1 = deep;
|
|
6454
6423
|
const entry_1 = entry$1;
|
|
6455
6424
|
const error_1 = error;
|
|
@@ -6463,7 +6432,7 @@ class Provider {
|
|
|
6463
6432
|
this.entryTransformer = new entry_2.default(this._settings);
|
|
6464
6433
|
}
|
|
6465
6434
|
_getRootDirectory(task) {
|
|
6466
|
-
return path.resolve(this._settings.cwd, task.base);
|
|
6435
|
+
return path$1.resolve(this._settings.cwd, task.base);
|
|
6467
6436
|
}
|
|
6468
6437
|
_getReaderOptions(task) {
|
|
6469
6438
|
const basePath = task.base === '.' ? '' : task.base;
|
|
@@ -6522,7 +6491,7 @@ async$7.default = ProviderAsync;
|
|
|
6522
6491
|
var stream = {};
|
|
6523
6492
|
|
|
6524
6493
|
Object.defineProperty(stream, "__esModule", { value: true });
|
|
6525
|
-
const stream_1$1 = require$$0__default$
|
|
6494
|
+
const stream_1$1 = require$$0__default$2["default"];
|
|
6526
6495
|
const stream_2 = stream$1;
|
|
6527
6496
|
const provider_1$1 = provider;
|
|
6528
6497
|
class ProviderStream extends provider_1$1.default {
|
|
@@ -6627,8 +6596,8 @@ var settings = {};
|
|
|
6627
6596
|
(function (exports) {
|
|
6628
6597
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6629
6598
|
exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
|
|
6630
|
-
const fs =
|
|
6631
|
-
const os = require$$
|
|
6599
|
+
const fs = require$$0__default$3["default"];
|
|
6600
|
+
const os = require$$2__default["default"];
|
|
6632
6601
|
/**
|
|
6633
6602
|
* The `os.cpus` method can return zero. We expect the number of cores to be greater than zero.
|
|
6634
6603
|
* https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107
|
|
@@ -6785,15 +6754,26 @@ function assertPatternsInput(input) {
|
|
|
6785
6754
|
}
|
|
6786
6755
|
var out = FastGlob;
|
|
6787
6756
|
|
|
6757
|
+
const ENVIRONMENT = {
|
|
6758
|
+
development: "development",
|
|
6759
|
+
staging: "staging",
|
|
6760
|
+
review: "review",
|
|
6761
|
+
};
|
|
6762
|
+
const IS_STAGING_ENV = process.env.TEST_ENV === "staging";
|
|
6763
|
+
const STORAGE_STATE = "./e2e/auth/user.json";
|
|
6764
|
+
const GLOBAL_TRANSLATIONS_PATTERN = "../node_modules/@bigbinary/**/translations/en.json";
|
|
6765
|
+
const PROJECT_TRANSLATIONS_PATH = "../app/javascript/src/translations/en.json";
|
|
6766
|
+
const CREDENTIALS = { email: "oliver@example.com", password: "welcome" };
|
|
6767
|
+
|
|
6788
6768
|
const joinString = (string1, string2, string3 = "", separator = " ") => {
|
|
6789
6769
|
if (string3 === "") {
|
|
6790
6770
|
return string1 + separator + string2;
|
|
6791
6771
|
}
|
|
6792
6772
|
return string1 + separator + string2 + separator + string3;
|
|
6793
6773
|
};
|
|
6794
|
-
const readFileSyncIfExists
|
|
6774
|
+
const readFileSyncIfExists = (path = STORAGE_STATE) => {
|
|
6795
6775
|
try {
|
|
6796
|
-
return JSON.parse(
|
|
6776
|
+
return JSON.parse(require$$0__namespace.readFileSync(path, "utf8"));
|
|
6797
6777
|
}
|
|
6798
6778
|
catch (error) {
|
|
6799
6779
|
return {};
|
|
@@ -6801,7 +6781,7 @@ const readFileSyncIfExists$1 = (path = STORAGE_STATE$1) => {
|
|
|
6801
6781
|
};
|
|
6802
6782
|
const writeDataToFile = data => {
|
|
6803
6783
|
try {
|
|
6804
|
-
|
|
6784
|
+
require$$0__namespace.writeFileSync(STORAGE_STATE, data, "utf8");
|
|
6805
6785
|
}
|
|
6806
6786
|
catch (error) {
|
|
6807
6787
|
console.log(error); // eslint-disable-line
|
|
@@ -6809,91 +6789,27 @@ const writeDataToFile = data => {
|
|
|
6809
6789
|
return true;
|
|
6810
6790
|
};
|
|
6811
6791
|
const updateCredentials = ({ key, value }) => {
|
|
6812
|
-
const data = readFileSyncIfExists
|
|
6792
|
+
const data = readFileSyncIfExists();
|
|
6813
6793
|
data["user"][key] = value;
|
|
6814
6794
|
return writeDataToFile(JSON.stringify(data));
|
|
6815
6795
|
};
|
|
6816
6796
|
const clearCredentials = () => {
|
|
6817
|
-
|
|
6797
|
+
require$$0__namespace.unlink(STORAGE_STATE, error => {
|
|
6818
6798
|
if (!error)
|
|
6819
6799
|
return;
|
|
6820
6800
|
console.log(error); // eslint-disable-line
|
|
6821
6801
|
});
|
|
6822
6802
|
};
|
|
6823
6803
|
const readTranslations = () => {
|
|
6824
|
-
let translations = readFileSyncIfExists
|
|
6804
|
+
let translations = readFileSyncIfExists(PROJECT_TRANSLATIONS_PATH);
|
|
6825
6805
|
const paths = out.sync(GLOBAL_TRANSLATIONS_PATTERN);
|
|
6826
6806
|
paths.forEach(path => {
|
|
6827
|
-
const packageTranslation = readFileSyncIfExists
|
|
6807
|
+
const packageTranslation = readFileSyncIfExists(path);
|
|
6828
6808
|
translations = ramda.mergeDeepLeft(translations, packageTranslation);
|
|
6829
6809
|
});
|
|
6830
6810
|
return translations;
|
|
6831
6811
|
};
|
|
6832
6812
|
|
|
6833
|
-
const timestamp = dayjs__default["default"]().format("YYYYMMDDHH");
|
|
6834
|
-
const firstName = "André";
|
|
6835
|
-
const lastName = "O'Reilly";
|
|
6836
|
-
const stagingOrganization = `cypresstest-invoice-${timestamp}`;
|
|
6837
|
-
const otpBypassKey = process.env.OTP_BYPASS_KEY;
|
|
6838
|
-
const stagingData = {
|
|
6839
|
-
firstName,
|
|
6840
|
-
lastName,
|
|
6841
|
-
otp: 111111,
|
|
6842
|
-
domain: "neetoinvoice.net",
|
|
6843
|
-
currentUserName: IS_STAGING_ENV
|
|
6844
|
-
? joinString(firstName, lastName)
|
|
6845
|
-
: "Oliver Smith",
|
|
6846
|
-
businessName: stagingOrganization,
|
|
6847
|
-
subdomainName: IS_STAGING_ENV ? stagingOrganization : "spinkart",
|
|
6848
|
-
email: IS_STAGING_ENV
|
|
6849
|
-
? `cypresstest${otpBypassKey}+invoice+${timestamp}@bigbinary.com`
|
|
6850
|
-
: "oliver@example.com",
|
|
6851
|
-
};
|
|
6852
|
-
|
|
6853
|
-
const initializeCredentials = () => {
|
|
6854
|
-
const { user } = readFileSyncIfExists$1();
|
|
6855
|
-
const newState = {
|
|
6856
|
-
...user,
|
|
6857
|
-
businessName: (user === null || user === void 0 ? void 0 : user.businessName) || stagingData.businessName,
|
|
6858
|
-
currentUserName: (user === null || user === void 0 ? void 0 : user.currentUserName) || stagingData.currentUserName,
|
|
6859
|
-
email: (user === null || user === void 0 ? void 0 : user.email) || stagingData.email,
|
|
6860
|
-
firstName: (user === null || user === void 0 ? void 0 : user.firstName) || stagingData.firstName,
|
|
6861
|
-
lastName: (user === null || user === void 0 ? void 0 : user.lastName) || stagingData.lastName,
|
|
6862
|
-
subdomainName: (user === null || user === void 0 ? void 0 : user.subdomainName) || stagingData.subdomainName,
|
|
6863
|
-
skipSetup: user === null || user === void 0 ? void 0 : user.skipSetup,
|
|
6864
|
-
};
|
|
6865
|
-
writeDataToFile(JSON.stringify({ user: newState }, null, 2));
|
|
6866
|
-
if (IS_STAGING_ENV) {
|
|
6867
|
-
const baseUrl = `https://${newState.subdomainName}.${stagingData.domain}`;
|
|
6868
|
-
process.env.BASE_URL = baseUrl;
|
|
6869
|
-
}
|
|
6870
|
-
};
|
|
6871
|
-
|
|
6872
|
-
const COMMON_SELECTORS = {
|
|
6873
|
-
toastMessage: "toastr-message-container",
|
|
6874
|
-
toastIcon: ".Toastify__toast-icon",
|
|
6875
|
-
toastCloseButton: "toastr-close-button",
|
|
6876
|
-
dropdownIcon: "nui-dropdown-icon",
|
|
6877
|
-
checkbox: "nui-checkbox-input",
|
|
6878
|
-
spinner: ".neeto-ui-spinner",
|
|
6879
|
-
input: "nui-input-field",
|
|
6880
|
-
alertModalSubmitButton: "alert-submit-button",
|
|
6881
|
-
selectContainer: "nui-select-container",
|
|
6882
|
-
subheaderText: "subheader-left",
|
|
6883
|
-
};
|
|
6884
|
-
|
|
6885
|
-
process.env.TEST_ENV === "staging";
|
|
6886
|
-
const STORAGE_STATE = "./e2e/auth/user.json";
|
|
6887
|
-
|
|
6888
|
-
const readFileSyncIfExists = (path = STORAGE_STATE) => {
|
|
6889
|
-
try {
|
|
6890
|
-
return JSON.parse(fs__namespace.readFileSync(path, "utf8"));
|
|
6891
|
-
}
|
|
6892
|
-
catch (error) {
|
|
6893
|
-
return {};
|
|
6894
|
-
}
|
|
6895
|
-
};
|
|
6896
|
-
|
|
6897
6813
|
class CustomCommands {
|
|
6898
6814
|
constructor(page, request) {
|
|
6899
6815
|
this.interceptMultipleResponses = ({ responseUrl = "", times = 1, baseUrl, }) => Promise.all([...new Array(times)].map(() => this.page.waitForResponse(response => {
|
|
@@ -6925,10 +6841,10 @@ class CustomCommands {
|
|
|
6925
6841
|
};
|
|
6926
6842
|
this.verifySuccessToast = async ({ message, closeAfterVerification = true, }) => {
|
|
6927
6843
|
if (message) {
|
|
6928
|
-
await test
|
|
6844
|
+
await test.expect(this.page.getByTestId(COMMON_SELECTORS.toastMessage)).toHaveValue(message);
|
|
6929
6845
|
}
|
|
6930
6846
|
else {
|
|
6931
|
-
await test
|
|
6847
|
+
await test.expect(this.page.locator(COMMON_SELECTORS.toastIcon)).toHaveValue("👍");
|
|
6932
6848
|
closeAfterVerification &&
|
|
6933
6849
|
(await this.page
|
|
6934
6850
|
.getByTestId(COMMON_SELECTORS.toastCloseButton)
|
|
@@ -6958,7 +6874,7 @@ class CustomCommands {
|
|
|
6958
6874
|
}[method.toLowerCase()];
|
|
6959
6875
|
};
|
|
6960
6876
|
this.verifyFieldValue = values => {
|
|
6961
|
-
const verifyEachFieldValue = ({ field, value, }) => test
|
|
6877
|
+
const verifyEachFieldValue = ({ field, value, }) => test.expect(this.page.getByTestId(field)).toHaveValue(value);
|
|
6962
6878
|
return Array.isArray(values)
|
|
6963
6879
|
? Promise.all(values.map(value => verifyEachFieldValue(value)))
|
|
6964
6880
|
: verifyEachFieldValue(values);
|
|
@@ -6969,23 +6885,666 @@ class CustomCommands {
|
|
|
6969
6885
|
}
|
|
6970
6886
|
}
|
|
6971
6887
|
|
|
6972
|
-
const
|
|
6888
|
+
const commands = {
|
|
6973
6889
|
neetoPlaywrightUtilities: async ({ page, request }, use) => {
|
|
6974
6890
|
const commands = new CustomCommands(page, request);
|
|
6975
6891
|
await use(commands);
|
|
6976
6892
|
},
|
|
6977
6893
|
page: async ({ page }, use) => {
|
|
6978
6894
|
await page.goto("/");
|
|
6979
|
-
await page.waitForLoadState(
|
|
6895
|
+
await page.waitForLoadState();
|
|
6980
6896
|
await use(page);
|
|
6981
6897
|
},
|
|
6982
|
-
}
|
|
6898
|
+
};
|
|
6899
|
+
|
|
6900
|
+
const timestamp = dayjs__default["default"]().format("YYYYMMDDHH");
|
|
6901
|
+
const firstName = "André";
|
|
6902
|
+
const lastName = "O'Reilly";
|
|
6903
|
+
const stagingOrganization = `cypresstest-invoice-${timestamp}`;
|
|
6904
|
+
const otpBypassKey = process.env.OTP_BYPASS_KEY;
|
|
6905
|
+
const stagingData = {
|
|
6906
|
+
firstName,
|
|
6907
|
+
lastName,
|
|
6908
|
+
otp: 111111,
|
|
6909
|
+
domain: "neetoinvoice.net",
|
|
6910
|
+
currentUserName: IS_STAGING_ENV
|
|
6911
|
+
? joinString(firstName, lastName)
|
|
6912
|
+
: "Oliver Smith",
|
|
6913
|
+
businessName: stagingOrganization,
|
|
6914
|
+
subdomainName: IS_STAGING_ENV ? stagingOrganization : "spinkart",
|
|
6915
|
+
email: IS_STAGING_ENV
|
|
6916
|
+
? `cypresstest${otpBypassKey}+invoice+${timestamp}-playwright@bigbinary.com`
|
|
6917
|
+
: "oliver@example.com",
|
|
6918
|
+
};
|
|
6919
|
+
|
|
6920
|
+
const i18n = {
|
|
6921
|
+
// i18n configuration options
|
|
6922
|
+
options: {
|
|
6923
|
+
debug: false,
|
|
6924
|
+
fallbackLng: "en",
|
|
6925
|
+
resources: { en: { translation: readTranslations() } },
|
|
6926
|
+
},
|
|
6927
|
+
// Fetch translations in every test or fetch once
|
|
6928
|
+
// Default: true
|
|
6929
|
+
cache: true,
|
|
6930
|
+
// Run as auto fixture to be available through all tests by getI18nInstance()
|
|
6931
|
+
// Default: true
|
|
6932
|
+
auto: true,
|
|
6933
|
+
};
|
|
6934
|
+
|
|
6935
|
+
const BASE_URL = "/api/v1";
|
|
6936
|
+
const ROUTES = {
|
|
6937
|
+
neetoAuth: "https://app.neetoauth.net",
|
|
6938
|
+
profile: "/profile",
|
|
6939
|
+
login: `${BASE_URL}/login`,
|
|
6940
|
+
signup: `${BASE_URL}/signups`,
|
|
6941
|
+
subdomainAvailability: `${BASE_URL}/subdomain_availability`,
|
|
6942
|
+
countries: `${BASE_URL}/countries`,
|
|
6943
|
+
neetoAps: `${BASE_URL}/neeto_apps`,
|
|
6944
|
+
};
|
|
6945
|
+
|
|
6946
|
+
const SIGNUP_SELECTORS = {
|
|
6947
|
+
emailTextField: "signup-email-text-field",
|
|
6948
|
+
firstNameTextField: "signup-profile-first-name-text-field",
|
|
6949
|
+
lastNameTextField: "signup-profile-last-name-text-field",
|
|
6950
|
+
organizationNameTextField: "signup-organization-name-text-field",
|
|
6951
|
+
organizationSubmitButton: "signup-organization-submit-button",
|
|
6952
|
+
otpTextBox: "otpinput-otp-number",
|
|
6953
|
+
profileSubmitButton: "signup-profile-submit-button",
|
|
6954
|
+
signupViaEmailButton: "signup-via-email-button",
|
|
6955
|
+
submitButton: "signup-email-submit-button",
|
|
6956
|
+
subdomainNameTextField: "signup-organization-subdomain-text-field",
|
|
6957
|
+
subdomainError: "subdomain-input-error",
|
|
6958
|
+
tryFreeButton: "neeto-auth-signup-link",
|
|
6959
|
+
};
|
|
6960
|
+
|
|
6961
|
+
const extractSubdomainFromError = (errorString) => {
|
|
6962
|
+
const regex = /cypresstest[a-zA-Z0-9-]+/g;
|
|
6963
|
+
const matches = errorString.match(regex);
|
|
6964
|
+
return matches[1];
|
|
6965
|
+
};
|
|
6966
|
+
|
|
6967
|
+
class OrganizationPage {
|
|
6968
|
+
constructor(page, neetoPlaywrightUtilities) {
|
|
6969
|
+
this.createOrganization = async ({ email, businessName, subdomainName, firstName, lastName, appName, }) => {
|
|
6970
|
+
if (!IS_STAGING_ENV)
|
|
6971
|
+
return;
|
|
6972
|
+
const defaultOtp = "123456";
|
|
6973
|
+
const appNameInLowerCase = appName.toLowerCase();
|
|
6974
|
+
const isNeetoAuth = appNameInLowerCase === "neetoauth";
|
|
6975
|
+
const authUrl = "https://app.neetoauth.net/signups/new";
|
|
6976
|
+
isNeetoAuth
|
|
6977
|
+
? await this.page.goto(authUrl)
|
|
6978
|
+
: await this.page.goto(`${authUrl}?redirect_uri=${appNameInLowerCase}.net`);
|
|
6979
|
+
await this.page.getByTestId(SIGNUP_SELECTORS.emailTextField).fill(email);
|
|
6980
|
+
const signup = this.neetoPlaywrightUtilities.interceptMultipleResponses({
|
|
6981
|
+
responseUrl: ROUTES.signup,
|
|
6982
|
+
baseUrl: ROUTES.neetoAuth,
|
|
6983
|
+
});
|
|
6984
|
+
await this.page.getByTestId(SIGNUP_SELECTORS.submitButton).click();
|
|
6985
|
+
await signup;
|
|
6986
|
+
await this.page.getByTestId(SIGNUP_SELECTORS.otpTextBox).fill(defaultOtp);
|
|
6987
|
+
await this.page
|
|
6988
|
+
.getByTestId(SIGNUP_SELECTORS.organizationNameTextField)
|
|
6989
|
+
.fill(businessName);
|
|
6990
|
+
const fetchSubdomainAvailability = this.page.waitForResponse(response => response.url().includes(ROUTES.subdomainAvailability));
|
|
6991
|
+
await this.page
|
|
6992
|
+
.getByTestId(SIGNUP_SELECTORS.subdomainNameTextField)
|
|
6993
|
+
.fill(subdomainName);
|
|
6994
|
+
await fetchSubdomainAvailability;
|
|
6995
|
+
const subdomainError = this.page.getByTestId(SIGNUP_SELECTORS.subdomainError);
|
|
6996
|
+
const subdomainErrorCount = await subdomainError.count();
|
|
6997
|
+
if (subdomainErrorCount !== 0) {
|
|
6998
|
+
await this.updateSubdomainIfExists(appNameInLowerCase);
|
|
6999
|
+
}
|
|
7000
|
+
await this.page
|
|
7001
|
+
.getByTestId(SIGNUP_SELECTORS.organizationSubmitButton)
|
|
7002
|
+
.click();
|
|
7003
|
+
await Promise.all([
|
|
7004
|
+
this.page.waitForResponse(response => response.url().includes(ROUTES.signup)),
|
|
7005
|
+
this.page.waitForResponse(response => response.url().includes(ROUTES.countries)),
|
|
7006
|
+
]);
|
|
7007
|
+
await this.page.waitForURL(`**${ROUTES.profile}`, { timeout: 15000 });
|
|
7008
|
+
await this.page
|
|
7009
|
+
.getByTestId(SIGNUP_SELECTORS.firstNameTextField)
|
|
7010
|
+
.fill(firstName);
|
|
7011
|
+
await this.page
|
|
7012
|
+
.getByTestId(SIGNUP_SELECTORS.lastNameTextField)
|
|
7013
|
+
.fill(lastName);
|
|
7014
|
+
await this.page.getByTestId(COMMON_SELECTORS.checkbox).click();
|
|
7015
|
+
const submitProfile = this.neetoPlaywrightUtilities.interceptMultipleResponses({
|
|
7016
|
+
responseUrl: ROUTES.signup,
|
|
7017
|
+
baseUrl: ROUTES.neetoAuth,
|
|
7018
|
+
});
|
|
7019
|
+
await this.page.getByTestId(SIGNUP_SELECTORS.profileSubmitButton).click();
|
|
7020
|
+
await submitProfile;
|
|
7021
|
+
};
|
|
7022
|
+
this.setupOrganization = async () => {
|
|
7023
|
+
if (!IS_STAGING_ENV)
|
|
7024
|
+
return;
|
|
7025
|
+
let headers = {};
|
|
7026
|
+
const { user } = readFileSyncIfExists();
|
|
7027
|
+
await this.createOrganization({
|
|
7028
|
+
businessName: user.businessName,
|
|
7029
|
+
email: user.email,
|
|
7030
|
+
firstName: user.firstName,
|
|
7031
|
+
lastName: user.lastName,
|
|
7032
|
+
subdomainName: user.subdomainName,
|
|
7033
|
+
appName: "neetoInvoice",
|
|
7034
|
+
});
|
|
7035
|
+
await this.page.route(`**${ROUTES.neetoAps}`, async (route) => {
|
|
7036
|
+
headers = await route.request().allHeaders();
|
|
7037
|
+
await route.continue();
|
|
7038
|
+
});
|
|
7039
|
+
await test.expect(this.page.locator(COMMON_SELECTORS.spinner)).toBeHidden();
|
|
7040
|
+
const userCredentials = readFileSyncIfExists();
|
|
7041
|
+
await this.page.context().storageState({ path: STORAGE_STATE });
|
|
7042
|
+
const mergedCredentials = {
|
|
7043
|
+
...readFileSyncIfExists(),
|
|
7044
|
+
...userCredentials,
|
|
7045
|
+
headers,
|
|
7046
|
+
};
|
|
7047
|
+
writeDataToFile(JSON.stringify(mergedCredentials, null, 2));
|
|
7048
|
+
};
|
|
7049
|
+
this.updateSubdomainIfExists = async (appName) => {
|
|
7050
|
+
const subdomainError = this.page.getByTestId(SIGNUP_SELECTORS.subdomainError);
|
|
7051
|
+
let subdomainErrorCount = await subdomainError.count();
|
|
7052
|
+
if (subdomainErrorCount !== 0) {
|
|
7053
|
+
const subdomainErrorText = await subdomainError.innerText();
|
|
7054
|
+
const newOrganizationName = extractSubdomainFromError(subdomainErrorText);
|
|
7055
|
+
await this.page
|
|
7056
|
+
.getByTestId(SIGNUP_SELECTORS.subdomainNameTextField)
|
|
7057
|
+
.fill(newOrganizationName);
|
|
7058
|
+
await this.page.waitForResponse(response => response.url().includes(ROUTES.subdomainAvailability));
|
|
7059
|
+
subdomainErrorCount = await subdomainError.count();
|
|
7060
|
+
if (subdomainErrorCount === 0) {
|
|
7061
|
+
updateCredentials({
|
|
7062
|
+
key: "subdomainName",
|
|
7063
|
+
value: newOrganizationName,
|
|
7064
|
+
});
|
|
7065
|
+
updateCredentials({
|
|
7066
|
+
key: "businessName",
|
|
7067
|
+
value: newOrganizationName,
|
|
7068
|
+
});
|
|
7069
|
+
const newBaseUrl = `https://${newOrganizationName}.${appName}.net`;
|
|
7070
|
+
process.env.BASE_URL = newBaseUrl;
|
|
7071
|
+
await this.page
|
|
7072
|
+
.getByTestId(SIGNUP_SELECTORS.organizationNameTextField)
|
|
7073
|
+
.fill(newOrganizationName);
|
|
7074
|
+
}
|
|
7075
|
+
subdomainErrorCount = await subdomainError.count();
|
|
7076
|
+
if (subdomainErrorCount !== 0) {
|
|
7077
|
+
await this.updateSubdomainIfExists(appName);
|
|
7078
|
+
}
|
|
7079
|
+
}
|
|
7080
|
+
};
|
|
7081
|
+
this.page = page;
|
|
7082
|
+
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
7083
|
+
}
|
|
7084
|
+
}
|
|
7085
|
+
|
|
7086
|
+
const LOGIN_SELECTORS = {
|
|
7087
|
+
appleAuthenticationButton: "apple-authentication-button",
|
|
7088
|
+
emailTextField: "login-email-text-field",
|
|
7089
|
+
googleAuthenticationButton: "google-authentication-button",
|
|
7090
|
+
githubAuthenticationButton: "github-authentication-button",
|
|
7091
|
+
loginViaEmailButton: "login-via-email-button",
|
|
7092
|
+
passwordTextField: "login-password-text-field",
|
|
7093
|
+
rememberMeCheckBox: "login-remember-me-check-box",
|
|
7094
|
+
submitButton: "login-submit-button",
|
|
7095
|
+
twitterAuthenticationButton: "twitter-authentication-button",
|
|
7096
|
+
};
|
|
7097
|
+
|
|
7098
|
+
const COMMON_TEXTS = { edit: "Edit" };
|
|
7099
|
+
|
|
7100
|
+
const initializeCredentials = () => {
|
|
7101
|
+
const { user } = readFileSyncIfExists();
|
|
7102
|
+
const newState = {
|
|
7103
|
+
...user,
|
|
7104
|
+
businessName: (user === null || user === void 0 ? void 0 : user.businessName) || stagingData.businessName,
|
|
7105
|
+
currentUserName: (user === null || user === void 0 ? void 0 : user.currentUserName) || stagingData.currentUserName,
|
|
7106
|
+
email: (user === null || user === void 0 ? void 0 : user.email) || stagingData.email,
|
|
7107
|
+
firstName: (user === null || user === void 0 ? void 0 : user.firstName) || stagingData.firstName,
|
|
7108
|
+
lastName: (user === null || user === void 0 ? void 0 : user.lastName) || stagingData.lastName,
|
|
7109
|
+
subdomainName: (user === null || user === void 0 ? void 0 : user.subdomainName) || stagingData.subdomainName,
|
|
7110
|
+
skipSetup: user === null || user === void 0 ? void 0 : user.skipSetup,
|
|
7111
|
+
};
|
|
7112
|
+
writeDataToFile(JSON.stringify({ user: newState }, null, 2));
|
|
7113
|
+
if (IS_STAGING_ENV) {
|
|
7114
|
+
const baseUrl = `https://${newState.subdomainName}.${stagingData.domain}`;
|
|
7115
|
+
process.env.BASE_URL = baseUrl;
|
|
7116
|
+
}
|
|
7117
|
+
};
|
|
7118
|
+
|
|
7119
|
+
const loginWithoutSSO = async ({ page, neetoPlaywrightUtilities, }) => {
|
|
7120
|
+
var _a;
|
|
7121
|
+
await page.goto((_a = process.env.BASE_URL) !== null && _a !== void 0 ? _a : "");
|
|
7122
|
+
let headers = {};
|
|
7123
|
+
await page.route(`**${ROUTES.login}`, async (route) => {
|
|
7124
|
+
headers = await route.request().allHeaders();
|
|
7125
|
+
await route.continue();
|
|
7126
|
+
});
|
|
7127
|
+
await page.getByTestId("login-email-text-field").fill(CREDENTIALS.email);
|
|
7128
|
+
await page
|
|
7129
|
+
.getByTestId("login-password-text-field")
|
|
7130
|
+
.fill(CREDENTIALS.password);
|
|
7131
|
+
const login = neetoPlaywrightUtilities.interceptMultipleResponses({
|
|
7132
|
+
times: 2,
|
|
7133
|
+
});
|
|
7134
|
+
await page.getByTestId(LOGIN_SELECTORS.submitButton).click();
|
|
7135
|
+
await login;
|
|
7136
|
+
const userCredentials = readFileSyncIfExists();
|
|
7137
|
+
await page.context().storageState({ path: STORAGE_STATE });
|
|
7138
|
+
const mergedCredentials = {
|
|
7139
|
+
...readFileSyncIfExists(),
|
|
7140
|
+
...userCredentials,
|
|
7141
|
+
headers,
|
|
7142
|
+
};
|
|
7143
|
+
writeDataToFile(JSON.stringify(mergedCredentials, null, 2));
|
|
7144
|
+
};
|
|
7145
|
+
const login = async ({ page, neetoPlaywrightUtilities }) => !IS_STAGING_ENV &&
|
|
7146
|
+
(await loginWithoutSSO({ page, neetoPlaywrightUtilities }));
|
|
7147
|
+
|
|
7148
|
+
var main$1 = {exports: {}};
|
|
7149
|
+
|
|
7150
|
+
var name = "dotenv";
|
|
7151
|
+
var version$1 = "16.3.1";
|
|
7152
|
+
var description = "Loads environment variables from .env file";
|
|
7153
|
+
var main = "lib/main.js";
|
|
7154
|
+
var types = "lib/main.d.ts";
|
|
7155
|
+
var exports$1 = {
|
|
7156
|
+
".": {
|
|
7157
|
+
types: "./lib/main.d.ts",
|
|
7158
|
+
require: "./lib/main.js",
|
|
7159
|
+
"default": "./lib/main.js"
|
|
7160
|
+
},
|
|
7161
|
+
"./config": "./config.js",
|
|
7162
|
+
"./config.js": "./config.js",
|
|
7163
|
+
"./lib/env-options": "./lib/env-options.js",
|
|
7164
|
+
"./lib/env-options.js": "./lib/env-options.js",
|
|
7165
|
+
"./lib/cli-options": "./lib/cli-options.js",
|
|
7166
|
+
"./lib/cli-options.js": "./lib/cli-options.js",
|
|
7167
|
+
"./package.json": "./package.json"
|
|
7168
|
+
};
|
|
7169
|
+
var scripts = {
|
|
7170
|
+
"dts-check": "tsc --project tests/types/tsconfig.json",
|
|
7171
|
+
lint: "standard",
|
|
7172
|
+
"lint-readme": "standard-markdown",
|
|
7173
|
+
pretest: "npm run lint && npm run dts-check",
|
|
7174
|
+
test: "tap tests/*.js --100 -Rspec",
|
|
7175
|
+
prerelease: "npm test",
|
|
7176
|
+
release: "standard-version"
|
|
7177
|
+
};
|
|
7178
|
+
var repository = {
|
|
7179
|
+
type: "git",
|
|
7180
|
+
url: "git://github.com/motdotla/dotenv.git"
|
|
7181
|
+
};
|
|
7182
|
+
var funding = "https://github.com/motdotla/dotenv?sponsor=1";
|
|
7183
|
+
var keywords = [
|
|
7184
|
+
"dotenv",
|
|
7185
|
+
"env",
|
|
7186
|
+
".env",
|
|
7187
|
+
"environment",
|
|
7188
|
+
"variables",
|
|
7189
|
+
"config",
|
|
7190
|
+
"settings"
|
|
7191
|
+
];
|
|
7192
|
+
var readmeFilename = "README.md";
|
|
7193
|
+
var license = "BSD-2-Clause";
|
|
7194
|
+
var devDependencies = {
|
|
7195
|
+
"@definitelytyped/dtslint": "^0.0.133",
|
|
7196
|
+
"@types/node": "^18.11.3",
|
|
7197
|
+
decache: "^4.6.1",
|
|
7198
|
+
sinon: "^14.0.1",
|
|
7199
|
+
standard: "^17.0.0",
|
|
7200
|
+
"standard-markdown": "^7.1.0",
|
|
7201
|
+
"standard-version": "^9.5.0",
|
|
7202
|
+
tap: "^16.3.0",
|
|
7203
|
+
tar: "^6.1.11",
|
|
7204
|
+
typescript: "^4.8.4"
|
|
7205
|
+
};
|
|
7206
|
+
var engines = {
|
|
7207
|
+
node: ">=12"
|
|
7208
|
+
};
|
|
7209
|
+
var browser = {
|
|
7210
|
+
fs: false
|
|
7211
|
+
};
|
|
7212
|
+
var require$$4 = {
|
|
7213
|
+
name: name,
|
|
7214
|
+
version: version$1,
|
|
7215
|
+
description: description,
|
|
7216
|
+
main: main,
|
|
7217
|
+
types: types,
|
|
7218
|
+
exports: exports$1,
|
|
7219
|
+
scripts: scripts,
|
|
7220
|
+
repository: repository,
|
|
7221
|
+
funding: funding,
|
|
7222
|
+
keywords: keywords,
|
|
7223
|
+
readmeFilename: readmeFilename,
|
|
7224
|
+
license: license,
|
|
7225
|
+
devDependencies: devDependencies,
|
|
7226
|
+
engines: engines,
|
|
7227
|
+
browser: browser
|
|
7228
|
+
};
|
|
7229
|
+
|
|
7230
|
+
const fs = require$$0__default$3["default"];
|
|
7231
|
+
const path = require$$0__default["default"];
|
|
7232
|
+
const os = require$$2__default["default"];
|
|
7233
|
+
const crypto = require$$3__default["default"];
|
|
7234
|
+
const packageJson = require$$4;
|
|
7235
|
+
|
|
7236
|
+
const version = packageJson.version;
|
|
7237
|
+
|
|
7238
|
+
const LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
7239
|
+
|
|
7240
|
+
// Parse src into an Object
|
|
7241
|
+
function parse (src) {
|
|
7242
|
+
const obj = {};
|
|
7243
|
+
|
|
7244
|
+
// Convert buffer to string
|
|
7245
|
+
let lines = src.toString();
|
|
7246
|
+
|
|
7247
|
+
// Convert line breaks to same format
|
|
7248
|
+
lines = lines.replace(/\r\n?/mg, '\n');
|
|
7249
|
+
|
|
7250
|
+
let match;
|
|
7251
|
+
while ((match = LINE.exec(lines)) != null) {
|
|
7252
|
+
const key = match[1];
|
|
7253
|
+
|
|
7254
|
+
// Default undefined or null to empty string
|
|
7255
|
+
let value = (match[2] || '');
|
|
7256
|
+
|
|
7257
|
+
// Remove whitespace
|
|
7258
|
+
value = value.trim();
|
|
7259
|
+
|
|
7260
|
+
// Check if double quoted
|
|
7261
|
+
const maybeQuote = value[0];
|
|
7262
|
+
|
|
7263
|
+
// Remove surrounding quotes
|
|
7264
|
+
value = value.replace(/^(['"`])([\s\S]*)\1$/mg, '$2');
|
|
7265
|
+
|
|
7266
|
+
// Expand newlines if double quoted
|
|
7267
|
+
if (maybeQuote === '"') {
|
|
7268
|
+
value = value.replace(/\\n/g, '\n');
|
|
7269
|
+
value = value.replace(/\\r/g, '\r');
|
|
7270
|
+
}
|
|
7271
|
+
|
|
7272
|
+
// Add to object
|
|
7273
|
+
obj[key] = value;
|
|
7274
|
+
}
|
|
7275
|
+
|
|
7276
|
+
return obj
|
|
7277
|
+
}
|
|
7278
|
+
|
|
7279
|
+
function _parseVault (options) {
|
|
7280
|
+
const vaultPath = _vaultPath(options);
|
|
7281
|
+
|
|
7282
|
+
// Parse .env.vault
|
|
7283
|
+
const result = DotenvModule.configDotenv({ path: vaultPath });
|
|
7284
|
+
if (!result.parsed) {
|
|
7285
|
+
throw new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`)
|
|
7286
|
+
}
|
|
7287
|
+
|
|
7288
|
+
// handle scenario for comma separated keys - for use with key rotation
|
|
7289
|
+
// example: DOTENV_KEY="dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=prod,dotenv://:key_7890@dotenv.org/vault/.env.vault?environment=prod"
|
|
7290
|
+
const keys = _dotenvKey(options).split(',');
|
|
7291
|
+
const length = keys.length;
|
|
7292
|
+
|
|
7293
|
+
let decrypted;
|
|
7294
|
+
for (let i = 0; i < length; i++) {
|
|
7295
|
+
try {
|
|
7296
|
+
// Get full key
|
|
7297
|
+
const key = keys[i].trim();
|
|
7298
|
+
|
|
7299
|
+
// Get instructions for decrypt
|
|
7300
|
+
const attrs = _instructions(result, key);
|
|
7301
|
+
|
|
7302
|
+
// Decrypt
|
|
7303
|
+
decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
|
|
7304
|
+
|
|
7305
|
+
break
|
|
7306
|
+
} catch (error) {
|
|
7307
|
+
// last key
|
|
7308
|
+
if (i + 1 >= length) {
|
|
7309
|
+
throw error
|
|
7310
|
+
}
|
|
7311
|
+
// try next key
|
|
7312
|
+
}
|
|
7313
|
+
}
|
|
7314
|
+
|
|
7315
|
+
// Parse decrypted .env string
|
|
7316
|
+
return DotenvModule.parse(decrypted)
|
|
7317
|
+
}
|
|
7318
|
+
|
|
7319
|
+
function _log (message) {
|
|
7320
|
+
console.log(`[dotenv@${version}][INFO] ${message}`);
|
|
7321
|
+
}
|
|
7322
|
+
|
|
7323
|
+
function _warn (message) {
|
|
7324
|
+
console.log(`[dotenv@${version}][WARN] ${message}`);
|
|
7325
|
+
}
|
|
7326
|
+
|
|
7327
|
+
function _debug (message) {
|
|
7328
|
+
console.log(`[dotenv@${version}][DEBUG] ${message}`);
|
|
7329
|
+
}
|
|
7330
|
+
|
|
7331
|
+
function _dotenvKey (options) {
|
|
7332
|
+
// prioritize developer directly setting options.DOTENV_KEY
|
|
7333
|
+
if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
|
|
7334
|
+
return options.DOTENV_KEY
|
|
7335
|
+
}
|
|
7336
|
+
|
|
7337
|
+
// secondary infra already contains a DOTENV_KEY environment variable
|
|
7338
|
+
if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
|
|
7339
|
+
return process.env.DOTENV_KEY
|
|
7340
|
+
}
|
|
7341
|
+
|
|
7342
|
+
// fallback to empty string
|
|
7343
|
+
return ''
|
|
7344
|
+
}
|
|
7345
|
+
|
|
7346
|
+
function _instructions (result, dotenvKey) {
|
|
7347
|
+
// Parse DOTENV_KEY. Format is a URI
|
|
7348
|
+
let uri;
|
|
7349
|
+
try {
|
|
7350
|
+
uri = new URL(dotenvKey);
|
|
7351
|
+
} catch (error) {
|
|
7352
|
+
if (error.code === 'ERR_INVALID_URL') {
|
|
7353
|
+
throw new Error('INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=development')
|
|
7354
|
+
}
|
|
7355
|
+
|
|
7356
|
+
throw error
|
|
7357
|
+
}
|
|
7358
|
+
|
|
7359
|
+
// Get decrypt key
|
|
7360
|
+
const key = uri.password;
|
|
7361
|
+
if (!key) {
|
|
7362
|
+
throw new Error('INVALID_DOTENV_KEY: Missing key part')
|
|
7363
|
+
}
|
|
7364
|
+
|
|
7365
|
+
// Get environment
|
|
7366
|
+
const environment = uri.searchParams.get('environment');
|
|
7367
|
+
if (!environment) {
|
|
7368
|
+
throw new Error('INVALID_DOTENV_KEY: Missing environment part')
|
|
7369
|
+
}
|
|
7370
|
+
|
|
7371
|
+
// Get ciphertext payload
|
|
7372
|
+
const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
|
|
7373
|
+
const ciphertext = result.parsed[environmentKey]; // DOTENV_VAULT_PRODUCTION
|
|
7374
|
+
if (!ciphertext) {
|
|
7375
|
+
throw new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`)
|
|
7376
|
+
}
|
|
7377
|
+
|
|
7378
|
+
return { ciphertext, key }
|
|
7379
|
+
}
|
|
7380
|
+
|
|
7381
|
+
function _vaultPath (options) {
|
|
7382
|
+
let dotenvPath = path.resolve(process.cwd(), '.env');
|
|
7383
|
+
|
|
7384
|
+
if (options && options.path && options.path.length > 0) {
|
|
7385
|
+
dotenvPath = options.path;
|
|
7386
|
+
}
|
|
7387
|
+
|
|
7388
|
+
// Locate .env.vault
|
|
7389
|
+
return dotenvPath.endsWith('.vault') ? dotenvPath : `${dotenvPath}.vault`
|
|
7390
|
+
}
|
|
7391
|
+
|
|
7392
|
+
function _resolveHome (envPath) {
|
|
7393
|
+
return envPath[0] === '~' ? path.join(os.homedir(), envPath.slice(1)) : envPath
|
|
7394
|
+
}
|
|
7395
|
+
|
|
7396
|
+
function _configVault (options) {
|
|
7397
|
+
_log('Loading env from encrypted .env.vault');
|
|
7398
|
+
|
|
7399
|
+
const parsed = DotenvModule._parseVault(options);
|
|
7400
|
+
|
|
7401
|
+
let processEnv = process.env;
|
|
7402
|
+
if (options && options.processEnv != null) {
|
|
7403
|
+
processEnv = options.processEnv;
|
|
7404
|
+
}
|
|
7405
|
+
|
|
7406
|
+
DotenvModule.populate(processEnv, parsed, options);
|
|
7407
|
+
|
|
7408
|
+
return { parsed }
|
|
7409
|
+
}
|
|
7410
|
+
|
|
7411
|
+
function configDotenv (options) {
|
|
7412
|
+
let dotenvPath = path.resolve(process.cwd(), '.env');
|
|
7413
|
+
let encoding = 'utf8';
|
|
7414
|
+
const debug = Boolean(options && options.debug);
|
|
7415
|
+
|
|
7416
|
+
if (options) {
|
|
7417
|
+
if (options.path != null) {
|
|
7418
|
+
dotenvPath = _resolveHome(options.path);
|
|
7419
|
+
}
|
|
7420
|
+
if (options.encoding != null) {
|
|
7421
|
+
encoding = options.encoding;
|
|
7422
|
+
}
|
|
7423
|
+
}
|
|
7424
|
+
|
|
7425
|
+
try {
|
|
7426
|
+
// Specifying an encoding returns a string instead of a buffer
|
|
7427
|
+
const parsed = DotenvModule.parse(fs.readFileSync(dotenvPath, { encoding }));
|
|
7428
|
+
|
|
7429
|
+
let processEnv = process.env;
|
|
7430
|
+
if (options && options.processEnv != null) {
|
|
7431
|
+
processEnv = options.processEnv;
|
|
7432
|
+
}
|
|
7433
|
+
|
|
7434
|
+
DotenvModule.populate(processEnv, parsed, options);
|
|
7435
|
+
|
|
7436
|
+
return { parsed }
|
|
7437
|
+
} catch (e) {
|
|
7438
|
+
if (debug) {
|
|
7439
|
+
_debug(`Failed to load ${dotenvPath} ${e.message}`);
|
|
7440
|
+
}
|
|
7441
|
+
|
|
7442
|
+
return { error: e }
|
|
7443
|
+
}
|
|
7444
|
+
}
|
|
7445
|
+
|
|
7446
|
+
// Populates process.env from .env file
|
|
7447
|
+
function config (options) {
|
|
7448
|
+
const vaultPath = _vaultPath(options);
|
|
7449
|
+
|
|
7450
|
+
// fallback to original dotenv if DOTENV_KEY is not set
|
|
7451
|
+
if (_dotenvKey(options).length === 0) {
|
|
7452
|
+
return DotenvModule.configDotenv(options)
|
|
7453
|
+
}
|
|
7454
|
+
|
|
7455
|
+
// dotenvKey exists but .env.vault file does not exist
|
|
7456
|
+
if (!fs.existsSync(vaultPath)) {
|
|
7457
|
+
_warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
|
|
7458
|
+
|
|
7459
|
+
return DotenvModule.configDotenv(options)
|
|
7460
|
+
}
|
|
7461
|
+
|
|
7462
|
+
return DotenvModule._configVault(options)
|
|
7463
|
+
}
|
|
7464
|
+
|
|
7465
|
+
function decrypt (encrypted, keyStr) {
|
|
7466
|
+
const key = Buffer.from(keyStr.slice(-64), 'hex');
|
|
7467
|
+
let ciphertext = Buffer.from(encrypted, 'base64');
|
|
7468
|
+
|
|
7469
|
+
const nonce = ciphertext.slice(0, 12);
|
|
7470
|
+
const authTag = ciphertext.slice(-16);
|
|
7471
|
+
ciphertext = ciphertext.slice(12, -16);
|
|
7472
|
+
|
|
7473
|
+
try {
|
|
7474
|
+
const aesgcm = crypto.createDecipheriv('aes-256-gcm', key, nonce);
|
|
7475
|
+
aesgcm.setAuthTag(authTag);
|
|
7476
|
+
return `${aesgcm.update(ciphertext)}${aesgcm.final()}`
|
|
7477
|
+
} catch (error) {
|
|
7478
|
+
const isRange = error instanceof RangeError;
|
|
7479
|
+
const invalidKeyLength = error.message === 'Invalid key length';
|
|
7480
|
+
const decryptionFailed = error.message === 'Unsupported state or unable to authenticate data';
|
|
7481
|
+
|
|
7482
|
+
if (isRange || invalidKeyLength) {
|
|
7483
|
+
const msg = 'INVALID_DOTENV_KEY: It must be 64 characters long (or more)';
|
|
7484
|
+
throw new Error(msg)
|
|
7485
|
+
} else if (decryptionFailed) {
|
|
7486
|
+
const msg = 'DECRYPTION_FAILED: Please check your DOTENV_KEY';
|
|
7487
|
+
throw new Error(msg)
|
|
7488
|
+
} else {
|
|
7489
|
+
console.error('Error: ', error.code);
|
|
7490
|
+
console.error('Error: ', error.message);
|
|
7491
|
+
throw error
|
|
7492
|
+
}
|
|
7493
|
+
}
|
|
7494
|
+
}
|
|
7495
|
+
|
|
7496
|
+
// Populate process.env with parsed values
|
|
7497
|
+
function populate (processEnv, parsed, options = {}) {
|
|
7498
|
+
const debug = Boolean(options && options.debug);
|
|
7499
|
+
const override = Boolean(options && options.override);
|
|
7500
|
+
|
|
7501
|
+
if (typeof parsed !== 'object') {
|
|
7502
|
+
throw new Error('OBJECT_REQUIRED: Please check the processEnv argument being passed to populate')
|
|
7503
|
+
}
|
|
7504
|
+
|
|
7505
|
+
// Set process.env
|
|
7506
|
+
for (const key of Object.keys(parsed)) {
|
|
7507
|
+
if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
|
|
7508
|
+
if (override === true) {
|
|
7509
|
+
processEnv[key] = parsed[key];
|
|
7510
|
+
}
|
|
7511
|
+
|
|
7512
|
+
if (debug) {
|
|
7513
|
+
if (override === true) {
|
|
7514
|
+
_debug(`"${key}" is already defined and WAS overwritten`);
|
|
7515
|
+
} else {
|
|
7516
|
+
_debug(`"${key}" is already defined and was NOT overwritten`);
|
|
7517
|
+
}
|
|
7518
|
+
}
|
|
7519
|
+
} else {
|
|
7520
|
+
processEnv[key] = parsed[key];
|
|
7521
|
+
}
|
|
7522
|
+
}
|
|
7523
|
+
}
|
|
7524
|
+
|
|
7525
|
+
const DotenvModule = {
|
|
7526
|
+
configDotenv,
|
|
7527
|
+
_configVault,
|
|
7528
|
+
_parseVault,
|
|
7529
|
+
config,
|
|
7530
|
+
decrypt,
|
|
7531
|
+
parse,
|
|
7532
|
+
populate
|
|
7533
|
+
};
|
|
7534
|
+
|
|
7535
|
+
main$1.exports.configDotenv = DotenvModule.configDotenv;
|
|
7536
|
+
main$1.exports._configVault = DotenvModule._configVault;
|
|
7537
|
+
main$1.exports._parseVault = DotenvModule._parseVault;
|
|
7538
|
+
main$1.exports.config = DotenvModule.config;
|
|
7539
|
+
main$1.exports.decrypt = DotenvModule.decrypt;
|
|
7540
|
+
main$1.exports.parse = DotenvModule.parse;
|
|
7541
|
+
main$1.exports.populate = DotenvModule.populate;
|
|
7542
|
+
|
|
7543
|
+
main$1.exports = DotenvModule;
|
|
6983
7544
|
|
|
6984
7545
|
// @ts-check
|
|
6985
7546
|
var _a, _b;
|
|
6986
|
-
|
|
6987
|
-
const dotenv = require("dotenv");
|
|
6988
|
-
dotenv.config({
|
|
7547
|
+
main$1.exports.config({
|
|
6989
7548
|
path: `./e2e/config/.env.${(_a = process.env.TEST_ENV) !== null && _a !== void 0 ? _a : "development"}`,
|
|
6990
7549
|
});
|
|
6991
7550
|
const storageState = "./e2e/auth/user.json";
|
|
@@ -6998,9 +7557,9 @@ const isCI = ["staging", "review"].includes((_b = process.env.TEST_ENV) !== null
|
|
|
6998
7557
|
!!process.env.NEETO_CI_JOB_ID;
|
|
6999
7558
|
const definePlaywrightConfig = (overrides) => {
|
|
7000
7559
|
const { globalOverrides = {}, useOverrides = {}, projectOverrides = [], currentsOverrides = {}, } = overrides;
|
|
7001
|
-
return defineConfig({
|
|
7560
|
+
return test.defineConfig({
|
|
7002
7561
|
testDir: "./e2e/tests",
|
|
7003
|
-
fullyParallel:
|
|
7562
|
+
fullyParallel: true,
|
|
7004
7563
|
forbidOnly: isCI,
|
|
7005
7564
|
retries: isCI ? 1 : 0,
|
|
7006
7565
|
timeout: 0,
|
|
@@ -7025,7 +7584,7 @@ const definePlaywrightConfig = (overrides) => {
|
|
|
7025
7584
|
},
|
|
7026
7585
|
{
|
|
7027
7586
|
name: "chromium",
|
|
7028
|
-
use: { ...devices["Desktop Chrome"], storageState },
|
|
7587
|
+
use: { ...test.devices["Desktop Chrome"], storageState },
|
|
7029
7588
|
dependencies: ["setup"],
|
|
7030
7589
|
},
|
|
7031
7590
|
{ name: "cleanup credentials", testMatch: "global.teardown.ts" },
|
|
@@ -7034,29 +7593,30 @@ const definePlaywrightConfig = (overrides) => {
|
|
|
7034
7593
|
});
|
|
7035
7594
|
};
|
|
7036
7595
|
|
|
7037
|
-
exports.
|
|
7038
|
-
exports.COMMON_SELECTORS = COMMON_SELECTORS$1;
|
|
7596
|
+
exports.COMMON_SELECTORS = COMMON_SELECTORS;
|
|
7039
7597
|
exports.COMMON_TEXTS = COMMON_TEXTS;
|
|
7040
|
-
exports.
|
|
7598
|
+
exports.CREDENTIALS = CREDENTIALS;
|
|
7599
|
+
exports.CustomCommands = CustomCommands;
|
|
7041
7600
|
exports.ENVIRONMENT = ENVIRONMENT;
|
|
7042
7601
|
exports.GLOBAL_TRANSLATIONS_PATTERN = GLOBAL_TRANSLATIONS_PATTERN;
|
|
7043
7602
|
exports.IS_STAGING_ENV = IS_STAGING_ENV;
|
|
7044
|
-
exports.
|
|
7045
|
-
exports.
|
|
7046
|
-
exports.PROFILE_PATH = PROFILE_PATH;
|
|
7603
|
+
exports.LOGIN_SELECTORS = LOGIN_SELECTORS;
|
|
7604
|
+
exports.OrganizationPage = OrganizationPage;
|
|
7047
7605
|
exports.PROJECT_TRANSLATIONS_PATH = PROJECT_TRANSLATIONS_PATH;
|
|
7048
|
-
exports.
|
|
7606
|
+
exports.ROUTES = ROUTES;
|
|
7049
7607
|
exports.SIGNUP_SELECTORS = SIGNUP_SELECTORS;
|
|
7050
|
-
exports.STORAGE_STATE = STORAGE_STATE
|
|
7051
|
-
exports.SUBDOMAIN_AVAILABILITY_PATH = SUBDOMAIN_AVAILABILITY_PATH;
|
|
7608
|
+
exports.STORAGE_STATE = STORAGE_STATE;
|
|
7052
7609
|
exports.clearCredentials = clearCredentials;
|
|
7610
|
+
exports.commands = commands;
|
|
7053
7611
|
exports.definePlaywrightConfig = definePlaywrightConfig;
|
|
7612
|
+
exports.i18n = i18n;
|
|
7054
7613
|
exports.initializeCredentials = initializeCredentials;
|
|
7055
7614
|
exports.joinString = joinString;
|
|
7056
|
-
exports.
|
|
7615
|
+
exports.login = login;
|
|
7616
|
+
exports.loginWithoutSSO = loginWithoutSSO;
|
|
7617
|
+
exports.readFileSyncIfExists = readFileSyncIfExists;
|
|
7057
7618
|
exports.readTranslations = readTranslations;
|
|
7058
7619
|
exports.stagingData = stagingData;
|
|
7059
|
-
exports.test = test;
|
|
7060
7620
|
exports.updateCredentials = updateCredentials;
|
|
7061
7621
|
exports.writeDataToFile = writeDataToFile;
|
|
7062
7622
|
//# sourceMappingURL=index.cjs.js.map
|