@bigbinary/neeto-playwright-commons 2.3.0 → 3.0.1
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 +49 -46
- package/index.cjs.js.map +1 -1
- package/index.d.ts +3 -1
- package/index.js +50 -48
- package/index.js.map +1 -1
- package/package.json +12 -16
- package/scripts/neeto-auth/setup.sh +0 -0
package/index.cjs.js
CHANGED
|
@@ -19,9 +19,9 @@ var require$$1$3 = require('node:stream');
|
|
|
19
19
|
var require$$0$8 = require('crypto');
|
|
20
20
|
var require$$1$4 = require('zlib');
|
|
21
21
|
var require$$0$9 = require('assert');
|
|
22
|
-
var require$$
|
|
22
|
+
var require$$1$5 = require('tty');
|
|
23
23
|
var stealth$1 = require('puppeteer-extra-plugin-stealth');
|
|
24
|
-
var require$$1$
|
|
24
|
+
var require$$1$6 = require('events');
|
|
25
25
|
var customParseFormat = require('dayjs/plugin/customParseFormat');
|
|
26
26
|
var timezone = require('dayjs/plugin/timezone');
|
|
27
27
|
var utc = require('dayjs/plugin/utc');
|
|
@@ -415,6 +415,7 @@ const ENVIRONMENT = {
|
|
|
415
415
|
const EXAMPLE_URL = "https://example.com";
|
|
416
416
|
const IS_STAGING_ENV = process.env.TEST_ENV === ENVIRONMENT.staging;
|
|
417
417
|
const IS_DEV_ENV = process.env.TEST_ENV === ENVIRONMENT.development;
|
|
418
|
+
const IS_CI = neetoCist.isPresent(process.env.NEETO_CI_JOB_ID);
|
|
418
419
|
const DEFAULT_WEBHOOKS_RESPONSE_TEXT = JSON.stringify({ success: true });
|
|
419
420
|
const STORAGE_STATE = "./e2e/auth/user.json";
|
|
420
421
|
const GLOBAL_TRANSLATIONS_PATTERN = "../node_modules/@bigbinary/**/translations/en.json";
|
|
@@ -5133,8 +5134,8 @@ const skipTest = {
|
|
|
5133
5134
|
forNonNightlyRun: () => {
|
|
5134
5135
|
const currentBranch = execCommand("git rev-parse --abbrev-ref HEAD");
|
|
5135
5136
|
const isNightlyRun = currentBranch === "main" &&
|
|
5136
|
-
|
|
5137
|
-
|
|
5137
|
+
IS_STAGING_ENV &&
|
|
5138
|
+
IS_CI;
|
|
5138
5139
|
return test.skip(ramda.not(isNightlyRun), "Run test only in playwright-nightly");
|
|
5139
5140
|
},
|
|
5140
5141
|
ifNotWithinAllowedNightlyHours: ({ reason, allowedNightlyRunHours = [0, 6, 12, 18], }) => {
|
|
@@ -5413,6 +5414,7 @@ const HELP_CENTER_SELECTORS = {
|
|
|
5413
5414
|
};
|
|
5414
5415
|
|
|
5415
5416
|
const NEETO_IMAGE_UPLOADER_SELECTORS = {
|
|
5417
|
+
libraryImageCard: "library-image-card",
|
|
5416
5418
|
imageUploaderWrapper: "image-uploader-wrapper",
|
|
5417
5419
|
browseText: "neeto-image-uploader-browse-text",
|
|
5418
5420
|
fileInput: "neeto-image-uploader-file-input",
|
|
@@ -107259,7 +107261,7 @@ const STATIC_ASSET_PATTERN = /\.(js|css|woff2?|ttf|eot|png|svg|ico|gif|webp)(\?.
|
|
|
107259
107261
|
const assetCache = new Map();
|
|
107260
107262
|
const commands = {
|
|
107261
107263
|
context: async ({ context }, use) => {
|
|
107262
|
-
if (IS_DEV_ENV) {
|
|
107264
|
+
if (IS_DEV_ENV && IS_CI) {
|
|
107263
107265
|
await context.route(STATIC_ASSET_PATTERN, async (route) => {
|
|
107264
107266
|
const url = route.request().url();
|
|
107265
107267
|
const hit = assetCache.get(url);
|
|
@@ -108056,12 +108058,12 @@ var hasRequiredHasFlag;
|
|
|
108056
108058
|
function requireHasFlag () {
|
|
108057
108059
|
if (hasRequiredHasFlag) return hasFlag;
|
|
108058
108060
|
hasRequiredHasFlag = 1;
|
|
108059
|
-
|
|
108060
|
-
|
|
108061
|
+
|
|
108062
|
+
hasFlag = (flag, argv = process.argv) => {
|
|
108061
108063
|
const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
|
|
108062
|
-
const
|
|
108063
|
-
const
|
|
108064
|
-
return
|
|
108064
|
+
const position = argv.indexOf(prefix + flag);
|
|
108065
|
+
const terminatorPosition = argv.indexOf('--');
|
|
108066
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
108065
108067
|
};
|
|
108066
108068
|
return hasFlag;
|
|
108067
108069
|
}
|
|
@@ -108073,23 +108075,32 @@ function requireSupportsColor () {
|
|
|
108073
108075
|
if (hasRequiredSupportsColor) return supportsColor_1;
|
|
108074
108076
|
hasRequiredSupportsColor = 1;
|
|
108075
108077
|
const os = require$$0$4;
|
|
108078
|
+
const tty = require$$1$5;
|
|
108076
108079
|
const hasFlag = requireHasFlag();
|
|
108077
108080
|
|
|
108078
|
-
const env = process
|
|
108081
|
+
const {env} = process;
|
|
108079
108082
|
|
|
108080
108083
|
let forceColor;
|
|
108081
108084
|
if (hasFlag('no-color') ||
|
|
108082
108085
|
hasFlag('no-colors') ||
|
|
108083
|
-
hasFlag('color=false')
|
|
108084
|
-
|
|
108086
|
+
hasFlag('color=false') ||
|
|
108087
|
+
hasFlag('color=never')) {
|
|
108088
|
+
forceColor = 0;
|
|
108085
108089
|
} else if (hasFlag('color') ||
|
|
108086
108090
|
hasFlag('colors') ||
|
|
108087
108091
|
hasFlag('color=true') ||
|
|
108088
108092
|
hasFlag('color=always')) {
|
|
108089
|
-
forceColor =
|
|
108093
|
+
forceColor = 1;
|
|
108090
108094
|
}
|
|
108095
|
+
|
|
108091
108096
|
if ('FORCE_COLOR' in env) {
|
|
108092
|
-
|
|
108097
|
+
if (env.FORCE_COLOR === 'true') {
|
|
108098
|
+
forceColor = 1;
|
|
108099
|
+
} else if (env.FORCE_COLOR === 'false') {
|
|
108100
|
+
forceColor = 0;
|
|
108101
|
+
} else {
|
|
108102
|
+
forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
|
|
108103
|
+
}
|
|
108093
108104
|
}
|
|
108094
108105
|
|
|
108095
108106
|
function translateLevel(level) {
|
|
@@ -108105,8 +108116,8 @@ function requireSupportsColor () {
|
|
|
108105
108116
|
};
|
|
108106
108117
|
}
|
|
108107
108118
|
|
|
108108
|
-
function supportsColor(
|
|
108109
|
-
if (forceColor ===
|
|
108119
|
+
function supportsColor(haveStream, streamIsTTY) {
|
|
108120
|
+
if (forceColor === 0) {
|
|
108110
108121
|
return 0;
|
|
108111
108122
|
}
|
|
108112
108123
|
|
|
@@ -108120,22 +108131,21 @@ function requireSupportsColor () {
|
|
|
108120
108131
|
return 2;
|
|
108121
108132
|
}
|
|
108122
108133
|
|
|
108123
|
-
if (
|
|
108134
|
+
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
|
108124
108135
|
return 0;
|
|
108125
108136
|
}
|
|
108126
108137
|
|
|
108127
|
-
const min = forceColor
|
|
108138
|
+
const min = forceColor || 0;
|
|
108139
|
+
|
|
108140
|
+
if (env.TERM === 'dumb') {
|
|
108141
|
+
return min;
|
|
108142
|
+
}
|
|
108128
108143
|
|
|
108129
108144
|
if (process.platform === 'win32') {
|
|
108130
|
-
//
|
|
108131
|
-
//
|
|
108132
|
-
// won't work. However, here we target Node.js 8 at minimum as it is an LTS
|
|
108133
|
-
// release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows
|
|
108134
|
-
// release that supports 256 colors. Windows 10 build 14931 is the first release
|
|
108135
|
-
// that supports 16m/TrueColor.
|
|
108145
|
+
// Windows 10 build 10586 is the first Windows release that supports 256 colors.
|
|
108146
|
+
// Windows 10 build 14931 is the first release that supports 16m/TrueColor.
|
|
108136
108147
|
const osRelease = os.release().split('.');
|
|
108137
108148
|
if (
|
|
108138
|
-
Number(process.versions.node.split('.')[0]) >= 8 &&
|
|
108139
108149
|
Number(osRelease[0]) >= 10 &&
|
|
108140
108150
|
Number(osRelease[2]) >= 10586
|
|
108141
108151
|
) {
|
|
@@ -108146,7 +108156,7 @@ function requireSupportsColor () {
|
|
|
108146
108156
|
}
|
|
108147
108157
|
|
|
108148
108158
|
if ('CI' in env) {
|
|
108149
|
-
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
|
|
108159
|
+
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
|
|
108150
108160
|
return 1;
|
|
108151
108161
|
}
|
|
108152
108162
|
|
|
@@ -108185,22 +108195,18 @@ function requireSupportsColor () {
|
|
|
108185
108195
|
return 1;
|
|
108186
108196
|
}
|
|
108187
108197
|
|
|
108188
|
-
if (env.TERM === 'dumb') {
|
|
108189
|
-
return min;
|
|
108190
|
-
}
|
|
108191
|
-
|
|
108192
108198
|
return min;
|
|
108193
108199
|
}
|
|
108194
108200
|
|
|
108195
108201
|
function getSupportLevel(stream) {
|
|
108196
|
-
const level = supportsColor(stream);
|
|
108202
|
+
const level = supportsColor(stream, stream && stream.isTTY);
|
|
108197
108203
|
return translateLevel(level);
|
|
108198
108204
|
}
|
|
108199
108205
|
|
|
108200
108206
|
supportsColor_1 = {
|
|
108201
108207
|
supportsColor: getSupportLevel,
|
|
108202
|
-
stdout:
|
|
108203
|
-
stderr:
|
|
108208
|
+
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
|
|
108209
|
+
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
|
108204
108210
|
};
|
|
108205
108211
|
return supportsColor_1;
|
|
108206
108212
|
}
|
|
@@ -108215,7 +108221,7 @@ function requireNode () {
|
|
|
108215
108221
|
if (hasRequiredNode) return node.exports;
|
|
108216
108222
|
hasRequiredNode = 1;
|
|
108217
108223
|
(function (module, exports$1) {
|
|
108218
|
-
const tty = require$$
|
|
108224
|
+
const tty = require$$1$5;
|
|
108219
108225
|
const util = require$$0$3;
|
|
108220
108226
|
|
|
108221
108227
|
/**
|
|
@@ -115551,7 +115557,7 @@ function requireAsync$3 () {
|
|
|
115551
115557
|
if (hasRequiredAsync$3) return async$2;
|
|
115552
115558
|
hasRequiredAsync$3 = 1;
|
|
115553
115559
|
Object.defineProperty(async$2, "__esModule", { value: true });
|
|
115554
|
-
const events_1 = require$$1$
|
|
115560
|
+
const events_1 = require$$1$6;
|
|
115555
115561
|
const fsScandir = requireOut$2();
|
|
115556
115562
|
const fastq = requireQueue();
|
|
115557
115563
|
const common = requireCommon();
|
|
@@ -121012,9 +121018,6 @@ class CustomDomainPage {
|
|
|
121012
121018
|
]);
|
|
121013
121019
|
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
121014
121020
|
await validateButton.click();
|
|
121015
|
-
await test.expect
|
|
121016
|
-
.soft(this.page.getByTestId(COMMON_SELECTORS.calloutElement))
|
|
121017
|
-
.toBeVisible({ timeout: 15_000 });
|
|
121018
121021
|
let isCertificateLimitExceeded = false;
|
|
121019
121022
|
await test.expect(async () => {
|
|
121020
121023
|
isCertificateLimitExceeded = await this.isCertificateLimitExceeded();
|
|
@@ -125891,7 +125894,6 @@ const playdashProductionHealthConfig = {
|
|
|
125891
125894
|
ciBuildId: process.env.NEETO_CI_JOB_ID,
|
|
125892
125895
|
tags: process.env.TAG,
|
|
125893
125896
|
};
|
|
125894
|
-
const isCI = neetoCist.isPresent(process.env.NEETO_CI_JOB_ID);
|
|
125895
125897
|
const railsPort = process.env.RAILS_SERVER_PORT;
|
|
125896
125898
|
const vitePort = process.env.VITE_PORT;
|
|
125897
125899
|
const PROJECT_NAMES = {
|
|
@@ -125955,18 +125957,18 @@ const definePlaywrightConfig = (overrides) => {
|
|
|
125955
125957
|
return test.defineConfig({
|
|
125956
125958
|
testDir: "./e2e/tests",
|
|
125957
125959
|
fullyParallel: true,
|
|
125958
|
-
forbidOnly:
|
|
125959
|
-
retries:
|
|
125960
|
+
forbidOnly: IS_CI,
|
|
125961
|
+
retries: IS_CI ? 1 : 0,
|
|
125960
125962
|
timeout: 5 * 60 * 1000,
|
|
125961
|
-
workers:
|
|
125962
|
-
reporter:
|
|
125963
|
+
workers: IS_CI ? 6 : 5,
|
|
125964
|
+
reporter: IS_CI ? reporter : [["line"]],
|
|
125963
125965
|
...(specPatterns && { testMatch: specPatterns }),
|
|
125964
125966
|
...(IS_DEV_ENV && {
|
|
125965
125967
|
webServer: [
|
|
125966
125968
|
{
|
|
125967
125969
|
command: `bundle exec puma -b tcp://0.0.0.0:${railsPort} -C config/puma.rb`,
|
|
125968
125970
|
url: `http://spinkart.lvh.me:${railsPort}`,
|
|
125969
|
-
reuseExistingServer: !
|
|
125971
|
+
reuseExistingServer: !IS_CI,
|
|
125970
125972
|
timeout: 5 * 60 * 1000,
|
|
125971
125973
|
cwd: "..",
|
|
125972
125974
|
env: { ...process.env, PORT: railsPort ?? "" },
|
|
@@ -125974,7 +125976,7 @@ const definePlaywrightConfig = (overrides) => {
|
|
|
125974
125976
|
{
|
|
125975
125977
|
command: "yarn dev --host",
|
|
125976
125978
|
url: `http://127.0.0.1:${vitePort}/@vite/client`,
|
|
125977
|
-
reuseExistingServer: !
|
|
125979
|
+
reuseExistingServer: !IS_CI,
|
|
125978
125980
|
timeout: 2 * 60 * 1000,
|
|
125979
125981
|
cwd: "..",
|
|
125980
125982
|
},
|
|
@@ -126126,6 +126128,7 @@ exports.INTEGRATIONS_TEXTS = INTEGRATIONS_TEXTS;
|
|
|
126126
126128
|
exports.INTEGRATION_SELECTORS = INTEGRATION_SELECTORS;
|
|
126127
126129
|
exports.IPRestrictionsPage = IPRestrictionsPage;
|
|
126128
126130
|
exports.IP_RESTRICTIONS_SELECTORS = IP_RESTRICTIONS_SELECTORS;
|
|
126131
|
+
exports.IS_CI = IS_CI;
|
|
126129
126132
|
exports.IS_DEV_ENV = IS_DEV_ENV;
|
|
126130
126133
|
exports.IS_STAGING_ENV = IS_STAGING_ENV;
|
|
126131
126134
|
exports.ImageUploader = ImageUploader;
|