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

[REGRESSION]: tcs are failing in headless mode #28445

Closed
vaishalisoni1093 opened this issue Dec 1, 2023 · 2 comments
Closed

[REGRESSION]: tcs are failing in headless mode #28445

vaishalisoni1093 opened this issue Dec 1, 2023 · 2 comments

Comments

@vaishalisoni1093
Copy link

Context:

  • GOOD Playwright Version: [1.28]
  • BAD Playwright Version: [1.40]
  • Operating System: [ Mac]
  • Extra: [any specific details about your environment]

Code Snippet

Help us help you! Put down a short code snippet that illustrates your bug and
that we can run and debug locally. For example:

const {chromium, webkit, firefox} = require('playwright');

(async () => {
  const browser = await chromium.launch();
  // ... 
})();


import {test as setup, expect} from '@playwright/test';
import {getBaseUrl, getSddcId} from '../config';

const authFile = 'playwright/.auth/user.json';

setup('authenticate as admin', async ({page}) => {

    // Perform authentication steps. Replace these actions with your own.
    const env: string = process.env.env || 'stg';
    console.log("Running tc on sddc:", getSddcId());
    await page.goto(getBaseUrl());
    await page.goto(getBaseUrl() + 'login?redirectPath=%2Fsearch');
    await page.locator('[data-test-id="discovery_username"]').click({timeout: 30000});
}

Describe the bug
The tcs is failing recently in playwright in headless mode and is passing headed mode.
The error it gives in headless :

Retry #3 ───────────────────────────────────────────────────────────────────────────────────────

Test timeout of 30000ms exceeded.

Error: locator.click: Target closed
=========================== logs ===========================
waiting for locator('[data-test-id="discovery_username"]')
  locator resolved to <input type="text" autofocus="" autocomplete="email" id…/>
attempting click action
  waiting for element to be visible, enabled and stable
    element is not visible - waiting...
============================================================

  11 |     await page.goto(getBaseUrl());
  12 |     //await page.goto(getBaseUrl() + 'login?redirectPath=%2Fsearch');
> 13 |     await page.locator('[data-test-id="discovery_username"]').click({timeout: 30000});

whereas when ran in headed mode
test_mode=stg npx playwright test --headed

Running 27 tests using 2 workers

✓ 1 [setup] › auth.setup.ts:6:6 › authenticate as admin (15.8s)
Running tc on sddc: SDDC_XYZ

Add any other details about the problem here.

@pavelfeldman
Copy link
Member

We couldn't reproduce it locally due to incomplete source code. We need to run it in order to diagnose the problem.

@vaishalisoni1093
Copy link
Author

You need exact source code as in playwright config ?

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