mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 12:15:34 +03:00
tests/playwright-python: fix text to look for
The Nix Manual now includes its release in the middle of the title, i.e. "Nix 2.28.1 Reference Manual", so we just use a regex
This commit is contained in:
parent
1f12271a92
commit
5d205401b1
1 changed files with 3 additions and 1 deletions
|
@ -21,6 +21,7 @@ import ./make-test-python.nix (
|
|||
}
|
||||
''
|
||||
import sys
|
||||
import re
|
||||
from playwright.sync_api import sync_playwright
|
||||
from playwright.sync_api import expect
|
||||
|
||||
|
@ -29,6 +30,7 @@ import ./make-test-python.nix (
|
|||
"firefox": {},
|
||||
"webkit": {}
|
||||
}
|
||||
needle = re.compile("Nix.*Reference Manual")
|
||||
if len(sys.argv) != 3 or sys.argv[1] not in browsers.keys():
|
||||
print(f"usage: {sys.argv[0]} [{'|'.join(browsers.keys())}] <url>")
|
||||
sys.exit(1)
|
||||
|
@ -42,7 +44,7 @@ import ./make-test-python.nix (
|
|||
context = browser.new_context()
|
||||
page = context.new_page()
|
||||
page.goto(url)
|
||||
expect(page.get_by_text("Nix Reference Manual")).to_be_visible()
|
||||
expect(page.get_by_text(needle)).to_be_visible()
|
||||
''
|
||||
)
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue