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

[BUG] UI mode not working with storageState enabled (?) #21922

Closed
clundstedt-m opened this issue Mar 23, 2023 · 1 comment
Closed

[BUG] UI mode not working with storageState enabled (?) #21922

clundstedt-m opened this issue Mar 23, 2023 · 1 comment

Comments

@clundstedt-m
Copy link

clundstedt-m commented Mar 23, 2023

System info

  • Playwright Version: [v1.32]
  • Operating System: [macOS 13.2]
  • Browser: [All]
  • Other info: Storage State / Authentication state enabled through globalSetup

Config file

// playwright.config.ts
 globalSetup: require.resolve("./src/e2e/tests/global-setup"),
    storageState: './src/e2e/tests/state.json',
    actionTimeout: 0,
    screenshot: 'only-on-failure',
    trace: 'on-first-retry',
  },

Test file (self-contained)

test.beforeEach(async ({ page }) => {
  // Runs before each test and signs in each page.
  const assetsPage = new AnyPage(page);
  const loginPage = new LoginPage(page);
  await loginPage.visit()
  await assetsPage.menuTopNavComponent.clickAnyMenuItemNav(); 
  });

test('Creating an Element - Any Type', async ({ page }) => {
  const anyPage = new AnyPage(page);
  await anyPage.anyGridLoads()
  await anyPage.createElementAnyType();
});

Pre-condition

  • Having Storage state enabled and being used to sign in during the beforeEach hook

Steps

  • Run the test with the new flag --ui
  • npx playwright test --ui

Expected

UI Should be displayed as per the new feature is intended to work

Actual

After executing the command with the new flag --ui, terminal shows the following error:

/Users/clundstedt/Documents/zf-playwright/node_modules/@playwright/test/lib/runner/uiMode.js:159
    this._page.mainFrame().evaluateExpression(dispatchFuncSource, true, message).catch(e => this._originalStderr(String(e)));
               ^

TypeError: Cannot read properties of undefined (reading 'mainFrame')
    at UIMode._dispatchEvent (/Users/clundstedt/Documents/zf-playwright/node_modules/@playwright/test/lib/runner/uiMode.js:159:16)
    at Timeout._onTimeout (/Users/clundstedt/Documents/zf-playwright/node_modules/@playwright/test/lib/runner/uiMode.js:69:14)
    at listOnTimeout (node:internal/timers:564:17)
    at processTimers (node:internal/timers:507:7)

Node.js v19.4.0
@pavelfeldman
Copy link
Member

Dupe of #21897

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants