@playwright/test 1.36.0-alpha-jun-20-2023 → 1.36.0-alpha-jun-21-2023

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.
@@ -236,7 +236,7 @@ function toReporters(reporters) {
236
236
  if (typeof reporters === 'string') return [[reporters]];
237
237
  return reporters;
238
238
  }
239
- const builtInReporters = ['list', 'line', 'dot', 'json', 'junit', 'null', 'github', 'html', 'blob'];
239
+ const builtInReporters = ['list', 'line', 'dot', 'json', 'junit', 'null', 'github', 'html', 'blob', 'markdown'];
240
240
  exports.builtInReporters = builtInReporters;
241
241
  function resolveScript(id, rootDir) {
242
242
  if (!id) return undefined;
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _fs = _interopRequireDefault(require("fs"));
8
+ var _path = _interopRequireDefault(require("path"));
9
+ var _base = require("./base");
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ /**
12
+ * Copyright (c) Microsoft Corporation.
13
+ *
14
+ * Licensed under the Apache License, Version 2.0 (the "License");
15
+ * you may not use this file except in compliance with the License.
16
+ * You may obtain a copy of the License at
17
+ *
18
+ * http://www.apache.org/licenses/LICENSE-2.0
19
+ *
20
+ * Unless required by applicable law or agreed to in writing, software
21
+ * distributed under the License is distributed on an "AS IS" BASIS,
22
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23
+ * See the License for the specific language governing permissions and
24
+ * limitations under the License.
25
+ */
26
+
27
+ class MarkdownReporter extends _base.BaseReporter {
28
+ constructor(options) {
29
+ super();
30
+ this._options = void 0;
31
+ this._options = options;
32
+ }
33
+ printsToStdio() {
34
+ return false;
35
+ }
36
+ async onEnd(result) {
37
+ await super.onEnd(result);
38
+ const summary = this.generateSummary();
39
+ const lines = [];
40
+ lines.push(`:x: <b>failed: ${summary.unexpected.length}</b>`);
41
+ this._printTestList(summary.unexpected, lines);
42
+ if (summary.flaky.length) {
43
+ lines.push(`:warning: <b>flaky: ${summary.flaky.length}</b>`);
44
+ this._printTestList(summary.flaky, lines);
45
+ }
46
+ if (summary.interrupted.length) {
47
+ lines.push(`:warning: <b>interrupted: ${summary.interrupted.length}</b>`);
48
+ this._printTestList(summary.interrupted, lines);
49
+ }
50
+ if (summary.skipped) {
51
+ lines.push(`:ballot_box_with_check: <b>skipped: ${summary.skipped}</b>`);
52
+ lines.push(``);
53
+ }
54
+ lines.push(`:white_check_mark: <b>passed: ${summary.expected}</b>`);
55
+ lines.push(``);
56
+ const reportFile = _path.default.resolve(this._options.configDir, this._options.outputFile || 'report.md');
57
+ await _fs.default.promises.mkdir(_path.default.dirname(reportFile), {
58
+ recursive: true
59
+ });
60
+ await _fs.default.promises.writeFile(reportFile, lines.join('\n'));
61
+ }
62
+ _printTestList(tests, lines) {
63
+ for (const test of tests) lines.push(` - ${(0, _base.formatTestTitle)(this.config, test)}`);
64
+ lines.push(``);
65
+ }
66
+ }
67
+ var _default = MarkdownReporter;
68
+ exports.default = _default;
@@ -15,6 +15,7 @@ var _json = _interopRequireDefault(require("../reporters/json"));
15
15
  var _junit = _interopRequireDefault(require("../reporters/junit"));
16
16
  var _line = _interopRequireDefault(require("../reporters/line"));
17
17
  var _list = _interopRequireDefault(require("../reporters/list"));
18
+ var _markdown = _interopRequireDefault(require("../reporters/markdown"));
18
19
  var _loadUtils = require("./loadUtils");
19
20
  var _blob = require("../reporters/blob");
20
21
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -45,7 +46,8 @@ async function createReporters(config, mode, descriptions) {
45
46
  junit: _junit.default,
46
47
  null: _empty.default,
47
48
  html: mode === 'ui' ? _line.default : _html.default,
48
- blob: _blob.BlobReporter
49
+ blob: _blob.BlobReporter,
50
+ markdown: _markdown.default
49
51
  };
50
52
  const reporters = [];
51
53
  (_descriptions = descriptions) !== null && _descriptions !== void 0 ? _descriptions : descriptions = config.config.reporter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playwright/test",
3
- "version": "1.36.0-alpha-jun-20-2023",
3
+ "version": "1.36.0-alpha-jun-21-2023",
4
4
  "description": "A high-level API to automate web browsers",
5
5
  "repository": "github:Microsoft/playwright",
6
6
  "homepage": "https://playwright.dev",
@@ -41,7 +41,7 @@
41
41
  "license": "Apache-2.0",
42
42
  "dependencies": {
43
43
  "@types/node": "*",
44
- "playwright-core": "1.36.0-alpha-jun-20-2023"
44
+ "playwright-core": "1.36.0-alpha-jun-21-2023"
45
45
  },
46
46
  "optionalDependencies": {
47
47
  "fsevents": "2.3.2"