def test_find_flights(driver, open_blazedemo, from_port, to_port):
# Find flight
choose_departure_flight(driver, departure_flight=from_port)
choose_arrival_flight(driver, arrival_flight=to_port)
submit_form(driver)
assert from_port in utils.get_text(driver, By.TAG_NAME, "h3")
assert to_port in utils.get_text(driver, By.TAG_NAME, "h3")
assert "reserve.php" in driver.current_url
# Choose flight
submit_form(driver)
assert from_port in utils.get_text(driver, By.TAG_NAME, "h2")
assert to_port in utils.get_text(driver, By.TAG_NAME, "h2")
assert "purchase.php" in driver.current_url
# Purchase flight
submit_form(driver)
assert "Thank you for your purchase today!" in utils.get_text(driver, By.TAG_NAME, "h1")
assert "confirmation.php" in driver.current_url
test_purchase_tickets.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录