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

Lock playwright browser versions #89

Open
altsalt opened this issue May 6, 2024 · 3 comments
Open

Lock playwright browser versions #89

altsalt opened this issue May 6, 2024 · 3 comments

Comments

@altsalt
Copy link
Contributor

altsalt commented May 6, 2024

While the version of playwright is pinned, the downloaded browsers may differ. In part this is because some systems can't use the auto-installed versions, thus falling back to what is local.

@altsalt
Copy link
Contributor Author

altsalt commented May 6, 2024

Not entirely related, but one can get Playwright working on NixOS by adding the following block to /package.json (where the version matches the one in nixpkgs):

    "pnpm": {
        "overrides": {
            "@playwright/test": "1.38.0",
            "playwright": "1.38.0"
        }
    }

with this shell.nix file:

{ pkgs ? import <nixpkgs> { } }:

pkgs.mkShell {
  nativeBuildInputs = with pkgs; [
    nodejs_20
    (corepack.override { nodejs = nodejs_20; })
    biome
    playwright-driver.browsers
  ];

  shellHook = ''
    export BIOME_BINARY="${pkgs.biome}/bin/biome"
    export PLAYWRIGHT_BROWSERS_PATH=${pkgs.playwright-driver.browsers}
  '';
}

References:

@BryceRussell
Copy link
Member

How does this work, do I just add @playwright/browser-chromium to the package.json?

Also, do we have to pin @playwright/test as well?

@altsalt
Copy link
Contributor Author

altsalt commented Jun 11, 2024

I'm not sure tbh, still new to playwright. Just updated the pnpm override to "1.40.0" for NixOS 24.05 which is the "playwright-driver" version, despite playwright 1.42.0 being in the repo.

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