@midscene/web 0.1.1 → 0.1.3

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.
Files changed (36) hide show
  1. package/dist/es/playwright-report.js +155 -179
  2. package/dist/lib/playwright-report.js +155 -179
  3. package/dist/visualizer-report/index.html +1 -0
  4. package/dist/visualizer-report/modern.config.json +196 -0
  5. package/dist/visualizer-report/route.json +36 -0
  6. package/dist/visualizer-report/static/css/index.c7751597.css +1 -0
  7. package/dist/visualizer-report/static/css/index.c7751597.css.map +1 -0
  8. package/dist/visualizer-report/static/js/915.d3f73af1.js +6 -0
  9. package/dist/visualizer-report/static/js/915.d3f73af1.js.LICENSE.txt +105 -0
  10. package/dist/visualizer-report/static/js/915.d3f73af1.js.map +1 -0
  11. package/dist/visualizer-report/static/js/async/16.8b96d0ce.js +151 -0
  12. package/dist/visualizer-report/static/js/async/16.8b96d0ce.js.map +1 -0
  13. package/dist/visualizer-report/static/js/async/212.b25a2c30.js +157 -0
  14. package/dist/visualizer-report/static/js/async/212.b25a2c30.js.map +1 -0
  15. package/dist/visualizer-report/static/js/async/353.78fcb703.js +147 -0
  16. package/dist/visualizer-report/static/js/async/353.78fcb703.js.map +1 -0
  17. package/dist/visualizer-report/static/js/async/399.84fa60a7.js +248 -0
  18. package/dist/visualizer-report/static/js/async/399.84fa60a7.js.map +1 -0
  19. package/dist/visualizer-report/static/js/async/453.782b249a.js +41 -0
  20. package/dist/visualizer-report/static/js/async/453.782b249a.js.map +1 -0
  21. package/dist/visualizer-report/static/js/async/544.ee973964.js +1 -0
  22. package/dist/visualizer-report/static/js/async/544.ee973964.js.map +1 -0
  23. package/dist/visualizer-report/static/js/async/983.ef821e39.js +1 -0
  24. package/dist/visualizer-report/static/js/index.ae9a86c5.js +1 -0
  25. package/dist/visualizer-report/static/js/index.ae9a86c5.js.map +1 -0
  26. package/dist/visualizer-report/static/js/lib-antd.55d65804.js +189 -0
  27. package/dist/visualizer-report/static/js/lib-antd.55d65804.js.map +1 -0
  28. package/dist/visualizer-report/static/js/lib-polyfill.3da3e38e.js +1 -0
  29. package/dist/visualizer-report/static/js/lib-polyfill.3da3e38e.js.map +1 -0
  30. package/dist/visualizer-report/static/js/lib-react.c011fc71.js +2 -0
  31. package/dist/visualizer-report/static/js/lib-react.c011fc71.js.LICENSE.txt +39 -0
  32. package/dist/visualizer-report/static/js/lib-react.c011fc71.js.map +1 -0
  33. package/dist/visualizer-report/static/js/lib-router.226970ff.js +2 -0
  34. package/dist/visualizer-report/static/js/lib-router.226970ff.js.LICENSE.txt +32 -0
  35. package/dist/visualizer-report/static/js/lib-router.226970ff.js.map +1 -0
  36. package/package.json +4 -4
