@bigbinary/neeto-playwright-commons 1.8.24 → 1.8.25

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
@@ -3,9 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var test$1 = require('@playwright/test');
6
+ var child_process = require('child_process');
6
7
  var require$$0$1 = require('fs');
7
- var require$$0$2 = require('util');
8
8
  var ramda = require('ramda');
9
+ var require$$0$2 = require('util');
9
10
  var faker = require('@faker-js/faker');
10
11
  var MailosaurClient = require('mailosaur');
11
12
  var dayjs = require('dayjs');
@@ -69,6 +70,9 @@ const OTP_EMAIL_PATTERN = "is your login code";
69
70
  const SLACK_DEFAULT_CHANNEL = "general";
70
71
 
71
72
  /* eslint-disable playwright/no-skipped-test */
73
+ const execCommand = (command) => child_process.execSync(command)
74
+ .toString("utf-8")
75
+ .replace(/[\n\r\s]+$/, "");
72
76
  const joinString = (string1, string2, string3 = "", separator = " ") => {
73
77
  if (string3 === "") {
74
78
  return string1 + separator + string2;
@@ -128,6 +132,11 @@ const skipTest = {
128
132
  forDevelopmentEnv: () => test__default["default"].skip(process.env.TEST_ENV === ENVIRONMENT.development),
129
133
  forReviewEnv: () => test__default["default"].skip(process.env.TEST_ENV === ENVIRONMENT.review),
130
134
  forAllExceptStagingEnv: () => test__default["default"].skip(process.env.TEST_ENV !== ENVIRONMENT.staging),
135
+ forNonNightlyRun: () => {
136
+ const currentBranch = execCommand("git rev-parse --abbrev-ref HEAD");
137
+ const isNightlyRun = currentBranch === "main" && process.env.TEST_ENV === ENVIRONMENT.staging;
138
+ return test__default["default"].skip(ramda.not(isNightlyRun), "Run test only in playwright-nightly");
139
+ },
131
140
  };
132
141
  const shouldSkipSetupAndTeardown = () => { var _a; return ((_a = getGlobalUserState()) === null || _a === void 0 ? void 0 : _a.isLoggedIn) && process.env.SKIP_SETUP === "true"; };
133
142