diff --git a/.pnp.cjs b/.pnp.cjs index ba391071b..5e962160b 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -8950,6 +8950,7 @@ const RAW_RUNTIME_STATE = ["eslint-plugin-n", "virtual:a59b12f7fe7bf3b80fc61d73eaaa33af60483f6ce31789d384fbe8ef169791f667d2559ec5f2fbae1a273a658ce021f1f5f1ea0718c56f81b30ad4e95a5668dd#npm:17.10.1"],\ ["eslint-plugin-no-null", "virtual:a59b12f7fe7bf3b80fc61d73eaaa33af60483f6ce31789d384fbe8ef169791f667d2559ec5f2fbae1a273a658ce021f1f5f1ea0718c56f81b30ad4e95a5668dd#npm:1.0.2"],\ ["eslint-plugin-prefer-arrow", "virtual:a59b12f7fe7bf3b80fc61d73eaaa33af60483f6ce31789d384fbe8ef169791f667d2559ec5f2fbae1a273a658ce021f1f5f1ea0718c56f81b30ad4e95a5668dd#npm:1.2.3"],\ + ["glob", "npm:11.0.1"],\ ["npm-run-all2", "npm:7.0.0"],\ ["rimraf", "npm:6.0.0"],\ ["typescript", "patch:typescript@npm%3A5.3.3#optional!builtin::version=5.3.3&hash=e012d7"],\ @@ -13791,6 +13792,19 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "HARD"\ }],\ + ["npm:11.0.1", {\ + "packageLocation": "./.yarn/cache/glob-npm-11.0.1-2249503635-57b12a05cc.zip/node_modules/glob/",\ + "packageDependencies": [\ + ["glob", "npm:11.0.1"],\ + ["foreground-child", "npm:3.1.1"],\ + ["jackspeak", "npm:4.0.1"],\ + ["minimatch", "npm:10.0.1"],\ + ["minipass", "npm:7.1.2"],\ + ["package-json-from-dist", "npm:1.0.0"],\ + ["path-scurry", "npm:2.0.0"]\ + ],\ + "linkType": "HARD"\ + }],\ ["npm:6.0.1", {\ "packageLocation": "./.yarn/cache/glob-npm-6.0.1-8e9c8956b1-a0670bc51f.zip/node_modules/glob/",\ "packageDependencies": [\ diff --git a/.yarn/cache/glob-npm-11.0.1-2249503635-57b12a05cc.zip b/.yarn/cache/glob-npm-11.0.1-2249503635-57b12a05cc.zip new file mode 100644 index 000000000..b38f7b609 Binary files /dev/null and b/.yarn/cache/glob-npm-11.0.1-2249503635-57b12a05cc.zip differ diff --git a/packages/allure-playwright/package.json b/packages/allure-playwright/package.json index 007ec45ac..d0f54b179 100644 --- a/packages/allure-playwright/package.json +++ b/packages/allure-playwright/package.json @@ -86,6 +86,7 @@ "eslint-plugin-n": "^17.10.1", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-prefer-arrow": "^1.2.3", + "glob": "^11.0.1", "npm-run-all2": "^7.0.0", "rimraf": "^6.0.0", "typescript": "^5.2.2", diff --git a/packages/allure-playwright/test/utils.ts b/packages/allure-playwright/test/utils.ts index de2a84517..8bb81d5c1 100644 --- a/packages/allure-playwright/test/utils.ts +++ b/packages/allure-playwright/test/utils.ts @@ -1,7 +1,8 @@ import { fork } from "child_process"; +import { glob } from "glob"; import { randomUUID } from "node:crypto"; -import { mkdir, readFile, readdir, rm, writeFile } from "node:fs/promises"; -import { dirname, extname, join } from "node:path"; +import { mkdir, readFile, rm, writeFile } from "node:fs/promises"; +import { dirname, extname, join, relative } from "node:path"; import { attachment, logStep, step } from "allure-js-commons"; import type { AllureResults } from "allure-js-commons/sdk"; import { MessageReader } from "allure-js-commons/sdk/reporter"; @@ -86,7 +87,9 @@ export const runPlaywrightInlineTest = async ( return new Promise((resolve) => { testProcess.on("exit", async (code, signal) => { - const resultsFiles = (await readdir(testDir)).filter((filename) => !testFilesNames.includes(filename)); + const resultsFiles = (await glob(join(testDir, "**/*"), { nodir: true })) + .map((filename) => relative(testDir, filename)) + .filter((filename) => !testFilesNames.includes(filename)); if (signal) { await logStep(`Interrupted with ${signal}`); @@ -105,9 +108,7 @@ export const runPlaywrightInlineTest = async ( }; for (const file of resultsFiles) { - const content = await readFile(join(testDir, file), "utf-8"); - - result.restFiles[file] = content; + result.restFiles[file] = await readFile(join(testDir, file), "utf-8"); } await rm(testDir, { recursive: true }); diff --git a/yarn.lock b/yarn.lock index b2bebf47a..29786c7cb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5837,6 +5837,7 @@ __metadata: eslint-plugin-n: "npm:^17.10.1" eslint-plugin-no-null: "npm:^1.0.2" eslint-plugin-prefer-arrow: "npm:^1.2.3" + glob: "npm:^11.0.1" npm-run-all2: "npm:^7.0.0" rimraf: "npm:^6.0.0" typescript: "npm:^5.2.2" @@ -9939,6 +9940,22 @@ __metadata: languageName: node linkType: hard +"glob@npm:^11.0.1": + version: 11.0.1 + resolution: "glob@npm:11.0.1" + dependencies: + foreground-child: "npm:^3.1.0" + jackspeak: "npm:^4.0.1" + minimatch: "npm:^10.0.0" + minipass: "npm:^7.1.2" + package-json-from-dist: "npm:^1.0.0" + path-scurry: "npm:^2.0.0" + bin: + glob: dist/esm/bin.mjs + checksum: 10/57b12a05cc25f1c38f3b24cf6ea7a8bacef11e782c4b9a8c5b0bef3e6c5bcb8c4548cb31eb4115592e0490a024c1bde7359c470565608dd061d3b21179740457 + languageName: node + linkType: hard + "glob@npm:^6.0.1": version: 6.0.4 resolution: "glob@npm:6.0.4"