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.03k stars 3.54k forks source link

[Feature]: Support Ubuntu 24.04 #30368

Closed Mister-Hope closed 2 months ago

Mister-Hope commented 4 months ago

🚀 Feature Request

Ubuntu 24 will be released in this month, and the beta version is already release in 12th. (See https://wiki.ubuntu.com/Releases)

Hope playweight can add support once it release

Motivation

Cuurently when running pnpm exec playwright install --with-deps on Ubuntu 24.04, errors are thrown

Hit:1 http://security.ubuntu.com/ubuntu noble-security InRelease
Get:2 http://archive.ubuntu.com/ubuntu noble InRelease [255 kB]
Get:3 http://archive.ubuntu.com/ubuntu noble-updates InRelease [89.7 kB]
Hit:4 http://archive.ubuntu.com/ubuntu noble-backports InRelease
Get:5 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages [1404 kB]
Get:6 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages [15.2 MB]
Get:7 http://archive.ubuntu.com/ubuntu noble/universe Translation-en [6029 kB]
Get:8 http://archive.ubuntu.com/ubuntu noble/multiverse amd64 Packages [241 kB]                                                                                          
Fetched 23.2 MB in 7s (3262 kB/s)                                                                                                                                        
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'libatk-bridge2.0-0t64' instead of 'libatk-bridge2.0-0'
Note, selecting 'libatk1.0-0t64' instead of 'libatk1.0-0'
Note, selecting 'libatspi2.0-0t64' instead of 'libatspi2.0-0'
Note, selecting 'libcups2t64' instead of 'libcups2'
Note, selecting 'libgtk-3-0t64' instead of 'libgtk-3-0'
Note, selecting 'libpng16-16t64' instead of 'libpng16-16'
Note, selecting 'libevent-2.1-7t64' instead of 'libevent-2.1-7'
Package libasound2 is a virtual package provided by:
  liboss4-salsa-asound2 4.2-build2020-1ubuntu3
  libasound2t64 1.2.11-1build2 (= 1.2.11-1build2)
You should explicitly select one to install.

E: Package 'libasound2' has no installation candidate
E: Unable to locate package libicu70
E: Unable to locate package libffi7
E: Unable to locate package libx264-163
Failed to install browsers
Error: Installation process exited with code: 100
mxschmitt commented 4 months ago

We are currently blocked by GitHub Actions, that they add support for it in their runner-images repository: https://github.com/actions/runner-images/issues/9691.

man-qa commented 4 months ago

Same for me, stuck on ubuntu:22.04 for the moment

ajrowland commented 4 months ago

I can run on 24.04 via the UI, or just using the --project firefox flag.

rotemgrim commented 3 months ago

I'm stuck with ubuntu 24.04. any one has a workaround maybe?

mwanago commented 3 months ago

I'm stuck with ubuntu 24.04. any one has a workaround maybe?

I was able to run it on 23.10 with this advice: https://github.com/microsoft/playwright/issues/23296#issuecomment-1670807705

I had to compile libx264-163 from the source code though.

wangfuxin8080 commented 3 months ago

hi @mxschmitt , do you know when the github issue will be fixed, I encouter the same error when running apt-get update && apt-get upgrade -y && apt-get install -y libxtst6 libnss3 libcups2 libxss1 libxrandr2 libasound2 libatk1.0-0 libgtk-3-0

error: Hit:1 http://archive.ubuntu.com/ubuntu noble InRelease Hit:2 http://archive.ubuntu.com/ubuntu noble-updates InRelease Hit:3 http://archive.ubuntu.com/ubuntu noble-backports InRelease Hit:4 http://security.ubuntu.com/ubuntu noble-security InRelease Reading package lists... Reading package lists... Building dependency tree... Reading state information... Calculating upgrade... 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Reading package lists... Building dependency tree... Reading state information... Package libasound2 is a virtual package provided by: liboss4-salsa-asound2 4.2-build2020-1ubuntu3 libasound2t64 1.2.11-1build2 (= 1.2.11-1build2)

E: Package 'libasound2' has no installation candidate

LostInDarkMath commented 3 months ago

I have the same issue. Any news on this?

WithMarcel commented 3 months ago

I encountered a similar issue on Ubuntu 24.04, albeit with a wider range of missing packages: libicu70, libffi7, and libx264-163. To resolve this, I downloaded them from https://packages.ubuntu.com/, specifically for the 22.04 version. While this method isn't advisable due to its deviation from best practices, I managed to install them using apt install ./<package>.deb.

For libasound2, I initially attempted to install libasound2t64, only to discover it was already present. Subsequently, I checked liboss4-salsa-asound2, but refrained from installing it as it would entail the removal of over 70 other packages, which was not my intended outcome.

Proceeding with playwright install --with-deps, I encountered additional absent packages: libvpx7 and libevent-2.1-7. After obtaining and installing them, I was finally able to execute playwright install without encountering any further issues.

It's worth noting that while this workaround worked for me, I don't recommend it universally, nor can I guarantee its seamless functionality for all users. Probably as soon as Ubuntu 24.04 is officially supported, I would try to remove the above packages and reinstall playwright.

Mister-Hope commented 3 months ago

We are currently blocked by GitHub Actions, that they add support for it in their runner-images repository: actions/runner-images#9691.

It seems that there is still a time period before GitHub support 24.04. See here: https://github.com/actions/runner-images/issues/9691#issuecomment-2063926929

It would be great that we can have Ubuntu 24.04 supported in playwright first, then adding a CI test once it supports.

Even a workaround is better than no support. For me, I feel hard when I am switching devices between office, home and my laptop. I have all upgraded them to 24.04, and I have to repeat the above solution 3 times.

jamieredding commented 3 months ago

Hi @WithMarcel, I've made progress with the steps you provided so thank you very much.

I encountered exactly your issue when reaching this point:

For libasound2, I initially attempted to install libasound2t64, only to discover it was already present. Subsequently, I checked liboss4-salsa-asound2, but refrained from installing it as it would entail the removal of over 70 other packages, which was not my intended outcome.

However playwright install --with-deps still continues to complain about libasound2 not being installed, instead of encountering the next round of absent packages that you ran into here:

Proceeding with playwright install --with-deps, I encountered additional absent packages: libvpx7 and libevent-2.1-7. After obtaining and installing them, I was finally able to execute playwright install without encountering any further issues.

Further steps

I proceeded to instead run npx playwright install without --with-deps and I reached the libvpx7 and libevent-2.1.7 missing packages that are mentioned above.

I then installed them manually the same way as the earlier ones by visiting https://packages.ubuntu.com/.

After that point, npx playwright install ran without errors.

Running tests

I am able to run npx playwright test on the example tests generated when you add playwright to a project. 5/6 pass except [webkit] › example.spec.ts:10:5 › get started link fails when trying to click a link.

I'll proceed for now despite this as I'm at least able to test with chromium.

MarcosIgnacioo commented 3 months ago

wep ya lo arreglaron??

NoahNim commented 3 months ago

Hello, it seems that the --install-deps command and playwright has issues getting the packages from what's in the default ubuntu.sources file in /etc/apt/sources.list.d

I updated my ubuntu.sources file in /etc/apt/sources.list.d to look like this:

Types: deb
URIs: http://us.archive.ubuntu.com/ubuntu/
Suites: noble noble-updates noble-backports
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

Types: deb
URIs: http://security.ubuntu.com/ubuntu/
Suites: noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

Types: deb
URIs: http://mirrors.kernel.org/ubuntu/
Suites: focal
Components: main universe
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

This got every dependency to install except libicu70 and libx264-163. Ubuntu 24.04 comes with libicu74 and libx264-164, so libicu70 and libx264-163 can't be installed unless a user reverts to those versions but I don't want to break other things by doing this.

fawazahmed0 commented 2 months ago

ubuntu-24.04 is available now in GitHub Actions

vkWeb commented 2 months ago

@mxschmitt please try getting playwright ready for Ubuntu 24.04. Thanks!

mxschmitt commented 2 months ago

This will be available in v1.45. Experimental support has been landed on our Canary channel: https://playwright.dev/docs/canary-releases

FullyRemoteDev commented 2 months ago

This will be available in v1.45. Experimental support has been landed on our Canary channel: https://playwright.dev/docs/canary-releases

is a canary release available for Python?

jhenriquez-ax commented 2 months ago

1) Upgrade playwright to 1.44.1

