microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
65.28k stars 3.55k forks source link

[Bug]: Button click return errors using WebKit #31637

Open yonides opened 1 month ago

yonides commented 1 month ago

Version

1.45.1

Steps to reproduce

  1. Open Playwrights "Desktop Safari" browser
  2. Go to https://privat.icaforsakring.se (a well known Swedish insurance company)
  3. Decline cookes by clicking on "Avvisa cookies"'
  4. Right click and select "Inspect Element" to open browser console
  5. Click on "Mobilt BankID" button

Expected behavior

User should be redirected to following page (see screenshot below).

This works as expected on all other Playwright browsers and with Safari browser on MacOS/iOS.

my_pages_expected

Actual behavior

Following errors prevents the user from proceeding:

my_pages_safari_error

Additional context

userAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4 Safari/605.1.15

Environment

System:
    OS: Windows 11 10.0.22631
    CPU: (12) x64 AMD Ryzen 5 PRO 7530U with Radeon Graphics
    Memory: 18.96 GB / 31.31 GB
  Binaries:
    Node: 18.19.1 - C:\Program Files\nodejs\node.EXE
    npm: 10.2.4 - C:\Program Files\nodejs\npm.CMD
  IDEs:
    VSCode: 1.91.0 - C:\Program Files\Microsoft VS Code\bin\code.CMD
  Languages:
    Bash: 5.2.26 - C:\Users\xxx\AppData\Local\Programs\Git\usr\bin\bash.EXE
  npmPackages:
    @playwright/test: ^1.45.1 => 1.45.1
yury-s commented 1 month ago

Here is a quick test:

import { test, expect } from '@playwright/test';

test('test', async ({ page }) => {
  await page.goto('https://privat.icaforsakring.se/');
  await page.getByRole('button', { name: 'Godkänn alla cookies' }).click();
  await page.getByRole('button', { name: 'Mobilt BankID' }).click();
  await expect(page.getByRole('img', { name: 'QR Kod' })).toBeVisible();
});

It passes on macos. Based on the errors in the console it looks like the site uses Web Assembly and is not working on Windows, this might be same issue as https://bugs.webkit.org/show_bug.cgi?id=267323