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

Research: run Playwright tests based on marker #2559

Closed

Conversation

angela-tran
Copy link
Member

@angela-tran angela-tran commented Dec 4, 2024

Part of #2504

This is an approach for running tests for specific environments.

It requires that you pass the marker that you want the tests to use. A fixture called env_base_url calculates the value for the base URL. Tests must request this fixture.

One or more environments can be run at a time because this approach utilizes parametrization (@pytest.mark.parametrize).

Examples:

pytest -m dev

runs tests marked with @pytest.mark.dev against dev-benefits.

pytest -m "dev or test"

runs tests marked with @pytest.mark.dev and/or @pytest.mark.test against their respective environments.

pytest

runs all tests against their respective environments.

env_base_url calculates the base URL based on marker name.

we can run tests for a specific environment by passing in the marker
name, e.g. pytest -m dev
@github-actions github-actions bot added the tests Related to automated testing (unit, UI, integration, etc.) label Dec 4, 2024
@angela-tran angela-tran changed the title Research: selectively run tests based on environment markers Research: select Playwright tests based on marker Dec 4, 2024
Copy link

github-actions bot commented Dec 4, 2024

Coverage report

This PR does not seem to contain any modification to coverable code.

@angela-tran angela-tran changed the title Research: select Playwright tests based on marker Research: run Playwright tests based on marker Dec 4, 2024
@angela-tran angela-tran closed this Dec 4, 2024
@angela-tran angela-tran deleted the research/environment-markers branch December 4, 2024 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Related to automated testing (unit, UI, integration, etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant