Ejemplo n.º 1
0
 def sign_in(self, email=None, password=None):
     """Signs in a user, either with the specified email address and password, or a returning user."""
     if isinstance(self.driver, WebDriver):
         from pages.sign_in import SignIn
     else:
         from pages.marionette.sign_in import MarionetteSignIn as SignIn
     sign_in = SignIn(self.driver, self.timeout)
     sign_in.sign_in(email, password)
Ejemplo n.º 2
0
 def test_can_add_product_and_then_sign_in(self, browser, get_credentials):
     """proceed to sign in from shopping cart"""
     home_page = HomePage(browser)
     home_page.add_product_to_cart(6)  # add product No3 on home page to cart
     summary = CartSummary(browser)
     summary.go_to_checkout()  # click 'Go to checkout' in the short cart summary
     shopping_cart = ShoppingCart(browser)
     shopping_cart.proceed_to_sign_in()  # click 'Proceed to sign in' on the shopping cart page
     sign_in_page = SignIn(browser)
     sign_in_page.sign_in(*get_credentials)
Ejemplo n.º 3
0
 def test_user_can_sign_in(self, browser, get_credentials):
     """sign in
     test uses get_credentials fixture
     it gets credentials from a json file"""
     home_page = HomePage(browser)  # open the home page
     home_page.go_to_sign_in()  # open sign in page
     sign_in_page = SignIn(browser)
     sign_in_page.sign_in(*get_credentials)  # enter credentials into sign in form and submit
     account_page = AccountPage(browser)
     account_page.return_home_with_logo()  # get to home page by clicking logo link
     home_page = HomePage(browser)
     home_page.guest_should_be_logged_in()  # check if user is signed in
Ejemplo n.º 4
0
 def sign_in(self, email=None, password=None):
     """Signs in a user, either with the specified email address and password, or a returning user."""
     from pages.sign_in import SignIn
     sign_in = SignIn(self.selenium, timeout=self.timeout)
     if sign_in.is_initial_sign_in:
         sign_in.sign_in(email, password)
     else:
         sign_in.sign_in_returning_user()
         if len(self.selenium.window_handles) == 2:
             sign_in.click_this_is_not_my_computer()
             sign_in.switch_to_main_window()
Ejemplo n.º 5
0
 def test_guest_can_register(self, browser, register):
     """register
     test uses browser and register fixtures
     register fixture creates fake credentials before running the test
     and stores them in the json file"""
     home_page = HomePage(browser)  # open home page
     home_page.go_to_sign_in()  # click sign in button
     sign_in_page = SignIn(browser)
     sign_in_page.enter_email(register.get("email"))  # enter email into register field
     sign_in_page.fill_in_info(**register)
     sign_in_page.register_account()  # submit the form
Ejemplo n.º 6
0
 def test_guest_can_go_to_sign_in(self, browser):
     """go to sign in page"""
     home_page = HomePage(browser)  # open home page
     home_page.go_to_sign_in()  # click sign in button
     sign_in_page = SignIn(browser)
     sign_in_page.should_be_authentication_header()  # check if the page is sign in page
     sign_in_page.authentication_should_be_in_breadcrumbs()  # check if the page is followed in breadcrumbs
Ejemplo n.º 7
0
 def sign_in(self, email=None, password=None):
     """Signs in a user, either with the specified email address and password, or a returning user."""
     from pages.sign_in import SignIn
     sign_in = SignIn(self.testsetup)
     sign_in.sign_in(email, password)
Ejemplo n.º 8
0
 def sign_in(self, email, password):
     """Signs in using the specified email address and password."""
     from pages.sign_in import SignIn
     sign_in = SignIn(self.selenium, timeout=self.timeout, expect='new')
     sign_in.sign_in(email, password)
Ejemplo n.º 9
0
 def click_sign_in(self):
     self.selenium.find_element(*self._sign_in_locator).click()
     from pages.sign_in import SignIn
     return SignIn(self.testsetup)
Ejemplo n.º 10
0
 def sign_in(self, email, password):
     """Signs in using the specified email address and password."""
     from pages.sign_in import SignIn
     sign_in = SignIn(self.selenium, timeout=self.timeout, expect='new')
     sign_in.sign_in(email, password)