playwright: [Bug]: Error: page.goto: Target page, context or browser has been closed

Version

1.42.0

Steps to reproduce

This is really hard to reproduce as the test passes locally for me. This issue is consistently failing when running in our Jenkins pipeline.

I can share our code though.

Its a basic function really

const visit = async (path: string): Promise<void> => {
    await page.goto(path);
    await closePendo();
  };

The error is related to this line

await page.goto(path);

The test file calls visit like this

await assetPage.visit(resources.asset.id);

And the resource is created in the fixture

resources: async ({}, use) => {
    const community = await createCommunity();
    const assetType = await createAssetType(BUSINESS_ASSET_ASSET_TYPE_ID);
    await addBasicGlobalAssignment(assetType.id);
    const domain = await createDomain(community.id, BUSINESS_ASSET_DOMAIN_TYPE_ID);
    await assignDomainTypeToAssetTypeWithId(faker.string.uuid(), assetType.id, domain.type.id);
    const asset = await createAsset(domain.id, assetType.id);

    await use({ asset, domain, community });
  },

Basically in the fixture we call some rest apis to generate some data, part of this data is used to navigate to the correct page.

Expected behavior

I expect the page to open as it does locally.

Actual behavior

I see the following error

Error: page.goto: Target page, context or browser has been closed
Call log:
  - navigating to "https://k8s-lib-ns-ygrqfjrqyf.dev.cp.collibra.dev/asset/018e2be9-6f87-7805-84bd-c27e58de085b", waiting until "load"


   at ../pages/common/createCommonPage.ts:35

  33 |    */
  34 |   const visit = async (path: string): Promise<void> => {
> 35 |     await page.goto(path);
     |                ^
  36 |     await closePendo();
  37 |   };
  38 |

    at Object.visit (/usr/dgc-playwright/pages/common/createCommonPage.ts:35:16)
    at Object.visit (/usr/dgc-playwright/pages/asset/createAssetPage.ts:56:22)
    at /usr/dgc-playwright/tests/asset-management/at-a-glance-sidebar/articulationscore.test.ts:40:25
    at /usr/dgc-playwright/tests/asset-management/at-a-glance-sidebar/articulationscore.test.ts:22:7

Additional context

Iv never seen this error in Chromium whether it be locally or in the pipeline but this issue us a big concern for us.

Environment

System:                                                                                                                  
    OS: Linux 5.4 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)                                                         
CPU: (16) x64 AMD EPYC 7571                                                                                            
    Memory: 59.03 GB / 61.70 GB                                                                                            
    Container: Yes                                                                                                         
Binaries:                                                                                                                
    Node: 20.11.1 - /usr/bin/node                                                                                          
    Yarn: 1.22.21 - /usr/bin/yarn                                                                                          
    npm: 10.2.4 - /usr/bin/npm                                                                                             
Languages:                                                                                                               
    Bash: 5.1.16 - /usr/bin/bash                                                                                           
npmPackages:                                                                                                             
    @playwright/test: ^1.42.1 => 1.42.1

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 6
  • Comments: 20 (4 by maintainers)

Most upvoted comments

also having this issue whilst using playwright v1.41.2 on lambda

We need to be able to reproduce the problem to make this report actionable. Please file a new issue when you have a reproduction.