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] Firefox is failing while testing. #5684

Closed
Xezed opened this issue Mar 2, 2021 · 4 comments
Closed

[BUG] Firefox is failing while testing. #5684

Xezed opened this issue Mar 2, 2021 · 4 comments

Comments

@Xezed
Copy link

Xezed commented Mar 2, 2021

Context:

  • Playwright Version: 1.9.1
  • Operating System: Linux
  • Browser: All but fails only in Firefox
  • Extra: jest-playwright

Code Snippet

describe('Dashboard', () => {
  it('opens login page', async () => {
    await page.goto('localhost:8080');

    await page.click('text=LOG IN');
  });
});

Describe the bug

All other browsers except Firefox are working just fine.

 FAIL   browser: firefox  tests/login.test.js (5.092 s)
  Dashboard
    ✕ opens login page (3122 ms)

  ● Dashboard › opens login page

    page.click: Protocol error (Runtime.evaluate): Target closed.
    ==================== Browser output: ====================
    <launching> /home/aleksandr/.cache/ms-playwright/firefox-1234/firefox/firefox -no-remote -wait-for-browser -foreground -profile /tmp/playwright_firefoxdev_profile-2vskIF -juggler-pipe -silent
    <launched> pid=66880
    [out] 
    [out] Juggler listening to the pipe
    [out] console.warn: SearchSettings: "get: No settings file exists, new profile?" (new Error("", "(unknown module)"))
    =========================== logs ===========================
    waiting for selector "text=LOG IN"
    ============================================================
    Note: use DEBUG=pw:api environment variable to capture Playwright logs.Error:

       9 |     await page.goto('localhost:8080');
      10 |
    > 11 |     await page.click('text=LOG IN');
         |                ^
      12 |   });
      13 | });
      14 |

      at Object.captureStackTrace (node_modules/playwright/lib/utils/stackTrace.js:48:19)
      at Connection.sendMessageToServer (node_modules/playwright/lib/client/connection.js:69:48)
      at Proxy.<anonymous> (node_modules/playwright/lib/client/channelOwner.js:64:61)
      at node_modules/playwright/lib/client/frame.js:279:34
      at Frame._wrapApiCall (node_modules/playwright/lib/client/channelOwner.js:77:34)
      at Frame.click (node_modules/playwright/lib/client/frame.js:278:21)
      at node_modules/playwright/lib/client/page.js:447:60
      at Page._attributeToPage (node_modules/playwright/lib/client/page.js:231:20)
      at Page.click (node_modules/playwright/lib/client/page.js:447:21)
      at Object.<anonymous> (tests/login.test.js:11:16)

@pavelfeldman
Copy link
Member

Try debugging: PWDEBUG=1 npm run test

@Xezed
Copy link
Author

Xezed commented Mar 2, 2021

I've tried. It's just not allowing to interact with anything. It can just execute page.goto() without errors. And after this step .fill() or even click() causing error.
Yesterday it just worked like a miracle on a page with same layout but different styles. So weird.

How would you debug it? I'm new to playwright but I'm really excited about this project this is the reason I've pushed my team into adopting it over Cypress 😄 Would like to see more conference participation from you guys where you would explain the internals if it's possible. Watched all of Andrey Lushnikov's meetups on this matter so far :)
Thank you for efforts.

@pavelfeldman
Copy link
Member

And under PWDEBUG, if you enter text=LOG IN into the Explore field, the right element will highlight? Playwright can't find 'LOG IN' attached to the DOM. Could you share that part of the DOM hierarchy? Is LOG IN a single text node? (screenshot from DevTools)

@aslushnikov
Copy link
Collaborator

Closing this due to lack of feedback. If the problem still happens, please re-file the issue with more information so that we can debug this!

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

3 participants