Skip to content

Instantly share code, notes, and snippets.

@SarahElson
Created September 6, 2022 16:23
Show Gist options
  • Save SarahElson/6db79dc575dad23774d5641e31300752 to your computer and use it in GitHub Desktop.
Save SarahElson/6db79dc575dad23774d5641e31300752 to your computer and use it in GitHub Desktop.
Playwright Python Tutorial: Getting Started With Python End To End Testing
import sys
sys.path.append(sys.path[0] + "/..")
from testScripts.singleSignupScript import Register
from playwright.sync_api import sync_playwright
with sync_playwright() as playwright:
try:
playwright = Register(playwright)
playwright.launchWeb()
playwright.fillFirstName("Idowu")
playwright.fillLastName("Omisola")
playwright.fillEmail("[email protected]")
playwright.fillPhone("08122334433")
playwright.fillPassword("mypassword")
playwright.confirmPassword("mypassword")
playwright.subscribe()
playwright.acceptPolicy()
playwright.submit()
playwright.continueToDashboard()
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