@@ -128,7 +128,7 @@ var require_polyfills = __commonJS({
128
128
  fs2.fstatSync = statFixSync(fs2.fstatSync);
129
129
  fs2.lstatSync = statFixSync(fs2.lstatSync);
130
130
  if (fs2.chmod && !fs2.lchmod) {
131
- fs2.lchmod = function(path2, mode, cb) {
131
+ fs2.lchmod = function(path3, mode, cb) {
132
132
  if (cb)
133
133
  process.nextTick(cb);
134
134
  };
@@ -136,7 +136,7 @@ var require_polyfills = __commonJS({
136
136
  };
137
137
  }
138
138
  if (fs2.chown && !fs2.lchown) {
139
- fs2.lchown = function(path2, uid, gid, cb) {
139
+ fs2.lchown = function(path3, uid, gid, cb) {
140
140
  if (cb)
141
141
  process.nextTick(cb);
142
142
  };
@@ -207,9 +207,9 @@ var require_polyfills = __commonJS({
207
207
  };
208
208
  }(fs2.readSync);
209
209
  function patchLchmod(fs3) {
210
- fs3.lchmod = function(path2, mode, callback) {
210
+ fs3.lchmod = function(path3, mode, callback) {
211
211
  fs3.open(
212
- path2,
212
+ path3,
213
213
  constants.O_WRONLY | constants.O_SYMLINK,
214
214
  mode,
215
215
  function(err, fd) {
@@ -227,8 +227,8 @@ var require_polyfills = __commonJS({
227
227
  }
228
228
  );
229
229
  };
230
- fs3.lchmodSync = function(path2, mode) {
231
- var fd = fs3.openSync(path2, constants.O_WRONLY | constants.O_SYMLINK, mode);
230
+ fs3.lchmodSync = function(path3, mode) {
231
+ var fd = fs3.openSync(path3, constants.O_WRONLY | constants.O_SYMLINK, mode);
232
232
  var threw = true;
233
233
  var ret;
234
234
  try {
@@ -249,8 +249,8 @@ var require_polyfills = __commonJS({
249
249
  }
250
250
  function patchLutimes(fs3) {
251
251
  if (constants.hasOwnProperty("O_SYMLINK") && fs3.futimes) {
252
- fs3.lutimes = function(path2, at, mt, cb) {
253
- fs3.open(path2, constants.O_SYMLINK, function(er, fd) {
252
+ fs3.lutimes = function(path3, at, mt, cb) {
253
+ fs3.open(path3, constants.O_SYMLINK, function(er, fd) {
254
254
  if (er) {
255
255
  if (cb)
256
256
  cb(er);
@@ -264,8 +264,8 @@ var require_polyfills = __commonJS({
264
264
  });
265
265
  });
266
266
  };
267
- fs3.lutimesSync = function(path2, at, mt) {
268
- var fd = fs3.openSync(path2, constants.O_SYMLINK);
267
+ fs3.lutimesSync = function(path3, at, mt) {
268
+ var fd = fs3.openSync(path3, constants.O_SYMLINK);
269
269
  var ret;
270
270
  var threw = true;
271
271
  try {
@@ -402,12 +402,12 @@ var require_legacy_streams = __commonJS({
402
402
  ReadStream,
403
403
  WriteStream
404
404
  };
405
- function ReadStream(path2, options) {
405
+ function ReadStream(path3, options) {
406
406
  if (!(this instanceof ReadStream))
407
- return new ReadStream(path2, options);
407
+ return new ReadStream(path3, options);
408
408
  Stream.call(this);
409
409
  var self = this;
410
- this.path = path2;
410
+ this.path = path3;
411
411
  this.fd = null;
412
412
  this.readable = true;
413
413
  this.paused = false;
@@ -453,11 +453,11 @@ var require_legacy_streams = __commonJS({
453
453
  self._read();
454
454
  });
455
455
  }
456
- function WriteStream(path2, options) {
456
+ function WriteStream(path3, options) {
457
457
  if (!(this instanceof WriteStream))
458
- return new WriteStream(path2, options);
458
+ return new WriteStream(path3, options);
459
459
  Stream.call(this);
460
- this.path = path2;
460
+ this.path = path3;
461
461
  this.fd = null;
462
462
  this.writable = true;
463
463
  this.flags = "w";
@@ -601,14 +601,14 @@ var require_graceful_fs = __commonJS({
601
601
  fs3.createWriteStream = createWriteStream;
602
602
  var fs$readFile = fs3.readFile;
603
603
  fs3.readFile = readFile;
604
- function readFile(path2, options, cb) {
604
+ function readFile(path3, options, cb) {
605
605
  if (typeof options === "function")
606
606
  cb = options, options = null;
607
- return go$readFile(path2, options, cb);
608
- function go$readFile(path3, options2, cb2, startTime) {
609
- return fs$readFile(path3, options2, function(err) {
607
+ return go$readFile(path3, options, cb);
608
+ function go$readFile(path4, options2, cb2, startTime) {
609
+ return fs$readFile(path4, options2, function(err) {
610
610
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
611
- enqueue([go$readFile, [path3, options2, cb2], err, startTime || Date.now(), Date.now()]);
611
+ enqueue([go$readFile, [path4, options2, cb2], err, startTime || Date.now(), Date.now()]);
612
612
  else {
613
613
  if (typeof cb2 === "function")
614
614
  cb2.apply(this, arguments);
@@ -618,14 +618,14 @@ var require_graceful_fs = __commonJS({
618
618
  }
619
619
  var fs$writeFile = fs3.writeFile;
620
620
  fs3.writeFile = writeFile;
621
- function writeFile(path2, data, options, cb) {
621
+ function writeFile(path3, data, options, cb) {
622
622
  if (typeof options === "function")
623
623
  cb = options, options = null;
624
- return go$writeFile(path2, data, options, cb);
625
- function go$writeFile(path3, data2, options2, cb2, startTime) {
626
- return fs$writeFile(path3, data2, options2, function(err) {
624
+ return go$writeFile(path3, data, options, cb);
625
+ function go$writeFile(path4, data2, options2, cb2, startTime) {
626
+ return fs$writeFile(path4, data2, options2, function(err) {
627
627
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
628
- enqueue([go$writeFile, [path3, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
628
+ enqueue([go$writeFile, [path4, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
629
629
  else {
630
630
  if (typeof cb2 === "function")
631
631
  cb2.apply(this, arguments);
@@ -636,14 +636,14 @@ var require_graceful_fs = __commonJS({
636
636
  var fs$appendFile = fs3.appendFile;
637
637
  if (fs$appendFile)
638
638
  fs3.appendFile = appendFile;
639
- function appendFile(path2, data, options, cb) {
639
+ function appendFile(path3, data, options, cb) {
640
640
  if (typeof options === "function")
641
641
  cb = options, options = null;
642
- return go$appendFile(path2, data, options, cb);
643
- function go$appendFile(path3, data2, options2, cb2, startTime) {
644
- return fs$appendFile(path3, data2, options2, function(err) {
642
+ return go$appendFile(path3, data, options, cb);
643
+ function go$appendFile(path4, data2, options2, cb2, startTime) {
644
+ return fs$appendFile(path4, data2, options2, function(err) {
645
645
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
646
- enqueue([go$appendFile, [path3, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
646
+ enqueue([go$appendFile, [path4, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
647
647
  else {
648
648
  if (typeof cb2 === "function")
649
649
  cb2.apply(this, arguments);
@@ -674,31 +674,31 @@ var require_graceful_fs = __commonJS({
674
674
  var fs$readdir = fs3.readdir;
675
675
  fs3.readdir = readdir;
676
676
  var noReaddirOptionVersions = /^v[0-5]\./;
677
- function readdir(path2, options, cb) {
677
+ function readdir(path3, options, cb) {
678
678
  if (typeof options === "function")
679
679
  cb = options, options = null;
680
- var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path3, options2, cb2, startTime) {
681
- return fs$readdir(path3, fs$readdirCallback(
682
- path3,
680
+ var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path4, options2, cb2, startTime) {
681
+ return fs$readdir(path4, fs$readdirCallback(
682
+ path4,
683
683
  options2,
684
684
  cb2,
685
685
  startTime
686
686
  ));
687
- } : function go$readdir2(path3, options2, cb2, startTime) {
688
- return fs$readdir(path3, options2, fs$readdirCallback(
689
- path3,
687
+ } : function go$readdir2(path4, options2, cb2, startTime) {
688
+ return fs$readdir(path4, options2, fs$readdirCallback(
689
+ path4,
690
690
  options2,
691
691
  cb2,
692
692
  startTime
693
693
  ));
694
694
  };
695
- return go$readdir(path2, options, cb);
696
- function fs$readdirCallback(path3, options2, cb2, startTime) {
695
+ return go$readdir(path3, options, cb);
696
+ function fs$readdirCallback(path4, options2, cb2, startTime) {
697
697
  return function(err, files) {
698
698
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
699
699
  enqueue([
700
700
  go$readdir,
701
- [path3, options2, cb2],
701
+ [path4, options2, cb2],
702
702
  err,
703
703
  startTime || Date.now(),
704
704
  Date.now()
@@ -769,7 +769,7 @@ var require_graceful_fs = __commonJS({
769
769
  enumerable: true,
770
770
  configurable: true
771
771
  });
772
- function ReadStream(path2, options) {
772
+ function ReadStream(path3, options) {
773
773
  if (this instanceof ReadStream)
774
774
  return fs$ReadStream.apply(this, arguments), this;
775
775
  else
@@ -789,7 +789,7 @@ var require_graceful_fs = __commonJS({
789
789
  }
790
790
  });
791
791
  }
792
- function WriteStream(path2, options) {
792
+ function WriteStream(path3, options) {
793
793
  if (this instanceof WriteStream)
794
794
  return fs$WriteStream.apply(this, arguments), this;
795
795
  else
@@ -807,22 +807,22 @@ var require_graceful_fs = __commonJS({
807
807
  }
808
808
  });
809
809
  }
810
- function createReadStream(path2, options) {
811
- return new fs3.ReadStream(path2, options);
810
+ function createReadStream(path3, options) {
811
+ return new fs3.ReadStream(path3, options);
812
812
  }
813
- function createWriteStream(path2, options) {
814
- return new fs3.WriteStream(path2, options);
813
+ function createWriteStream(path3, options) {
814
+ return new fs3.WriteStream(path3, options);
815
815
  }
816
816
  var fs$open = fs3.open;
817
817
  fs3.open = open;
818
- function open(path2, flags, mode, cb) {
818
+ function open(path3, flags, mode, cb) {
819
819
  if (typeof mode === "function")
820
820
  cb = mode, mode = null;
821
- return go$open(path2, flags, mode, cb);
822
- function go$open(path3, flags2, mode2, cb2, startTime) {
823
- return fs$open(path3, flags2, mode2, function(err, fd) {
821
+ return go$open(path3, flags, mode, cb);
822
+ function go$open(path4, flags2, mode2, cb2, startTime) {
823
+ return fs$open(path4, flags2, mode2, function(err, fd) {
824
824
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
825
- enqueue([go$open, [path3, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
825
+ enqueue([go$open, [path4, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
826
826
  else {
827
827
  if (typeof cb2 === "function")
828
828
  cb2.apply(this, arguments);
@@ -1005,10 +1005,10 @@ var require_fs = __commonJS({
1005
1005
  var require_utils = __commonJS({
1006
1006
  "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/utils.js"(exports, module2) {
1007
1007
  "use strict";
1008
- var path2 = require("path");
1008
+ var path3 = require("path");
1009
1009
  module2.exports.checkPath = function checkPath(pth) {
1010
1010
  if (process.platform === "win32") {
1011
- const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path2.parse(pth).root, ""));
1011
+ const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path3.parse(pth).root, ""));
1012
1012
  if (pathHasInvalidWinCharacters) {
1013
1013
  const error = new Error(`Path contains invalid characters: ${pth}`);
1014
1014
  error.code = "EINVAL";
@@ -1073,8 +1073,8 @@ var require_path_exists = __commonJS({
1073
1073
  "use strict";
1074
1074
  var u = require_universalify().fromPromise;
1075
1075
  var fs2 = require_fs();
1076
- function pathExists(path2) {
1077
- return fs2.access(path2).then(() => true).catch(() => false);
1076
+ function pathExists(path3) {
1077
+ return fs2.access(path3).then(() => true).catch(() => false);
1078
1078
  }
1079
1079
  module2.exports = {
1080
1080
  pathExists: u(pathExists),
@@ -1089,8 +1089,8 @@ var require_utimes = __commonJS({
1089
1089
  "use strict";
1090
1090
  var fs2 = require_fs();
1091
1091
  var u = require_universalify().fromPromise;
1092
- async function utimesMillis(path2, atime, mtime) {
1093
- const fd = await fs2.open(path2, "r+");
1092
+ async function utimesMillis(path3, atime, mtime) {
1093
+ const fd = await fs2.open(path3, "r+");
1094
1094
  let closeErr = null;
1095
1095
  try {
1096
1096
  await fs2.futimes(fd, atime, mtime);
@@ -1105,8 +1105,8 @@ var require_utimes = __commonJS({
1105
1105
  throw closeErr;
1106
1106
  }
1107
1107
  }
1108
- function utimesMillisSync(path2, atime, mtime) {
1109
- const fd = fs2.openSync(path2, "r+");
1108
+ function utimesMillisSync(path3, atime, mtime) {
1109
+ const fd = fs2.openSync(path3, "r+");
1110
1110
  fs2.futimesSync(fd, atime, mtime);
1111
1111
  return fs2.closeSync(fd);
1112
1112
  }
@@ -1122,7 +1122,7 @@ var require_stat = __commonJS({
1122
1122
  "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/stat.js"(exports, module2) {
1123
1123
  "use strict";
1124
1124
  var fs2 = require_fs();
1125
- var path2 = require("path");
1125
+ var path3 = require("path");
1126
1126
  var u = require_universalify().fromPromise;
1127
1127
  function getStats(src, dest, opts) {
1128
1128
  const statFunc = opts.dereference ? (file) => fs2.stat(file, { bigint: true }) : (file) => fs2.lstat(file, { bigint: true });
@@ -1152,8 +1152,8 @@ var require_stat = __commonJS({
1152
1152
  const { srcStat, destStat } = await getStats(src, dest, opts);
1153
1153
  if (destStat) {
1154
1154
  if (areIdentical(srcStat, destStat)) {
1155
- const srcBaseName = path2.basename(src);
1156
- const destBaseName = path2.basename(dest);
1155
+ const srcBaseName = path3.basename(src);
1156
+ const destBaseName = path3.basename(dest);
1157
1157
  if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
1158
1158
  return { srcStat, destStat, isChangingCase: true };
1159
1159
  }
@@ -1175,8 +1175,8 @@ var require_stat = __commonJS({
1175
1175
  const { srcStat, destStat } = getStatsSync(src, dest, opts);
1176
1176
  if (destStat) {
1177
1177
  if (areIdentical(srcStat, destStat)) {
1178
- const srcBaseName = path2.basename(src);
1179
- const destBaseName = path2.basename(dest);
1178
+ const srcBaseName = path3.basename(src);
1179
+ const destBaseName = path3.basename(dest);
1180
1180
  if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
1181
1181
  return { srcStat, destStat, isChangingCase: true };
1182
1182
  }
@@ -1195,9 +1195,9 @@ var require_stat = __commonJS({
1195
1195
  return { srcStat, destStat };
1196
1196
  }
1197
1197
  async function checkParentPaths(src, srcStat, dest, funcName) {
1198
- const srcParent = path2.resolve(path2.dirname(src));
1199
- const destParent = path2.resolve(path2.dirname(dest));
1200
- if (destParent === srcParent || destParent === path2.parse(destParent).root)
1198
+ const srcParent = path3.resolve(path3.dirname(src));
1199
+ const destParent = path3.resolve(path3.dirname(dest));
1200
+ if (destParent === srcParent || destParent === path3.parse(destParent).root)
1201
1201
  return;
1202
1202
  let destStat;
1203
1203
  try {
@@ -1213,9 +1213,9 @@ var require_stat = __commonJS({
1213
1213
  return checkParentPaths(src, srcStat, destParent, funcName);
1214
1214
  }
1215
1215
  function checkParentPathsSync(src, srcStat, dest, funcName) {
1216
- const srcParent = path2.resolve(path2.dirname(src));
1217
- const destParent = path2.resolve(path2.dirname(dest));
1218
- if (destParent === srcParent || destParent === path2.parse(destParent).root)
1216
+ const srcParent = path3.resolve(path3.dirname(src));
1217
+ const destParent = path3.resolve(path3.dirname(dest));
1218
+ if (destParent === srcParent || destParent === path3.parse(destParent).root)
1219
1219
  return;
1220
1220
  let destStat;
1221
1221
  try {
@@ -1234,8 +1234,8 @@ var require_stat = __commonJS({
1234
1234
  return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
1235
1235
  }
1236
1236
  function isSrcSubdir(src, dest) {
1237
- const srcArr = path2.resolve(src).split(path2.sep).filter((i) => i);
1238
- const destArr = path2.resolve(dest).split(path2.sep).filter((i) => i);
1237
+ const srcArr = path3.resolve(src).split(path3.sep).filter((i) => i);
1238
+ const destArr = path3.resolve(dest).split(path3.sep).filter((i) => i);
1239
1239
  return srcArr.every((cur, i) => destArr[i] === cur);
1240
1240
  }
1241
1241
  function errMsg(src, dest, funcName) {
@@ -1260,7 +1260,7 @@ var require_copy = __commonJS({
1260
1260
  "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy.js"(exports, module2) {
1261
1261
  "use strict";
1262
1262
  var fs2 = require_fs();
1263
- var path2 = require("path");
1263
+ var path3 = require("path");
1264
1264
  var { mkdirs } = require_mkdirs();
1265
1265
  var { pathExists } = require_path_exists();
1266
1266
  var { utimesMillis } = require_utimes();
@@ -1283,7 +1283,7 @@ var require_copy = __commonJS({
1283
1283
  const include = await runFilter(src, dest, opts);
1284
1284
  if (!include)
1285
1285
  return;
1286
- const destParent = path2.dirname(dest);
1286
+ const destParent = path3.dirname(dest);
1287
1287
  const dirExists = await pathExists(destParent);
1288
1288
  if (!dirExists) {
1289
1289
  await mkdirs(destParent);
@@ -1344,8 +1344,8 @@ var require_copy = __commonJS({
1344
1344
  }
1345
1345
  const items = await fs2.readdir(src);
1346
1346
  await Promise.all(items.map(async (item) => {
1347
- const srcItem = path2.join(src, item);
1348
- const destItem = path2.join(dest, item);
1347
+ const srcItem = path3.join(src, item);
1348
+ const destItem = path3.join(dest, item);
1349
1349
  const include = await runFilter(srcItem, destItem, opts);
1350
1350
  if (!include)
1351
1351
  return;
@@ -1359,7 +1359,7 @@ var require_copy = __commonJS({
1359
1359
  async function onLink(destStat, src, dest, opts) {
1360
1360
  let resolvedSrc = await fs2.readlink(src);
1361
1361
  if (opts.dereference) {
1362
- resolvedSrc = path2.resolve(process.cwd(), resolvedSrc);
1362
+ resolvedSrc = path3.resolve(process.cwd(), resolvedSrc);
1363
1363
  }
1364
1364
  if (!destStat) {
1365
1365
  return fs2.symlink(resolvedSrc, dest);
@@ -1373,7 +1373,7 @@ var require_copy = __commonJS({
1373
1373
  throw e;
1374
1374
  }
1375
1375
  if (opts.dereference) {
1376
- resolvedDest = path2.resolve(process.cwd(), resolvedDest);
1376
+ resolvedDest = path3.resolve(process.cwd(), resolvedDest);
1377
1377
  }
1378
1378
  if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
1379
1379
  throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
@@ -1393,7 +1393,7 @@ var require_copy_sync = __commonJS({
1393
1393
  "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy-sync.js"(exports, module2) {
1394
1394
  "use strict";
1395
1395
  var fs2 = require_graceful_fs();
1396
- var path2 = require("path");
1396
+ var path3 = require("path");
1397
1397
  var mkdirsSync = require_mkdirs().mkdirsSync;
1398
1398
  var utimesMillisSync = require_utimes().utimesMillisSync;
1399
1399
  var stat = require_stat();
@@ -1415,7 +1415,7 @@ var require_copy_sync = __commonJS({
1415
1415
  stat.checkParentPathsSync(src, srcStat, dest, "copy");
1416
1416
  if (opts.filter && !opts.filter(src, dest))
1417
1417
  return;
1418
- const destParent = path2.dirname(dest);
1418
+ const destParent = path3.dirname(dest);
1419
1419
  if (!fs2.existsSync(destParent))
1420
1420
  mkdirsSync(destParent);
1421
1421
  return getStats(destStat, src, dest, opts);
@@ -1486,8 +1486,8 @@ var require_copy_sync = __commonJS({
1486
1486
  fs2.readdirSync(src).forEach((item) => copyDirItem(item, src, dest, opts));
1487
1487
  }
1488
1488
  function copyDirItem(item, src, dest, opts) {
1489
- const srcItem = path2.join(src, item);
1490
- const destItem = path2.join(dest, item);
1489
+ const srcItem = path3.join(src, item);
1490
+ const destItem = path3.join(dest, item);
1491
1491
  if (opts.filter && !opts.filter(srcItem, destItem))
1492
1492
  return;
1493
1493
  const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
@@ -1496,7 +1496,7 @@ var require_copy_sync = __commonJS({
1496
1496
  function onLink(destStat, src, dest, opts) {
1497
1497
  let resolvedSrc = fs2.readlinkSync(src);
1498
1498
  if (opts.dereference) {
1499
- resolvedSrc = path2.resolve(process.cwd(), resolvedSrc);
1499
+ resolvedSrc = path3.resolve(process.cwd(), resolvedSrc);
1500
1500
  }
1501
1501
  if (!destStat) {
1502
1502
  return fs2.symlinkSync(resolvedSrc, dest);
@@ -1510,7 +1510,7 @@ var require_copy_sync = __commonJS({
1510
1510
  throw err;
1511
1511
  }
1512
1512
  if (opts.dereference) {
1513
- resolvedDest = path2.resolve(process.cwd(), resolvedDest);
1513
+ resolvedDest = path3.resolve(process.cwd(), resolvedDest);
1514
1514
  }
1515
1515
  if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
1516
1516
  throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
@@ -1547,11 +1547,11 @@ var require_remove = __commonJS({
1547
1547
  "use strict";
1548
1548
  var fs2 = require_graceful_fs();
1549
1549
  var u = require_universalify().fromCallback;
1550
- function remove(path2, callback) {
1551
- fs2.rm(path2, { recursive: true, force: true }, callback);
1550
+ function remove(path3, callback) {
1551
+ fs2.rm(path3, { recursive: true, force: true }, callback);
1552
1552
  }
1553
- function removeSync(path2) {
1554
- fs2.rmSync(path2, { recursive: true, force: true });
1553
+ function removeSync(path3) {
1554
+ fs2.rmSync(path3, { recursive: true, force: true });
1555
1555
  }
1556
1556
  module2.exports = {
1557
1557
  remove: u(remove),
@@ -1566,7 +1566,7 @@ var require_empty = __commonJS({
1566
1566
  "use strict";
1567
1567
  var u = require_universalify().fromPromise;
1568
1568
  var fs2 = require_fs();
1569
- var path2 = require("path");
1569
+ var path3 = require("path");
1570
1570
  var mkdir = require_mkdirs();
1571
1571
  var remove = require_remove();
1572
1572
  var emptyDir = u(async function emptyDir2(dir) {
@@ -1576,7 +1576,7 @@ var require_empty = __commonJS({
1576
1576
  } catch (e) {
1577
1577
  return mkdir.mkdirs(dir);
1578
1578
  }
1579
- return Promise.all(items.map((item) => remove.remove(path2.join(dir, item))));
1579
+ return Promise.all(items.map((item) => remove.remove(path3.join(dir, item))));
1580
1580
  });
1581
1581
  function emptyDirSync(dir) {
1582
1582
  let items;
@@ -1586,7 +1586,7 @@ var require_empty = __commonJS({
1586
1586
  return mkdir.mkdirsSync(dir);
1587
1587
  }
1588
1588
  items.forEach((item) => {
1589
- item = path2.join(dir, item);
1589
+ item = path3.join(dir, item);
1590
1590
  remove.removeSync(item);
1591
1591
  });
1592
1592
  }
@@ -1604,7 +1604,7 @@ var require_file = __commonJS({
1604
1604
  "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/file.js"(exports, module2) {
1605
1605
  "use strict";
1606
1606
  var u = require_universalify().fromPromise;
1607
- var path2 = require("path");
1607
+ var path3 = require("path");
1608
1608
  var fs2 = require_fs();
1609
1609
  var mkdir = require_mkdirs();
1610
1610
  async function createFile(file) {
@@ -1615,7 +1615,7 @@ var require_file = __commonJS({
1615
1615
  }
1616
1616
  if (stats && stats.isFile())
1617
1617
  return;
1618
- const dir = path2.dirname(file);
1618
+ const dir = path3.dirname(file);
1619
1619
  let dirStats = null;
1620
1620
  try {
1621
1621
  dirStats = await fs2.stat(dir);
@@ -1642,7 +1642,7 @@ var require_file = __commonJS({
1642
1642
  }
1643
1643
  if (stats && stats.isFile())
1644
1644
  return;
1645
- const dir = path2.dirname(file);
1645
+ const dir = path3.dirname(file);
1646
1646
  try {
1647
1647
  if (!fs2.statSync(dir).isDirectory()) {
1648
1648
  fs2.readdirSync(dir);
@@ -1667,7 +1667,7 @@ var require_link = __commonJS({
1667
1667
  "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/link.js"(exports, module2) {
1668
1668
  "use strict";
1669
1669
  var u = require_universalify().fromPromise;
1670
- var path2 = require("path");
1670
+ var path3 = require("path");
1671
1671
  var fs2 = require_fs();
1672
1672
  var mkdir = require_mkdirs();
1673
1673
  var { pathExists } = require_path_exists();
@@ -1687,7 +1687,7 @@ var require_link = __commonJS({
1687
1687
  }
1688
1688
  if (dstStat && areIdentical(srcStat, dstStat))
1689
1689
  return;
1690
- const dir = path2.dirname(dstpath);
1690
+ const dir = path3.dirname(dstpath);
1691
1691
  const dirExists = await pathExists(dir);
1692
1692
  if (!dirExists) {
1693
1693
  await mkdir.mkdirs(dir);
@@ -1708,7 +1708,7 @@ var require_link = __commonJS({
1708
1708
  err.message = err.message.replace("lstat", "ensureLink");
1709
1709
  throw err;
1710
1710
  }
1711
- const dir = path2.dirname(dstpath);
1711
+ const dir = path3.dirname(dstpath);
1712
1712
  const dirExists = fs2.existsSync(dir);
1713
1713
  if (dirExists)
1714
1714
  return fs2.linkSync(srcpath, dstpath);
@@ -1726,12 +1726,12 @@ var require_link = __commonJS({
1726
1726
  var require_symlink_paths = __commonJS({
1727
1727
  "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports, module2) {
1728
1728
  "use strict";
1729
- var path2 = require("path");
1729
+ var path3 = require("path");
1730
1730
  var fs2 = require_fs();
1731
1731
  var { pathExists } = require_path_exists();
1732
1732
  var u = require_universalify().fromPromise;
1733
1733
  async function symlinkPaths(srcpath, dstpath) {
1734
- if (path2.isAbsolute(srcpath)) {
1734
+ if (path3.isAbsolute(srcpath)) {
1735
1735
  try {
1736
1736
  await fs2.lstat(srcpath);
1737
1737
  } catch (err) {
@@ -1743,8 +1743,8 @@ var require_symlink_paths = __commonJS({
1743
1743
  toDst: srcpath
1744
1744
  };
1745
1745
  }
1746
- const dstdir = path2.dirname(dstpath);
1747
- const relativeToDst = path2.join(dstdir, srcpath);
1746
+ const dstdir = path3.dirname(dstpath);
1747
+ const relativeToDst = path3.join(dstdir, srcpath);
1748
1748
  const exists = await pathExists(relativeToDst);
1749
1749
  if (exists) {
1750
1750
  return {
@@ -1760,11 +1760,11 @@ var require_symlink_paths = __commonJS({
1760
1760
  }
1761
1761
  return {
1762
1762
  toCwd: srcpath,
1763
- toDst: path2.relative(dstdir, srcpath)
1763
+ toDst: path3.relative(dstdir, srcpath)
1764
1764
  };
1765
1765
  }
1766
1766
  function symlinkPathsSync(srcpath, dstpath) {
1767
- if (path2.isAbsolute(srcpath)) {
1767
+ if (path3.isAbsolute(srcpath)) {
1768
1768
  const exists2 = fs2.existsSync(srcpath);
1769
1769
  if (!exists2)
1770
1770
  throw new Error("absolute srcpath does not exist");
@@ -1773,8 +1773,8 @@ var require_symlink_paths = __commonJS({
1773
1773
  toDst: srcpath
1774
1774
  };
1775
1775
  }
1776
- const dstdir = path2.dirname(dstpath);
1777
- const relativeToDst = path2.join(dstdir, srcpath);
1776
+ const dstdir = path3.dirname(dstpath);
1777
+ const relativeToDst = path3.join(dstdir, srcpath);
1778
1778
  const exists = fs2.existsSync(relativeToDst);
1779
1779
  if (exists) {
1780
1780
  return {
@@ -1787,7 +1787,7 @@ var require_symlink_paths = __commonJS({
1787
1787
  throw new Error("relative srcpath does not exist");
1788
1788
  return {
1789
1789
  toCwd: srcpath,
1790
- toDst: path2.relative(dstdir, srcpath)
1790
+ toDst: path3.relative(dstdir, srcpath)
1791
1791
  };
1792
1792
  }
1793
1793
  module2.exports = {
@@ -1837,7 +1837,7 @@ var require_symlink = __commonJS({
1837
1837
  "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink.js"(exports, module2) {
1838
1838
  "use strict";
1839
1839
  var u = require_universalify().fromPromise;
1840
- var path2 = require("path");
1840
+ var path3 = require("path");
1841
1841
  var fs2 = require_fs();
1842
1842
  var { mkdirs, mkdirsSync } = require_mkdirs();
1843
1843
  var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
@@ -1861,7 +1861,7 @@ var require_symlink = __commonJS({
1861
1861
  const relative = await symlinkPaths(srcpath, dstpath);
1862
1862
  srcpath = relative.toDst;
1863
1863
  const toType = await symlinkType(relative.toCwd, type);
1864
- const dir = path2.dirname(dstpath);
1864
+ const dir = path3.dirname(dstpath);
1865
1865
  if (!await pathExists(dir)) {
1866
1866
  await mkdirs(dir);
1867
1867
  }
@@ -1882,7 +1882,7 @@ var require_symlink = __commonJS({
1882
1882
  const relative = symlinkPathsSync(srcpath, dstpath);
1883
1883
  srcpath = relative.toDst;
1884
1884
  type = symlinkTypeSync(relative.toCwd, type);
1885
- const dir = path2.dirname(dstpath);
1885
+ const dir = path3.dirname(dstpath);
1886
1886
  const exists = fs2.existsSync(dir);
1887
1887
  if (exists)
1888
1888
  return fs2.symlinkSync(srcpath, dstpath, type);
@@ -1975,7 +1975,7 @@ var require_jsonfile = __commonJS({
1975
1975
  return obj;
1976
1976
  }
1977
1977
  var readFile = universalify.fromPromise(_readFile);
1978
- function readFileSync(file, options = {}) {
1978
+ function readFileSync2(file, options = {}) {
1979
1979
  if (typeof options === "string") {
1980
1980
  options = { encoding: options };
1981
1981
  }
@@ -2007,7 +2007,7 @@ var require_jsonfile = __commonJS({
2007
2007
  }
2008
2008
  var jsonfile = {
2009
2009
  readFile,
2010
- readFileSync,
2010
+ readFileSync: readFileSync2,
2011
2011
  writeFile,
2012
2012
  writeFileSync
2013
2013
  };
@@ -2036,18 +2036,18 @@ var require_output_file = __commonJS({
2036
2036
  "use strict";
2037
2037
  var u = require_universalify().fromPromise;
2038
2038
  var fs2 = require_fs();
2039
- var path2 = require("path");
2039
+ var path3 = require("path");
2040
2040
  var mkdir = require_mkdirs();
2041
2041
  var pathExists = require_path_exists().pathExists;
2042
2042
  async function outputFile(file, data, encoding = "utf-8") {
2043
- const dir = path2.dirname(file);
2043
+ const dir = path3.dirname(file);
2044
2044
  if (!await pathExists(dir)) {
2045
2045
  await mkdir.mkdirs(dir);
2046
2046
  }
2047
2047
  return fs2.writeFile(file, data, encoding);
2048
2048
  }
2049
2049
  function outputFileSync(file, ...args) {
2050
- const dir = path2.dirname(file);
2050
+ const dir = path3.dirname(file);
2051
2051
  if (!fs2.existsSync(dir)) {
2052
2052
  mkdir.mkdirsSync(dir);
2053
2053
  }
@@ -2111,7 +2111,7 @@ var require_move = __commonJS({
2111
2111
  "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move.js"(exports, module2) {
2112
2112
  "use strict";
2113
2113
  var fs2 = require_fs();
2114
- var path2 = require("path");
2114
+ var path3 = require("path");
2115
2115
  var { copy } = require_copy2();
2116
2116
  var { remove } = require_remove();
2117
2117
  var { mkdirp } = require_mkdirs();
@@ -2121,8 +2121,8 @@ var require_move = __commonJS({
2121
2121
  const overwrite = opts.overwrite || opts.clobber || false;
2122
2122
  const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
2123
2123
  await stat.checkParentPaths(src, srcStat, dest, "move");
2124
- const destParent = path2.dirname(dest);
2125
- const parsedParentPath = path2.parse(destParent);
2124
+ const destParent = path3.dirname(dest);
2125
+ const parsedParentPath = path3.parse(destParent);
2126
2126
  if (parsedParentPath.root !== destParent) {
2127
2127
  await mkdirp(destParent);
2128
2128
  }
@@ -2163,7 +2163,7 @@ var require_move_sync = __commonJS({
2163
2163
  "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move-sync.js"(exports, module2) {
2164
2164
  "use strict";
2165
2165
  var fs2 = require_graceful_fs();
2166
- var path2 = require("path");
2166
+ var path3 = require("path");
2167
2167
  var copySync = require_copy2().copySync;
2168
2168
  var removeSync = require_remove().removeSync;
2169
2169
  var mkdirpSync = require_mkdirs().mkdirpSync;
@@ -2174,12 +2174,12 @@ var require_move_sync = __commonJS({
2174
2174
  const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
2175
2175
  stat.checkParentPathsSync(src, srcStat, dest, "move");
2176
2176
  if (!isParentRoot(dest))
2177
- mkdirpSync(path2.dirname(dest));
2177
+ mkdirpSync(path3.dirname(dest));
2178
2178
  return doRename(src, dest, overwrite, isChangingCase);
2179
2179
  }
2180
2180
  function isParentRoot(dest) {
2181
- const parent = path2.dirname(dest);
2182
- const parsedPath = path2.parse(parent);
2181
+ const parent = path3.dirname(dest);
2182
+ const parsedPath = path3.parse(parent);
2183
2183
  return parsedPath.root === parent;
2184
2184
  }
2185
2185
  function doRename(src, dest, overwrite, isChangingCase) {
@@ -2243,11 +2243,30 @@ __export(reporter_exports, {
2243
2243
  module.exports = __toCommonJS(reporter_exports);
2244
2244
 
2245
2245
  // src/playwright/reporter/util.ts
2246
- var import_path = __toESM(require("path"));
2247
- var import_fs = __toESM(require("fs"));
2248
- var import_assert = __toESM(require("assert"));
2246
+ var import_path2 = __toESM(require("path"));
2247
+ var import_assert2 = __toESM(require("assert"));
2249
2248
  var import_os = __toESM(require("os"));
2250
2249
  var import_fs_extra = __toESM(require_lib());
2250
+
2251
+ // src/common/utils.ts
2252
+ var import_fs = __toESM(require("fs"));
2253
+ var import_assert = __toESM(require("assert"));
2254
+ var import_path = __toESM(require("path"));
2255
+ var import_image = require("@midscene/core/image");
2256
+ var import_utils = require("@midscene/core/utils");
2257
+ function findNearestPackageJson(dir) {
2258
+ const packageJsonPath = import_path.default.join(dir, "package.json");
2259
+ if (import_fs.default.existsSync(packageJsonPath)) {
2260
+ return dir;
2261
+ }
2262
+ const parentDir = import_path.default.dirname(dir);
2263
+ if (parentDir === dir) {
2264
+ return null;
2265
+ }
2266
+ return findNearestPackageJson(parentDir);
2267
+ }
2268
+
2269
+ // src/playwright/reporter/util.ts
2251
2270
  function generateTestData(testDataList2) {
2252
2271
  const filterDataList = testDataList2.reduce((res, testData) => {
2253
2272
  if (res.find((item) => item.testId === testData.testId)) {
@@ -2256,21 +2275,19 @@ function generateTestData(testDataList2) {
2256
2275
  return [...res, testData];
2257
2276
  }
2258
2277
  }, []);
2259
- const projectDir = process.cwd();
2260
- const reportDir = import_path.default.join(projectDir, "midscene_run", "midscene-report");
2261
- if (!import_fs.default.existsSync(reportDir)) {
2262
- import_fs.default.mkdirSync(reportDir);
2263
- }
2264
- const reportHtmlDir = import_path.default.join(projectDir, `node_modules/@midscene/visualizer-report/.output`);
2265
- const tempDir = import_path.default.join(import_os.default.tmpdir(), "temp-folder");
2278
+ const reportDir = findNearestPackageJson(__dirname);
2279
+ (0, import_assert2.default)(reportDir, `can't get reportDir from ${__dirname}`);
2280
+ const targetReportDir = import_path2.default.join(process.cwd(), "midscene_run", "report");
2281
+ const reportHtmlDir = import_path2.default.join(reportDir, `dist/visualizer-report`);
2282
+ const tempDir = import_path2.default.join(import_os.default.tmpdir(), "temp-folder");
2266
2283
  try {
2267
2284
  import_fs_extra.default.copySync(reportHtmlDir, tempDir);
2268
- import_fs_extra.default.moveSync(tempDir, reportDir, { overwrite: true });
2285
+ import_fs_extra.default.moveSync(tempDir, targetReportDir, { overwrite: true });
2269
2286
  } catch (err) {
2270
2287
  console.error("An error occurred while copying the folder.", err);
2271
2288
  }
2272
2289
  try {
2273
- import_fs_extra.default.removeSync(import_path.default.join(reportDir, "public"));
2290
+ import_fs_extra.default.removeSync(import_path2.default.join(targetReportDir, "public"));
2274
2291
  } catch (err) {
2275
2292
  console.error("An error occurred while deleting the folder.", err);
2276
2293
  }
@@ -2278,60 +2295,19 @@ function generateTestData(testDataList2) {
2278
2295
  const { dumpPath } = testData;
2279
2296
  if (dumpPath) {
2280
2297
  const srcFile = dumpPath.split("/").pop();
2281
- (0, import_assert.default)(srcFile, `Failed to get source file name from ${dumpPath}`);
2282
- const destFile = import_path.default.join(reportDir, "public", srcFile);
2298
+ (0, import_assert2.default)(srcFile, `Failed to get source file name from ${dumpPath}`);
2299
+ const destFile = import_path2.default.join(targetReportDir, "public", srcFile);
2283
2300
  import_fs_extra.default.copySync(dumpPath, destFile);
2284
2301
  }
2285
2302
  }
2286
2303
  try {
2287
2304
  import_fs_extra.default.outputFileSync(
2288
- import_path.default.join(reportDir, "public", "test-data-list.json"),
2305
+ import_path2.default.join(targetReportDir, "public", "test-data-list.json"),
2289
2306
  JSON.stringify({ "test-list": filterDataList })
2290
2307
  );
2291
2308
  } catch (err) {
2292
2309
  console.error("An error occurred while writing to the file.", err);
2293
2310
  }
2294
- try {
2295
- const filePath = import_path.default.join(reportDir, "index.js");
2296
- const searchValue = "Server is listening on http://[::]:";
2297
- const replaceValue = "The report has been generated on http://127.0.0.1:";
2298
- let fileContent = import_fs.default.readFileSync(filePath, "utf8");
2299
- fileContent = fileContent.replace(searchValue, replaceValue);
2300
- fileContent = fileContent.replaceAll("8080", "9988");
2301
- import_fs_extra.default.outputFileSync(filePath, fileContent);
2302
- } catch (err) {
2303
- console.error("An error occurred:", err);
2304
- }
2305
- try {
2306
- const filePath = import_path.default.join(reportDir, "node_modules/@modern-js/prod-server/dist/cjs/apply.js");
2307
- let fileContent = import_fs.default.readFileSync(filePath, "utf8");
2308
- fileContent = fileContent.replace("(0, import_server_core.logPlugin)(),", "");
2309
- import_fs_extra.default.outputFileSync(filePath, fileContent);
2310
- } catch (err) {
2311
- console.error("An error occurred:", err);
2312
- }
2313
- modifyRoutesJson(reportDir, testDataList2);
2314
- }
2315
- function modifyRoutesJson(reportDir, testDataList2) {
2316
- const filePath = import_path.default.join(reportDir, "route.json");
2317
- try {
2318
- const data = import_fs.default.readFileSync(filePath, "utf8");
2319
- const newPaths = testDataList2.map((testData) => {
2320
- var _a;
2321
- const fileName = (_a = testData.dumpPath) == null ? void 0 : _a.split("/").pop();
2322
- return {
2323
- urlPath: `/${fileName}`,
2324
- isSPA: true,
2325
- isSSR: false,
2326
- entryPath: `public/${fileName}`
2327
- };
2328
- });
2329
- const jsonData = JSON.parse(data);
2330
- jsonData.routes.push(...newPaths);
2331
- import_fs.default.writeFileSync(filePath, JSON.stringify(jsonData, null, 2), "utf8");
2332
- } catch (err) {
2333
- console.error("modifyRoutesJson fail:", err);
2334
- }
2335
2311
  }
2336
2312
 
2337
2313
  // src/playwright/reporter/index.ts
@@ -2376,7 +2352,7 @@ var MidSceneReporter = class {
2376
2352
  generateTestData(testDataList);
2377
2353
  console.log(
2378
2354
  "\x1B[32m%s\x1B[0m",
2379
- `The report is generated successfully. Run the "node ./midscene_run/midscene-report/index.js" command to start the report`
2355
+ `MidScene report has been generated. Run "npx http-server ./midscene_run/report -p 0 -o -s" to view.`
2380
2356
  );
2381
2357
  }
2382
2358
  };