Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save alex-popov-tech/d938168aebd4773b3f8c478fb7bfadd3 to your computer and use it in GitHub Desktop.
Save alex-popov-tech/d938168aebd4773b3f8c478fb7bfadd3 to your computer and use it in GitHub Desktop.
/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