Add a test with the Page Object Model and the "sb" fixture
This commit is contained in:
parent
b15d2084d9
commit
20403f267b
|
@ -0,0 +1,18 @@
|
|||
""" Classic Page Object Model with the "sb" fixture """
|
||||
|
||||
|
||||
class LoginPage():
|
||||
|
||||
def login_to_swag_labs(self, sb, username):
|
||||
sb.open("https://www.saucedemo.com/")
|
||||
sb.type("#user-name", username)
|
||||
sb.type("#password", "secret_sauce")
|
||||
sb.click('input[type="submit"]')
|
||||
|
||||
|
||||
class MyTests():
|
||||
|
||||
def test_swag_labs_login(self, sb):
|
||||
LoginPage().login_to_swag_labs(sb, "standard_user")
|
||||
sb.assert_element("#inventory_container")
|
||||
sb.assert_text("Products", "div.product_label")
|
Loading…
Reference in New Issue