Fix flaky test and add screenshots

This commit is contained in:
Fedor Indutny 2022-09-01 09:35:44 -07:00 committed by GitHub
parent 0ba23d4b62
commit 0715cc6be3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 41 additions and 31 deletions

View file

@ -256,7 +256,7 @@ export class Bootstrap {
return result;
}
public async saveLogs(): Promise<void> {
public async saveLogs(app?: App): Promise<void> {
const { ARTIFACTS_DIR } = process.env;
if (!ARTIFACTS_DIR) {
// eslint-disable-next-line no-console
@ -272,7 +272,13 @@ export class Bootstrap {
console.error(`Saving logs to ${outDir}`);
const { logsDir } = this;
await fs.rename(logsDir, path.join(outDir));
await fs.rename(logsDir, outDir);
if (app) {
const window = await app.getWindow();
const screenshot = await window.screenshot();
await fs.writeFile(path.join(outDir, 'screenshot.png'), screenshot);
}
}
//