Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using test.describe.configure and browser in the before all causes TypeError: Cannot read properties of undefined (reading 'wsEndpoint') error #31258

Closed
srikanthathikari opened this issue Jun 11, 2024 · 4 comments

Comments

@srikanthathikari
Copy link

Version

1.44.1

Steps to reproduce

I am trying to run my tests in same browser page and I am trying to use the way it has been shown in playwright documentation.

import { test, type Page } from '@playwright/test';

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

let page: Page;

test.beforeAll(async ({ browser }) => {
page = await browser.newPage();
});

test('runs first', async () => {
await page.goto('https://playwright.dev/');
});

test.afterAll(async () => {
await page.close();
});

This throws a
TypeError: Cannot read properties of undefined (reading 'wsEndpoint')

However, when I remove test.describe.configure({ mode: 'serial' }); from line 1 and browser from before all the tests works with the configuration both in browserstack and local.

Expected behavior

I expect to see it working using describe.configure({mode:serial}) and have browser in the before all

Actual behavior

Throws error

TypeError: Cannot read properties of undefined (reading 'wsEndpoint')

Additional context

No response

Environment

Mac OS and cloud( browserstack)
@yury-s
Copy link
Member

yury-s commented Jun 11, 2024

It looks like your configuration also depends on a remote connection to a browser. Please share complete minimal example which we could run locally to debug the issue.

@srikanthathikari
Copy link
Author

Sure. I have created a repository with minimal example here.
I have commented the browserstack credentials in the browserstack.yml file.
https://github.com/srikanthathikari/playwright-playground

@yury-s
Copy link
Member

yury-s commented Jun 12, 2024

This test passes just fine. Also it doesn't use wsEndpoint anywhere. The problem seems to be coming from the browserstack hooks into Playwright, in that case you should file this bug with them we cannot help with that. If you think this is a Playwright issue we need a self-contained reproduction that doesn't depend on external services such browserstack.

@yury-s
Copy link
Member

yury-s commented Jun 17, 2024

Closing per the response above, feel free to open a new issue if it doesn't work.

@yury-s yury-s closed this as completed Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants