@bigbinary/neeto-playwright-commons 1.26.25 → 1.26.27

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
@@ -133,7 +133,7 @@ const NEETO_ROUTES = {
133
133
  imageUploader: "/neeto_image_uploader_engine",
134
134
  };
135
135
  const PROFILE_LINKS = {
136
- neetoStatus: "https://www.neetostatus.com/",
136
+ neetoStatus: "https://neetostatus.com/",
137
137
  neetoCommunity: "https://www.launchpass.com/neetohq",
138
138
  };
139
139
 
@@ -57386,6 +57386,8 @@ class FastmailApi {
57386
57386
  constructor(neetoPlaywrightUtilities) {
57387
57387
  this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
57388
57388
  this.authorizeAndSetAccountId = async () => {
57389
+ if (IS_DEV_ENV)
57390
+ return;
57389
57391
  const response = await this.neetoPlaywrightUtilities.apiRequest({
57390
57392
  method: "get",
57391
57393
  url: "https://api.fastmail.com/.well-known/jmap",
@@ -57411,7 +57413,7 @@ class FastmailApi {
57411
57413
  url: `https://www.fastmailusercontent.com/jmap/download/${this.accountId}/${blobId}/${attachmentName}`,
57412
57414
  headers: this.headers,
57413
57415
  });
57414
- if (!process.env.NEETO_AUTOMATION_FASTMAIL_API_KEY)
57416
+ if (!IS_DEV_ENV && !process.env.NEETO_AUTOMATION_FASTMAIL_API_KEY)
57415
57417
  throw new Error("Please set the environment variable NEETO_AUTOMATION_FASTMAIL_API_KEYS. Credentials can be found in the Automation Credentials vault in the BigBinary 1Password account.");
57416
57418
  this.headers = {
57417
57419
  "Content-Type": "application/json",
@@ -125032,8 +125034,31 @@ const playdashLighthouseConfig = {
125032
125034
  const isCI = neetoCist.isPresent(process.env.NEETO_CI_JOB_ID);
125033
125035
  const railsPort = process.env.RAILS_SERVER_PORT;
125034
125036
  const vitePort = process.env.VITE_PORT;
125037
+ const PROJECT_NAMES = {
125038
+ setup: "setup",
125039
+ chromium: "chromium",
125040
+ webkit: "webkit",
125041
+ lighthouseAudits: "lighthouse-audits",
125042
+ cleanupCredentials: "cleanup credentials",
125043
+ };
125035
125044
  const definePlaywrightConfig = (overrides) => {
125036
- const { globalOverrides = {}, useOverrides = {}, useCustomProjects = false, projectOverrides = [], playdashStagingOverrides = {}, playdashProductionOverrides = {}, playdashLighthouseOverrides = {}, webServerOverrides = [], } = overrides;
125045
+ const { globalOverrides = {}, useOverrides = {}, useCustomProjects = false, projectOverrides = [], playdashStagingOverrides = {}, playdashProductionOverrides = {}, playdashLighthouseOverrides = {}, webServerOverrides = [], projectLaunchOptionsOverrides = {}, } = overrides;
125046
+ const getProjectLaunchOptions = (projectName, defaultLaunchOptions) => {
125047
+ var _a, _b;
125048
+ const overrides = projectLaunchOptionsOverrides[projectName];
125049
+ if (!overrides)
125050
+ return defaultLaunchOptions;
125051
+ const { mergeArgs = true, ...overrideConfig } = overrides;
125052
+ const defaultArgs = (_a = defaultLaunchOptions === null || defaultLaunchOptions === void 0 ? void 0 : defaultLaunchOptions.args) !== null && _a !== void 0 ? _a : [];
125053
+ const overrideArgs = (_b = overrideConfig.args) !== null && _b !== void 0 ? _b : [];
125054
+ return {
125055
+ ...defaultLaunchOptions,
125056
+ ...overrideConfig,
125057
+ ...((defaultArgs.length > 0 || overrideArgs.length > 0) && {
125058
+ args: mergeArgs ? [...defaultArgs, ...overrideArgs] : overrideArgs,
125059
+ }),
125060
+ };
125061
+ };
125037
125062
  let reporter = !ramda.isEmpty(playdashStagingOverrides)
125038
125063
  ? [
125039
125064
  [
@@ -125106,41 +125131,56 @@ const definePlaywrightConfig = (overrides) => {
125106
125131
  },
125107
125132
  projects: useCustomProjects
125108
125133
  ? 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"],
125134
+ : (() => {
125135
+ const webkitLaunchOptions = getProjectLaunchOptions(PROJECT_NAMES.webkit);
125136
+ const lighthouseAuditsLaunchOptions = getProjectLaunchOptions(PROJECT_NAMES.lighthouseAudits);
125137
+ return [
125138
+ {
125139
+ name: PROJECT_NAMES.setup,
125140
+ testMatch: "global.setup.ts",
125141
+ teardown: PROJECT_NAMES.cleanupCredentials,
125142
+ },
125143
+ {
125144
+ name: PROJECT_NAMES.chromium,
125145
+ use: {
125146
+ ...test.devices["Desktop Chrome"],
125147
+ storageState: STORAGE_STATE,
125148
+ launchOptions: getProjectLaunchOptions(PROJECT_NAMES.chromium, {
125149
+ args: ["--js-flags=--max-old-space-size=6144"],
125150
+ }),
125122
125151
  },
125152
+ dependencies: [PROJECT_NAMES.setup],
125123
125153
  },
125124
- dependencies: ["setup"],
125125
- },
125126
- {
125127
- name: "webkit",
125128
- use: {
125129
- ...test.devices["Desktop Safari"],
125130
- storageState: STORAGE_STATE,
125154
+ {
125155
+ name: PROJECT_NAMES.webkit,
125156
+ use: {
125157
+ ...test.devices["Desktop Safari"],
125158
+ storageState: STORAGE_STATE,
125159
+ ...(webkitLaunchOptions && {
125160
+ launchOptions: webkitLaunchOptions,
125161
+ }),
125162
+ },
125163
+ dependencies: [PROJECT_NAMES.setup],
125131
125164
  },
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
- ],
125165
+ {
125166
+ name: PROJECT_NAMES.lighthouseAudits,
125167
+ testDir: "e2e/lighthouse-audits",
125168
+ testMatch: "**/*.lighthouse.ts",
125169
+ use: {
125170
+ storageState: "e2e/auth/user.json",
125171
+ ...(lighthouseAuditsLaunchOptions && {
125172
+ launchOptions: lighthouseAuditsLaunchOptions,
125173
+ }),
125174
+ },
125175
+ dependencies: [PROJECT_NAMES.setup],
125176
+ },
125177
+ {
125178
+ name: PROJECT_NAMES.cleanupCredentials,
125179
+ testMatch: "global.teardown.ts",
125180
+ },
125181
+ ...projectOverrides,
125182
+ ];
125183
+ })(),
125144
125184
  });
125145
125185
  };
125146
125186
 
@@ -125235,6 +125275,7 @@ exports.PHONE_NUMBER_FORMATS = PHONE_NUMBER_FORMATS;
125235
125275
  exports.PLURAL = PLURAL;
125236
125276
  exports.PROFILE_LINKS = PROFILE_LINKS;
125237
125277
  exports.PROFILE_SECTION_SELECTORS = PROFILE_SECTION_SELECTORS;
125278
+ exports.PROJECT_NAMES = PROJECT_NAMES;
125238
125279
  exports.PROJECT_TRANSLATIONS_PATH = PROJECT_TRANSLATIONS_PATH;
125239
125280
  exports.ROLES_SELECTORS = ROLES_SELECTORS;
125240
125281
  exports.ROUTES = ROUTES;