generated from nationalarchives/da-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from nationalarchives/move-playwright-tests-to…
…-dedicated-e2e-tests-folder Move playwright tests to dedicated e2e tests folder
- Loading branch information
Showing
14 changed files
with
112 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Run Unit Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
unit_test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Install Poetry | ||
run: pip install poetry | ||
|
||
- name: Install dependencies | ||
run: poetry install | ||
|
||
- name: Run Pytest tests | ||
run: poetry run pytest --cov=app/main --cov-report term-missing -vvv app/tests/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import pytest | ||
from app import create_app | ||
|
||
|
||
@pytest.fixture | ||
def app(): | ||
app = create_app() | ||
app.config["TESTING"] = True | ||
app.config["WTF_CSRF_ENABLED"] = False | ||
yield app | ||
|
||
|
||
@pytest.fixture | ||
def client(app): | ||
return app.test_client() |
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from flask.testing import FlaskClient | ||
|
||
|
||
def test_poc_search_get(client: FlaskClient): | ||
""" | ||
Given a user accessing the search page | ||
When they make a GET request | ||
Then they should see the search form and page content. | ||
""" | ||
response = client.get("/poc-search-view", follow_redirects=True) | ||
|
||
assert response.status_code == 200 | ||
assert b"Search design PoC" in response.data | ||
assert b"Search for digital records" in response.data | ||
assert b"Search" in response.data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# import re | ||
# from playwright.sync_api import Page, expect | ||
|
||
|
||
# def test_page_title_and_header(page: Page): | ||
# page.goto("/record") | ||
# expect(page).to_have_title( | ||
# re.compile("Record – AYR - Access Your Records – GOV.UK") | ||
# ) | ||
# expect(page.get_by_text("Record metadata")).to_be_visible() | ||
|
||
|
||
# def test_back_link(page: Page): | ||
# page.goto("/record") | ||
# page.get_by_role("link", name="Back", exact=True).click() | ||
# page.wait_for_url("/") | ||
# page.close() |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters