microsoft / playwright-pytest

Pytest plugin to write end-to-end browser tests with Playwright.
https://playwright.dev/python/docs/test-runners
Apache License 2.0
429 stars 69 forks source link

[BUG]The execution sequence is incorrect when use parametrize #204

Closed landhu closed 7 months ago

landhu commented 8 months ago

System info

Source code

import re from playwright.sync_api import Page, expect import pytest

@pytest.mark.parametrize("fov_value", ['65', '90', '110'], scope='function') def test_has_title(fov_value, page: Page): page.goto("https://playwright.dev/") expect(page).to_have_title(re.compile("Playwright"))

@pytest.mark.parametrize("fov_value", ['65', '90', '110'], scope='function') def test_get_started_link(fov_value, page: Page): page.goto("https://playwright.dev/") page.get_by_role("link", name="Get started").click() expect(page.get_by_role("heading", name="Installation")).to_be_visible()

Steps

Expected Sort by function like: test_has_title[chromium-65] test_has_title[chromium-90] test_has_title[chromium-110] test_get_started_link[chromium-65] test_get_started_link[chromium-90]

Actual

[Describe actual behavior]

mxschmitt commented 7 months ago

Folding into https://github.com/microsoft/playwright-pytest/issues/195