chore: close app for each test to start afresh

This commit is contained in:
Siddharth Gelera
2025-10-01 13:51:05 +05:30
parent e805beaf83
commit 5c2e3bec81
4 changed files with 16 additions and 2 deletions

View File

@@ -4,6 +4,10 @@ import { buildWebsocketCommonLocators } from '../utils/page/locators';
const BRU_FILE_NAME = /^ws-test-request-with-headers$/;
test.describe.serial('headers', () => {
test.afterAll(async ({ electronApp }) => {
electronApp.close();
});
test('headers are returned if passed', async ({ pageWithUserData: page, restartApp }) => {
const locators = buildWebsocketCommonLocators(page);

View File

@@ -5,7 +5,11 @@ const MAX_CONNECTION_TIME = 3000;
const BRU_FILE_NAME = /^ws-test-request$/;
test.describe.serial('websockets', () => {
test('websocket requests are visible', async ({ pageWithUserData: page, restartApp }) => {
test.afterAll(async ({ electronApp }) => {
electronApp.close();
});
test('websocket requests are visible', async ({ pageWithUserData: page }) => {
await page.locator('#sidebar-collection-name').click();
expect(page.locator('span.item-name').filter({ hasText: BRU_FILE_NAME })).toBeVisible();

View File

@@ -27,8 +27,9 @@ test.describe.serial('persistence', () => {
originalUrl = originalUrlMatch[0].replace(/url\:/, '');
});
test.afterAll(async () => {
test.afterAll(async ({ electronApp }) => {
await writeFile(originalContext.path, originalContext.data, 'utf8');
electronApp.close();
});
test('save new websocket url', async ({ pageWithUserData: page }) => {

View File

@@ -4,6 +4,11 @@ import { buildWebsocketCommonLocators } from '../utils/page/locators';
const BRU_FILE_NAME = /^ws-test-request-with-subproto$/;
test.describe.serial('headers', () => {
test.afterAll(async ({ electronApp }) => {
electronApp.close();
});
test('headers are returned if passed', async ({ pageWithUserData: page, restartApp }) => {
const locators = buildWebsocketCommonLocators(page);
const clearText = async (text: string) => {