Skip to content

Commit

Permalink
Merge pull request #9 from antowaddle/playwrightUITest
Browse files Browse the repository at this point in the history
Playwright UI test
  • Loading branch information
antowaddle authored Jul 11, 2024
2 parents b2f67ae + 4498b08 commit 672c137
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 45 deletions.
45 changes: 0 additions & 45 deletions tests/integration/test_api_gateway.py

This file was deleted.

5 changes: 5 additions & 0 deletions tests/playwright-tests/features/ui_tests.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Feature: Load resume page

Scenario: Check if the resume page loads
Given the resume page is loaded
Then the page title should be "Anthony Coughlin - QA Manager"
4 changes: 4 additions & 0 deletions tests/playwright-tests/pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[pytest]
addopts = --maxfail=1 -v
markers =
ui_test: marks tests as ui tests
28 changes: 28 additions & 0 deletions tests/playwright-tests/steps/test_ui.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import pytest
from pytest_bdd import scenarios, given, then
from playwright.sync_api import sync_playwright

# Load the feature file
scenarios('../features/ui_tests.feature')

@pytest.fixture(scope='module')
def browser():
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
yield browser
browser.close()

@pytest.fixture(scope='module')
def page(browser):
context = browser.new_context()
page = context.new_page()
yield page
context.close()

@given("the resume page is loaded")
def load_resume_page(page):
page.goto("https://anthony-coughlin-resume.com/")

@then('the page title should be "Anthony Coughlin - QA Manager"')
def check_page_title(page):
assert page.title() == "Anthony Coughlin - QA Manager"

0 comments on commit 672c137

Please sign in to comment.