allure-playwright
Advanced tools
Comparing version 2.0.0-beta.11 to 2.0.0-beta.12
@@ -44,3 +44,3 @@ "use strict"; | ||
allureTest.fullName = test.title; | ||
allureTest.status = statusToAllureStats(result.status); | ||
allureTest.status = statusToAllureStats(result.status, test.expectedStatus); | ||
if (result.error) { | ||
@@ -57,7 +57,12 @@ const message = result.error.message && stripAscii(result.error.message); | ||
} | ||
for (const step of result.steps) { | ||
appendStep(allureTest, step); | ||
} | ||
for (const attachment of result.attachments) { | ||
let fileName = attachment.path; | ||
if (attachment.body) { | ||
fileName = runtime.writeAttachment(attachment.body, attachment.contentType); | ||
if (!attachment.body && !attachment.path) { | ||
continue; | ||
} | ||
const fileName = attachment.body | ||
? runtime.writeAttachment(attachment.body, attachment.contentType) | ||
: runtime.writeAttachmentFromPath(attachment.path, attachment.contentType); | ||
allureTest.addAttachment(attachment.name, attachment.contentType, fileName); | ||
@@ -94,13 +99,13 @@ if (attachment.name === "diff") { | ||
} | ||
const statusToAllureStats = (status) => { | ||
switch (status) { | ||
case "failed": | ||
return allure_js_commons_1.Status.FAILED; | ||
case "passed": | ||
return allure_js_commons_1.Status.PASSED; | ||
case "skipped": | ||
return allure_js_commons_1.Status.SKIPPED; | ||
case "timedOut": | ||
return allure_js_commons_1.Status.BROKEN; | ||
const statusToAllureStats = (status, expectedStatus) => { | ||
if (status === "skipped") { | ||
return allure_js_commons_1.Status.SKIPPED; | ||
} | ||
if (status === "timedOut") { | ||
return allure_js_commons_1.Status.BROKEN; | ||
} | ||
if (status === expectedStatus) { | ||
return allure_js_commons_1.Status.PASSED; | ||
} | ||
return allure_js_commons_1.Status.FAILED; | ||
}; | ||
@@ -112,2 +117,10 @@ exports.default = AllureReporter; | ||
}; | ||
const appendStep = (parent, step) => { | ||
const allureStep = parent.startStep(step.title, step.startTime.getTime()); | ||
allureStep.endStep(step.startTime.getTime() + step.duration); | ||
allureStep.status = step.error ? allure_js_commons_1.Status.FAILED : allure_js_commons_1.Status.PASSED; | ||
for (const child of step.steps || []) { | ||
appendStep(allureStep, child); | ||
} | ||
}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "allure-playwright", | ||
"version": "2.0.0-beta.11", | ||
"version": "2.0.0-beta.12", | ||
"description": "Allure Playwright integration", | ||
@@ -19,4 +19,2 @@ "license": "Apache-2.0", | ||
"compile": "tsc", | ||
"prepublishOnly": "npm run clean && npm run build", | ||
"build": "npm run compile", | ||
"generate-report": "allure generate ./out/allure-results -o ./out/allure-report --clean", | ||
@@ -29,8 +27,15 @@ "allure-report": "allure serve ./out/allure-results", | ||
"devDependencies": { | ||
"@playwright/test": "^1.13.0" | ||
"@playwright/test": "=1.14.1", | ||
"eslint": "^7.32.0", | ||
"prettier": "^2.3.2", | ||
"rimraf": "^3.0.2", | ||
"typescript": "^4.4.2" | ||
}, | ||
"dependencies": { | ||
"allure-js-commons": "^2.0.0-beta.11" | ||
"allure-js-commons": "2.0.0-beta.12" | ||
}, | ||
"gitHead": "b4fbc98075d36c9e62f7950b12086fc78266be11" | ||
} | ||
"files": [ | ||
"dist" | ||
], | ||
"stableVersion": "2.0.0-beta.11" | ||
} |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
24224
131
1
5
+ Addedallure-js-commons@2.0.0-beta.12(transitive)
+ Addedmkdirp@1.0.4(transitive)
+ Addeduuid@8.3.2(transitive)
- Removedallure-js-commons@2.15.1(transitive)
- Removedansi-regex@4.1.1(transitive)
- Removedcharenc@0.0.2(transitive)
- Removedcrypt@0.0.2(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedmd5@2.3.0(transitive)
- Removedstrip-ansi@5.2.0(transitive)