2) Add Jammy repositories:

deb http://cz.archive.ubuntu.com/ubuntu jammy main universe deb http://cz.archive.ubuntu.com/ubuntu jammy main main

3) Installing the missing dependencies:

apt-get update sudo apt-get install libicu70 libffi7 libx264-163 libvpx7 libevent-2.1

4) run playwright install

This allowed me to run my suites without issues. But running with-deps still fails (but doesn't seem to be required for me). Hope this helps.

Martin-Thiele commented 2 months ago

Also looking for a python solution

mirao commented 2 months ago

Has anybody tried WebKit with Playwright 1.45 (where support for Ubuntu 24.04 is)? I'm getting this error on Ubuntu 24.04:

$ pnpm update playwright
$ npx playwright --version
Version 1.45.0
$ pnpm playwright install --with-deps
... no error
$  pnpm playwright wk
Error: t.parse: Target page, context or browser has been closed
Browser logs:

<launching> /home/mirao/.cache/ms-playwright/webkit-2035/pw_run.sh --inspector-pipe --no-startup-window
<launched> pid=242596
[pid=242596][err] /home/mirao/.cache/ms-playwright/webkit-2035/minibrowser-gtk/bin/MiniBrowser: error while loading shared libraries: libicudata.so.70: cannot open shared object file: No such file or directory
[pid=242596] <process did exit: exitCode=127, signal=null>
[pid=242596] starting temporary directories cleanup
Call log:
  - <launching> /home/mirao/.cache/ms-playwright/webkit-2035/pw_run.sh --inspector-pipe --no-startup-window
  - <launched> pid=242596
  - [pid=242596][err] /home/mirao/.cache/ms-playwright/webkit-2035/minibrowser-gtk/bin/MiniBrowser: error while loading shared libraries: libicudata.so.70: cannot open shared object file: No such file or directory
  - [pid=242596] <process did exit: exitCode=127, signal=null>
  - [pid=242596] starting temporary directories cleanup

Chromium and Firefox work fine.

mirao commented 2 months ago

I'm getting this error on Ubuntu 24.04:

Well, it's an issue only on one of my machines with Ubuntu 24.04. Today I upgraded 22.04 => 24.04 on that machine and hit the issue with libicudata.so.70 there.

Then I tested it on two more machines where I upgraded Ubuntu 23.10 => 24.10 and everything works fine. Also it works well on a VM with clear installation of Ubuntu 24.04 (a multipass VM).

I'll check again what could be wrong on that specific station after upgrade 22.04 => 24.04.

mirao commented 2 months ago

[pid=242596][err] /home/mirao/.cache/ms-playwright/webkit-2035/minibrowser-gtk/bin/MiniBrowser: error while loading shared libraries: libicudata.so.70: cannot open shared object file: No such file or directory ... I'll check again what could be wrong on that specific station after upgrade 22.04 => 24.04.

Finally solved by removing of ~/.cache/ms-playwright, node_modules and PNPM store. Then installed Playwright and browsers again and now everything works fine.

FullyRemoteDev commented 2 months ago

So finally we have the 1.45 release. thanks.

Now it has to be updated in pip I guess as it still shows 1.44 version. (https://pypi.org/project/playwright/)

or is there anyway I can get this latest 1.45 version in python apart from pip?

fawazahmed0 commented 2 months ago

For playwright-python with ubuntu 24.04 support, you can try pip install git+https://github.com/microsoft/playwright-python.git . But I haven't tested it personally.

Martin-Thiele commented 2 months ago
pip install git+https://github.com/microsoft/playwright-python.git
playwright install-deps
playwright install

this worked for me, as @fawazahmed0 suggested. It installs version: 1.44.1.dev11+gc6cc4c9

Edit: This broke as 1.45.0 waas released and required doing a playwright install, you might wish to freeze whatever version you end up using in requirements.txt, i.e.

playwright @ git+https://github.com/microsoft/playwright-python.git@v1.44.0
islam0000 commented 3 weeks ago

Still I'm facing same issue with playwright, java

image
silverwind commented 2 weeks ago

Still I'm facing same issue with playwright, java image

Should probably open a new issue for this. I also observed it and downgraded to Ubuntu 22 for now.

islam0000 commented 2 weeks ago

Still I'm facing same issue with playwright, java image

Should probably open a new issue for this. I also observed it and downgraded to Ubuntu 22 for now.

I have not configured Ubuntu anywhere, shall I change the playwright or chrome version?