@bigbinary/neeto-playwright-commons 1.26.25 → 1.26.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -125032,8 +125032,31 @@ const playdashLighthouseConfig = {
125032
125032
  const isCI = neetoCist.isPresent(process.env.NEETO_CI_JOB_ID);
125033
125033
  const railsPort = process.env.RAILS_SERVER_PORT;
125034
125034
  const vitePort = process.env.VITE_PORT;
125035
+ const PROJECT_NAMES = {
125036
+ setup: "setup",
125037
+ chromium: "chromium",
125038
+ webkit: "webkit",
125039
+ lighthouseAudits: "lighthouse-audits",
125040
+ cleanupCredentials: "cleanup credentials",
125041
+ };
125035
125042
  const definePlaywrightConfig = (overrides) => {
125036
- const { globalOverrides = {}, useOverrides = {}, useCustomProjects = false, projectOverrides = [], playdashStagingOverrides = {}, playdashProductionOverrides = {}, playdashLighthouseOverrides = {}, webServerOverrides = [], } = overrides;
125043
+ const { globalOverrides = {}, useOverrides = {}, useCustomProjects = false, projectOverrides = [], playdashStagingOverrides = {}, playdashProductionOverrides = {}, playdashLighthouseOverrides = {}, webServerOverrides = [], projectLaunchOptionsOverrides = {}, } = overrides;
125044
+ const getProjectLaunchOptions = (projectName, defaultLaunchOptions) => {
125045
+ var _a, _b;
125046
+ const overrides = projectLaunchOptionsOverrides[projectName];
125047
+ if (!overrides)
125048
+ return defaultLaunchOptions;
125049
+ const { mergeArgs = true, ...overrideConfig } = overrides;
125050
+ const defaultArgs = (_a = defaultLaunchOptions === null || defaultLaunchOptions === void 0 ? void 0 : defaultLaunchOptions.args) !== null && _a !== void 0 ? _a : [];
125051
+ const overrideArgs = (_b = overrideConfig.args) !== null && _b !== void 0 ? _b : [];
125052
+ return {
125053
+ ...defaultLaunchOptions,
125054
+ ...overrideConfig,
125055
+ ...((defaultArgs.length > 0 || overrideArgs.length > 0) && {
125056
+ args: mergeArgs ? [...defaultArgs, ...overrideArgs] : overrideArgs,
125057
+ }),
125058
+ };
125059
+ };
125037
125060
  let reporter = !ramda.isEmpty(playdashStagingOverrides)
125038
125061
  ? [
125039
125062
  [
@@ -125106,41 +125129,56 @@ const definePlaywrightConfig = (overrides) => {
125106
125129
  },
125107
125130
  projects: useCustomProjects
125108
125131
  ? projectOverrides
125109
- : [
125110
- {
125111
- name: "setup",
125112
- testMatch: "global.setup.ts",
125113
- teardown: "cleanup credentials",
125114
- },
125115
- {
125116
- name: "chromium",
125117
- use: {
125118
- ...test.devices["Desktop Chrome"],
125119
- storageState: STORAGE_STATE,
125120
- launchOptions: {
125121
- args: ["--js-flags=--max-old-space-size=6144"],
125132
+ : (() => {
125133
+ const webkitLaunchOptions = getProjectLaunchOptions(PROJECT_NAMES.webkit);
125134
+ const lighthouseAuditsLaunchOptions = getProjectLaunchOptions(PROJECT_NAMES.lighthouseAudits);
125135
+ return [
125136
+ {
125137
+ name: PROJECT_NAMES.setup,
125138
+ testMatch: "global.setup.ts",
125139
+ teardown: PROJECT_NAMES.cleanupCredentials,
125140
+ },
125141
+ {
125142
+ name: PROJECT_NAMES.chromium,
125143
+ use: {
125144
+ ...test.devices["Desktop Chrome"],
125145
+ storageState: STORAGE_STATE,
125146
+ launchOptions: getProjectLaunchOptions(PROJECT_NAMES.chromium, {
125147
+ args: ["--js-flags=--max-old-space-size=6144"],
125148
+ }),
125122
125149
  },
125150
+ dependencies: [PROJECT_NAMES.setup],
125123
125151
  },
125124
- dependencies: ["setup"],
125125
- },
125126
- {
125127
- name: "webkit",
125128
- use: {
125129
- ...test.devices["Desktop Safari"],
125130
- storageState: STORAGE_STATE,
125152
+ {
125153
+ name: PROJECT_NAMES.webkit,
125154
+ use: {
125155
+ ...test.devices["Desktop Safari"],
125156
+ storageState: STORAGE_STATE,
125157
+ ...(webkitLaunchOptions && {
125158
+ launchOptions: webkitLaunchOptions,
125159
+ }),
125160
+ },
125161
+ dependencies: [PROJECT_NAMES.setup],
125131
125162
  },
125132
- dependencies: ["setup"],
125133
- },
125134
- {
125135
- name: "lighthouse-audits",
125136
- testDir: "e2e/lighthouse-audits",
125137
- testMatch: "**/*.lighthouse.ts",
125138
- use: { storageState: "e2e/auth/user.json" },
125139
- dependencies: ["setup"],
125140
- },
125141
- { name: "cleanup credentials", testMatch: "global.teardown.ts" },
125142
- ...projectOverrides,
125143
- ],
125163
+ {
125164
+ name: PROJECT_NAMES.lighthouseAudits,
125165
+ testDir: "e2e/lighthouse-audits",
125166
+ testMatch: "**/*.lighthouse.ts",
125167
+ use: {
125168
+ storageState: "e2e/auth/user.json",
125169
+ ...(lighthouseAuditsLaunchOptions && {
125170
+ launchOptions: lighthouseAuditsLaunchOptions,
125171
+ }),
125172
+ },
125173
+ dependencies: [PROJECT_NAMES.setup],
125174
+ },
125175
+ {
125176
+ name: PROJECT_NAMES.cleanupCredentials,
125177
+ testMatch: "global.teardown.ts",
125178
+ },
125179
+ ...projectOverrides,
125180
+ ];
125181
+ })(),
125144
125182
  });
125145
125183
  };
125146
125184
 
@@ -125235,6 +125273,7 @@ exports.PHONE_NUMBER_FORMATS = PHONE_NUMBER_FORMATS;
125235
125273
  exports.PLURAL = PLURAL;
125236
125274
  exports.PROFILE_LINKS = PROFILE_LINKS;
125237
125275
  exports.PROFILE_SECTION_SELECTORS = PROFILE_SECTION_SELECTORS;
125276
+ exports.PROJECT_NAMES = PROJECT_NAMES;
125238
125277
  exports.PROJECT_TRANSLATIONS_PATH = PROJECT_TRANSLATIONS_PATH;
125239
125278
  exports.ROLES_SELECTORS = ROLES_SELECTORS;
125240
125279
  exports.ROUTES = ROUTES;