From 02d09921280e87fb3efe0f8ee55cecec21cf6b06 Mon Sep 17 00:00:00 2001 From: joshua-mae <86929441+joshua-mae@users.noreply.github.com> Date: Fri, 7 Jun 2024 19:04:05 -0400 Subject: [PATCH] Configured local testing, more TODO on the way. --- .gitignore | 4 +++- index.html | 5 +++-- playwright-tests/test_first_load.py | 18 ++++++++++++++++++ playwright-tests/test_firstload.py | 12 ------------ playwright-tests/test_header_links.py | 21 +++++++++++++++++++++ 5 files changed, 45 insertions(+), 15 deletions(-) create mode 100644 playwright-tests/test_first_load.py delete mode 100644 playwright-tests/test_firstload.py create mode 100644 playwright-tests/test_header_links.py diff --git a/.gitignore b/.gitignore index 496ee2c..f94f4b7 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -.DS_Store \ No newline at end of file +.DS_Store +playwright-tests/__pycache__ +playwright-tests/.pytest_cache diff --git a/index.html b/index.html index 94a2dc3..f24c6ad 100644 --- a/index.html +++ b/index.html @@ -27,8 +27,9 @@

Hello, my name is Josh, and I am currently studying CS at MSU.

-

Currently, I am interested in native mobile development and have built iOS and Android apps. - Although, I am interested in learning about new tech stacks and working on a variety of projects. +

Currently, I am exploring a variety of tech specializations such as native mobile development, + web development, and game development. + I am always interested in learning about new tech stacks and working on a variety of projects. If you are in need of a software developer, contact me!

diff --git a/playwright-tests/test_first_load.py b/playwright-tests/test_first_load.py new file mode 100644 index 0000000..a661be3 --- /dev/null +++ b/playwright-tests/test_first_load.py @@ -0,0 +1,18 @@ +from playwright.sync_api import sync_playwright + + +def test_first_load(): + with sync_playwright() as p: + browser = p.chromium.launch() + page = browser.new_page() + page.goto('http://joshuamae.com') + assert page.title() == 'Joshua Mae' + browser.close() + + +def main(): + test_first_load() + + +if __name__ == "__main__": + main() diff --git a/playwright-tests/test_firstload.py b/playwright-tests/test_firstload.py deleted file mode 100644 index 41ca0e2..0000000 --- a/playwright-tests/test_firstload.py +++ /dev/null @@ -1,12 +0,0 @@ -import pytest -from playwright.async_api import Page, Browser - -@pytest.mark.parametrize("browser_name", ["chromium", "firefox", "webkit"]) -async def test_firstload(browser_name, browser_type_launch): - browser: Browser = await browser_type_launch(browser_name) - context = await browser.new_context() - page: Page = await context.new_page() - await page.goto("https://example.com") - title = await page.title() - assert title == "Example Domain", f"Title was '{title}', but expected 'Example Domain'" - await browser.close() diff --git a/playwright-tests/test_header_links.py b/playwright-tests/test_header_links.py new file mode 100644 index 0000000..4625124 --- /dev/null +++ b/playwright-tests/test_header_links.py @@ -0,0 +1,21 @@ +from playwright.sync_api import sync_playwright, expect + + +def test_header_links(): + + with sync_playwright() as p: + browser = p.chromium.launch(headless=True) + page = browser.new_page() + page.goto('http://joshuamae.com') + page.get_by_role("link", name="Github").click() + page.wait_for_load_state() + expect(page).to_have_url("https://github.com/joshua-mae") + browser.close() + + +def main(): + test_header_links() + + +if __name__ == "__main__": + main()