@uuv/playwright 2.6.5 → 2.7.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.
@@ -113,7 +113,7 @@ function translateFeatures(tempDir, configDir) {
113
113
  console.log(chalk_1.default.gray(`[WRITE] ${generatedFile} written successfully`));
114
114
  });
115
115
  }
116
- function runPlaywright(mode, configDir, browser = "chromium", generateHtmlReport = false, env, targetTestFile) {
116
+ function runPlaywright(mode, configDir, browser = "chromium", generateHtmlReport = false, generateJunitReport = false, env, targetTestFile) {
117
117
  const configFile = `${configDir}/playwright.config.ts`;
118
118
  const reportType = generateHtmlReport ? uuv_playwright_reporter_helper_1.GeneratedReportType.HTML : uuv_playwright_reporter_helper_1.GeneratedReportType.CONSOLE;
119
119
  try {
@@ -129,8 +129,15 @@ function runPlaywright(mode, configDir, browser = "chromium", generateHtmlReport
129
129
  if (env) {
130
130
  Object.keys(env).forEach(key => process.env[key] = env[key]);
131
131
  }
132
+ let reporter = " --reporter=@uuv/playwright/uuv-playwright-reporter";
133
+ if (generateJunitReport) {
134
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
135
+ // @ts-ignore
136
+ process.env.PLAYWRIGHT_JUNIT_OUTPUT_NAME = `${configDir}/reports/e2e/junit-report.xml`;
137
+ reporter = `${reporter},junit`;
138
+ }
132
139
  // eslint-disable-next-line max-len
133
- const command = `npx playwright test --project=${browser} -c ${configFile} ${mode === "open" ? "--ui" : ""}${getTargetTestFileForPlawright(targetTestFile)}`;
140
+ const command = `npx playwright test --project=${browser} -c ${configFile} ${mode === "open" ? "--ui" : ""}${reporter}${getTargetTestFileForPlawright(targetTestFile)}`;
134
141
  console.log(chalk_1.default.gray(`Running ${command}`));
135
142
  (0, child_process_1.execSync)(command, { stdio: "inherit" });
136
143
  }
@@ -159,7 +166,7 @@ async function run(mode, tempDir = "uuv/.features-gen/e2e", configDir = "uuv", a
159
166
  if (mode === "open") {
160
167
  child_process_1.default.fork(path_1.default.join(__dirname, "watch-test-files"), [tempDir, configDir, env]);
161
168
  }
162
- runPlaywright(mode, configDir, browser, argv.generateHtmlReport, env, targetTestFile);
169
+ runPlaywright(mode, configDir, browser, argv.generateHtmlReport, argv.generateJunitReport, env, targetTestFile);
163
170
  }
164
171
  exports.run = run;
165
172
  function extractArgs(argv) {
@@ -1,6 +1,5 @@
1
- import { FullConfig, FullResult, Suite, TestCase, TestResult } from "@playwright/test/reporter";
1
+ import { FullConfig, FullResult, Suite, TestCase, TestStep, TestResult } from "@playwright/test/reporter";
2
2
  import { Envelope } from "@cucumber/messages";
3
- import { TestStep } from "@playwright/test/types/testReporter";
4
3
  export declare enum GeneratedReportType {
5
4
  CONSOLE = "console",
6
5
  HTML = "html"
@@ -1,5 +1,4 @@
1
- import { FullConfig, FullResult, Reporter, Suite, TestCase, TestResult } from "@playwright/test/reporter";
2
- import { TestError, TestStep } from "@playwright/test/types/testReporter";
1
+ import { FullConfig, FullResult, Reporter, Suite, TestCase, TestError, TestResult, TestStep } from "@playwright/test/reporter";
3
2
  declare class UuvPlawrightReporter implements Reporter {
4
3
  private helper;
5
4
  onBegin(config: FullConfig, suite: Suite): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uuv/playwright",
3
- "version": "2.6.5",
3
+ "version": "2.7.1",
4
4
  "type": "commonjs",
5
5
  "author": "Louis Fredice NJAKO MOLOM (https://github.com/luifr10) & Stanley SERVICAL (https://github.com/stanlee974)",
6
6
  "description": "A solution to facilitate the writing and execution of E2E tests understandable by any human being using cucumber(BDD) and playwright",
@@ -38,14 +38,13 @@
38
38
  "postinstall": "node postinstall.js",
39
39
  "test:run": "ts-node test.ts run",
40
40
  "test:open": "ts-node test.ts open --",
41
- "test:alone:run": "npx playwright test",
42
41
  "test": "npm run test:run --"
43
42
  },
44
43
  "dependencies": {
45
44
  "@cucumber/cucumber": "9.6.0",
46
45
  "@cucumber/tag-expressions": "^6.0.0",
47
- "@playwright/test": "1.33.0",
48
- "@uuv/runner-commons": "2.6.5",
46
+ "@playwright/test": "1.41.2",
47
+ "@uuv/runner-commons": "2.7.1",
49
48
  "axe-core": "4.8.4",
50
49
  "axe-playwright": "1.2.3",
51
50
  "chalk": "4.1.2",
@@ -92,7 +91,7 @@
92
91
  "@types/node": "16.18.68",
93
92
  "cross-env": "7.0.3",
94
93
  "eslint-plugin-cucumber": "2.0.0",
95
- "eslint-plugin-jest": "27.6.3",
94
+ "eslint-plugin-jest": "27.9.0",
96
95
  "eslint-plugin-playwright": "0.12.0",
97
96
  "ts-loader": "9.4.2",
98
97
  "tsconfig-paths": "4.2.0",