-
-
Save rahulmr/7b37d77c227f7cb6880d2aeb8b2a6e58 to your computer and use it in GitHub Desktop.
Playwright Python Tutorial: Getting Started With Python End To End Testing
This file contains hidden or 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
| import sys | |
| sys.path.append(sys.path[0] + "/..") | |
| from testScripts.singleLoginBuyScript import LoginAndBuy | |
| from playwright.sync_api import sync_playwright | |
| with sync_playwright() as playwright: | |
| try: | |
| playwright = LoginAndBuy(playwright) | |
| playwright.launchWeb() | |
| playwright.fillEmail("[email protected]") | |
| playwright.fillPassword("mypassword") | |
| playwright.clickLogin() | |
| playwright.fillSearchBox("Nikon") | |
| playwright.clickSearchButton() | |
| playwright.clickProduct() | |
| playwright.clickAddToCart() | |
| playwright.clickCheckOutModal() | |
| playwright.hoverMenuBox() | |
| playwright.clickLogout() | |
| playwright.getSuccessStatus() | |
| except: | |
| playwright.getFailedStatus() | |
| playwright.closeBrowser() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment