Skip to content

Commit

Permalink
fixed the login tests to avoid a closed context error
Browse files Browse the repository at this point in the history
  • Loading branch information
Cassidy-Boilley committed May 27, 2024
1 parent a2d80ca commit 06e89eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions tests/login.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { test, expect } from '@playwright/test';
import { config } from './config';

test.describe.configure({ mode: 'parallel' });

test('Login with registered email and correct password', async ({
browser,
}) => {
Expand All @@ -24,7 +26,7 @@ test('Login with registered email and correct password', async ({
} catch (error) {
console.log('Login with registered email and correct password failed');
} finally {
await browser.close();
await context.close();
}
});

Expand Down Expand Up @@ -53,7 +55,7 @@ test('Login with registered email and incorrect password', async ({
} catch (error) {
console.log('Login with registered email and incorrect password failed');
} finally {
await browser.close();
await context.close();
}
});

Expand Down Expand Up @@ -81,6 +83,6 @@ test('Login with unregistered email', async ({ browser }) => {
console.log('Login with unregistered email failed');
console.error(error);
} finally {
await browser.close();
await context.close();
}
});
2 changes: 1 addition & 1 deletion tests/logout.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ test('Logout after login', async ({ browser }) => {
console.log('Logout failed');
console.error(error);
} finally {
await browser.close();
await context.close();
}
});

0 comments on commit 06e89eb

Please sign in to comment.