Created
June 30, 2020 09:53
-
-
Save alex-popov-tech/d938168aebd4773b3f8c478fb7bfadd3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/jest.conf.js | |
module.exports = { | |
.... | |
setupFilesAfterEnv: [ | |
'<rootDir>/.jest/allure.js' | |
], | |
.... | |
}; | |
// .jest/allure.js | |
const { getJasmineAllureReporter } = require('allure-cookies'); | |
jasmine.getEnv().addReporter(getJasmineAllureReporter({ basePath: './report', resultsDir: 'allure-results' })) | |
// __test__/base.ts | |
import { addDescription, attachScreenshot, createAttachment, setScreenshotProvider } from 'allure-cookies'; | |
.... | |
await attachScreenshot(options.name); | |
await browser.driver.manage() | |
.logs() | |
.get('browser') | |
.then((logs) => createAttachment('browser_logs.json', Buffer.from(JSON.stringify(logs)), 'application/json')); | |
await browser.driver.getPageSource() | |
.then((html) => createAttachment('page_source.html', Buffer.from(html), 'text/html')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment