Skip to content

Commit

Permalink
chore: update aftereach screenshot taking
Browse files Browse the repository at this point in the history
Signed-off-by: Yordan Iliev <[email protected]>
  • Loading branch information
yiliev0 committed Jan 15, 2025
1 parent 09d0390 commit d39e260
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions automation/tests/settingsTests.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,21 @@ test.describe('Settings tests', () => {

test.afterEach(async ({}, testInfo) => {
if (testInfo.status !== 'passed') {
const screenshotPath = `./test-results/screenshots/${testInfo.title.replace(/\s+/g, '_')}.png`;
await window.screenshot({ path: screenshotPath });
console.log(`Screenshot saved: ${screenshotPath}`);
try {
if (!window.isClosed()) {
const screenshotPath = `./test-results/screenshots/${testInfo.title.replace(/\s+/g, '_')}.png`;
await window.screenshot({ path: screenshotPath });
console.log(`Screenshot saved: ${screenshotPath}`);
} else {
console.log('Window is already closed, skipping screenshot.');
}
} catch (e) {
console.error('Failed to take screenshot:', e);
}
}
});


test('Verify that all elements in settings page are present', async () => {
const allElementsVisible = await settingsPage.verifySettingsElements();
expect(allElementsVisible).toBe(true);
Expand Down

0 comments on commit d39e260

Please sign in to comment.