chore(playwright): enhance playwright config to reduce flakiness (#7174)

This commit is contained in:
Bijin A B
2026-02-17 18:57:39 +05:30
committed by GitHub
parent 03f7e60c66
commit 78c629e7a6
20 changed files with 26 additions and 22 deletions

View File

@@ -76,13 +76,17 @@ async function usePageWithTracing(
*/
export async function closeElectronApp(app: ElectronApplication) {
try {
await app.evaluate(({ app }) => {
await app.evaluate(async ({ app }) => {
app.emit('before-quit');
// Add a delay to ensure the app is fully closed
await new Promise((resolve) => setTimeout(resolve, 250));
app.exit(0);
});
} catch {
// Expected: process exited before the CDP response was sent
}
try {
await app.close();
} catch {

View File

@@ -1,4 +1,4 @@
import { test, expect } from '../../../playwright';
import { test, expect, closeElectronApp } from '../../../playwright';
import { sendRequest } from '../../utils/page';
test.describe.serial('bru.setEnvVar(name, value, { persist: true })', () => {
@@ -55,6 +55,6 @@ test.describe.serial('bru.setEnvVar(name, value, { persist: true })', () => {
await newEnvTab.hover();
await newEnvTab.getByTestId('request-tab-close-icon').click({ force: true });
await newPage.close();
await closeElectronApp(newApp);
});
});

View File

@@ -1,4 +1,4 @@
import { test, expect } from '../../../playwright';
import { test, expect, closeElectronApp } from '../../../playwright';
import { sendRequest } from '../../utils/page';
test.describe.serial('bru.setEnvVar(name, value)', () => {
@@ -49,6 +49,6 @@ test.describe.serial('bru.setEnvVar(name, value)', () => {
await newEnvTab.hover();
await newEnvTab.getByTestId('request-tab-close-icon').click({ force: true });
await newPage.close();
await closeElectronApp(newApp);
});
});

View File

@@ -1,5 +1,5 @@
{
"maximized": true,
"maximized": false,
"lastOpenedCollections": [
"{{projectRoot}}/tests/environments/collection-env-config-selection/collection"
]

View File

@@ -1,5 +1,5 @@
{
"maximized": true,
"maximized": false,
"lastOpenedCollections": [
"{{projectRoot}}/tests/environments/global-env-config-selection/collection"
]

View File

@@ -1,5 +1,5 @@
{
"maximized": true,
"maximized": false,
"lastOpenedCollections": [
"{{projectRoot}}/tests/environments/global-env-config-selection/collection"
]

View File

@@ -1,5 +1,5 @@
{
"maximized": true,
"maximized": false,
"lastOpenedCollections": [
"{{collectionPath}}"
],

View File

@@ -1,5 +1,5 @@
{
"maximized": true,
"maximized": false,
"lastOpenedCollections": [
"{{projectRoot}}/tests/environments/update-global-environment-via-script/fixtures/collection"
]

View File

@@ -1,5 +1,5 @@
{
"maximized": true,
"maximized": false,
"lastOpenedCollections": [
"{{projectRoot}}/tests/interpolation/dynamic-variable/collection"
]

View File

@@ -1,5 +1,5 @@
{
"maximized": true,
"maximized": false,
"lastOpenedCollections": ["{{projectRoot}}/tests/preferences/default-collection-location/collection"],
"preferences": {
"general": {

View File

@@ -1,5 +1,5 @@
{
"maximized": true,
"maximized": false,
"lastOpenedCollections": [
"{{collectionPath}}"
],

View File

@@ -1,4 +1,4 @@
{
"maximized": true,
"maximized": false,
"lastOpenedCollections": ["{{projectRoot}}/packages/bruno-tests/collection"]
}

View File

@@ -1,5 +1,5 @@
{
"maximized": true,
"maximized": false,
"lastOpenedCollections": ["{{projectRoot}}/tests/ssl/basic-ssl/collections/badssl"],
"preferences": {
"request": {

View File

@@ -1,5 +1,5 @@
{
"maximized": true,
"maximized": false,
"lastOpenedCollections": ["{{projectRoot}}/tests/ssl/basic-ssl/collections/self-signed-badssl"],
"preferences": {
"request": {

View File

@@ -1,5 +1,5 @@
{
"maximized": true,
"maximized": false,
"lastOpenedCollections": ["{{projectRoot}}/tests/ssl/basic-ssl/collections/self-signed-badssl"],
"preferences": {
"request": {

View File

@@ -1,5 +1,5 @@
{
"maximized": true,
"maximized": false,
"lastOpenedCollections": ["{{projectRoot}}/tests/ssl/custom-ca-certs/collection"],
"preferences": {
"request": {

View File

@@ -1,5 +1,5 @@
{
"maximized": true,
"maximized": false,
"lastOpenedCollections": ["{{projectRoot}}/tests/ssl/custom-ca-certs/collection"],
"preferences": {
"request": {

View File

@@ -1,5 +1,5 @@
{
"maximized": true,
"maximized": false,
"lastOpenedCollections": ["{{projectRoot}}/tests/ssl/custom-ca-certs/collection"],
"preferences": {
"request": {

View File

@@ -1,5 +1,5 @@
{
"maximized": true,
"maximized": false,
"lastOpenedCollections": ["{{projectRoot}}/tests/ssl/custom-ca-certs/collection"],
"preferences": {
"request": {

View File

@@ -1,5 +1,5 @@
{
"maximized": true,
"maximized": false,
"lastOpenedCollections": ["{{projectRoot}}/tests/ssl/custom-ca-certs/tests/wss-success/fixtures/wss-collection"],
"preferences": {
"request": {