3613bfe1af
* testsuite/playwright: copys files to storj repo This PR copies all the playwright ui tests to the storj repository. * CI: Jenkinsfile.ui Jenkinsfile.ui builds all necessary items for running storj binaries, installs all items for playwright ui tests and executes the test. Note that we aren't running regular unit tests and we are not linting the code as this is occuring in the public instance. Furthermore, we still need to implement the starting of storj services as well as typescript linters for the playwright tests. * testsuite: playwright ui tests This PR copies all playwright ui tests files from the qa repo. * testsuite: playwright ui tests This PR copies all playwright ui tests files from the qa repo.
16 lines
650 B
TypeScript
16 lines
650 B
TypeScript
// Copyright (C) 2023 Storj Labs, Inc.
|
|
// See LICENSE for copying information.
|
|
|
|
import type {Page, TestInfo} from '@playwright/test';
|
|
|
|
export async function screenshotOnFailure({page}: { page: Page }, testInfo: TestInfo) {
|
|
if (testInfo.status !== testInfo.expectedStatus) {
|
|
// Get a unique place for the screenshot.
|
|
const screenshotPath = testInfo.outputPath(`failure.png`);
|
|
// Add it to the report.
|
|
testInfo.attachments.push({name: 'screenshot', path: screenshotPath, contentType: 'image/png'});
|
|
// Take the screenshot itself.
|
|
await page.screenshot({path: screenshotPath, timeout: 5000});
|
|
}
|
|
}
|