PyAr / PyZombis

Programación Python para Zombis MOOC (código y materiales del curso abierto y masivo en linea)
GNU Affero General Public License v3.0
21 stars 47 forks source link

Shubham/fill in the blanks #295

Open shubhambhar007 opened 9 months ago

shubhambhar007 commented 9 months ago

Summary

(short description of what does this PR, Issue #, etc.)

Checklist

Screenshots

https://github.com/PyAr/PyZombis/assets/32607282/f6f13e81-5574-47d1-8e1c-bb0a82905516

(prefer Playwright recorded video or animated gif)

shubhambhar007 commented 9 months ago
`
from playwright.sync_api import Playwright, sync_playwright, expect

def run(playwright: Playwright) -> None:
    browser = playwright.chromium.launch(headless=False)
    context = browser.new_context()
    page = context.new_page()
    page.goto("http://localhost:4000/")
    page.goto("http://localhost:4000/lectures/TWP05/TWP05_14_en.html")
    page.get_by_label("input area").first.click()
    page.get_by_label("input area").first.fill("price")
    page.get_by_label("input area").first.press("Tab")
    page.get_by_label("input area").nth(1).fill("quantity")
    page.get_by_role("button", name="Check me").click()
    page.goto("http://localhost:4000/lectures/TWP05/TWP05_14.html")
    page.get_by_label("input area").first.click()
    page.get_by_label("input area").first.fill("precio")
    page.get_by_label("input area").nth(1).click()
    page.get_by_label("input area").nth(1).fill("cantidad")
    page.get_by_role("button", name="Check me").click()

    context.close()
    browser.close()

with sync_playwright() as playwright:
    run(playwright)
`
shubhambhar007 commented 9 months ago

@reingart can you kindly review this.Thanks :D

shubhambhar007 commented 9 months ago

@NicolasSandoval can you kindly review this when you get time.Thanks :D