CH01- Initialization
First of all i created a repo on GitHub https://github.com/kunaal-ai/para-bank-ui-automation
then cloned on local using cmd
git clone https://github.com/kunaal-ai/para-bank-ui-automation
and installed pytest plugin with following command
pip install pytest-playwright
Here i am using playwright so installed using
playwright install
After this now its time to write first example test case to make sure everything works great.
So I created a new file called test_example.py
along with this file code
import re
from playwright.sync_api import Page, expect
def test_has_title(page: Page):
page.goto("https://playwright.dev/")
expect(page).to_have_title(re.compile("Playwright"))
def test_get_started_link(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()
what this code does, we do not need to worry what this code does. All I am focused here is if these tests passes? if yes, then I am on right path.
lets run it using command pytest
and response was amazing - all tests passed โ
:
collected 2 items
test_example.py .. [100%]
======================= 2 passed in 7.34s ==========================
(base) kt@Black-Hawk-Mpro ~/Documents/github.com/para-bank-ui-automation (main) $
๐ great, Everything on right track. ๐ง๐ปโ๐ป Checkout the code here - GitHub
๐ Lets go to next chapter - UI2-Test Directory
Subscribe to my newsletter
Read articles from Kunaal Thanik directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by