Ejemplo n.º 1
0
 def navigate_to_admin(self,username, password):
     if Conf.read_ini_config('Paths','HomeURL') in self.driver.current_url:
         self.driver.find_element(*AdminBase.admin_button).click()
     elif Conf.read_ini_config('Paths','AdminURL') not in self.driver.current_url:
         if self.driver.find_element(*LoginLogoutPage.login_link).text == 'Log in':
             LoginLogoutPage.login_with_valid_credentials(self,username,password)
             self.driver.get(Conf.read_ini_config('Paths','HomeURL'))
             self.driver.find_element(*AdminBase.admin_button).click()
Ejemplo n.º 2
0
 def test_product_details(self,username,password,productName,Category):
     LoginLogoutPage.login_with_valid_credentials(self,username,password)
     SearchPage.search_data(self,productName,Category)
     ProductDetailsPage.get_product_details(self,productName)
     ProductDetailsPage.give_your_Opinion_page(self,'Very Good')
     ProductDetailsPage.get_product_details(self,productName)
     self.assertTrue(ProductDetailsPage.add_to_notePad_Page(self,productName))
     ProductDetailsPage.get_product_details(self,productName)
     ProductDetailsPage.ge_details_tab(self)
Ejemplo n.º 3
0
    def test_manage_billing(self,name,password,surAddress, surName, firstName, email, company, address, zipCode,
                                                town, country, phone):
        LoginLogoutPage.login_with_valid_credentials(self,name,password)
        ManageBillingAddressPage.navigate_to_manage_billing(self)
        old_billing_no = len(ManageBillingAddressPage.get_billingAddress_list(self).options)
        ManageBillingAddressPage.Create_Another_Address(self, surAddress, surName, firstName, email, company, address,
                                                        zipCode, town, country, phone)

        # assert that the new address is created and added to drop down list
        self.assertIn('Your new address was created.', ManageBillingAddressPage.get_createAddress_msg(self))
        self.assertEqual(old_billing_no+1, len(ManageBillingAddressPage.get_billingAddress_list(self).options))
        self.assertEqual(old_billing_no+1 , len(ManageBillingAddressPage.get_shippingAddress_list(self).options))

        # Make the added address is default billing and shipping address
        ManageBillingAddressPage.get_billingAddress_list(self).select_by_visible_text(surAddress)
        ManageBillingAddressPage.get_shippingAddress_list(self).select_by_visible_text(surAddress)
Ejemplo n.º 4
0
 def navigate_to_page(self,username, password):
     if Conf.read_ini_config('Paths','AdminURL') in self.driver.current_url:
         self.driver.get(Conf.read_ini_config('Paths','HomeURL'))
         if self.driver.find_element(*LoginLogoutPage.login_link).text == 'Log in':
             LoginLogoutPage.login_with_valid_credentials(self,username,password)
Ejemplo n.º 5
0
 def test_smoke_testcase1(self,admin,adminpass,email,nickname,password,firstName,surname,company,capacity,dateofbirth,phone,mobile,address,zipcode,town,country,how_do_you_know_our_website, confirm):
     self.assertIn(confirm,RegistrationPage.Register_with_valid_input(self,email,nickname,password,firstName,surname,company,capacity,dateofbirth,phone,mobile,address,zipcode,town,country,how_do_you_know_our_website))
     self.assertTrue(email,RegistrationPage.verify_user_at_DB(self,nickname))
     self.assertIn(email,ManageUserPage.edit_user(self,admin,adminpass,email))
     LoginLogoutPage.logout(self)
     self.assertEqual(email,LoginLogoutPage.login_with_valid_credentials(self,nickname,password))
Ejemplo n.º 6
0
 def test_login_valid(self,username,password):
     self.assertEqual(username,LoginLogoutPage.login_with_valid_credentials(self,username,password))
Ejemplo n.º 7
0
 def test_FollowOrder_valid(self, username, password):
     LoginLogoutPage.login_with_valid_credentials(self, username, password)
     self.assertEqual('Payment pending',FollowUpOrdersPage.FollowOrder(self))
Ejemplo n.º 8
0
 def test_add(self, user, password):
     LoginLogoutPage.login_with_valid_credentials(self, user, password)
Ejemplo n.º 9
0
 def test_payment(self,userName,password,productName,Category):
     LoginLogoutPage.login_with_valid_credentials(self,userName,password)
     SearchPage.search_data(self,productName,Category)
     self.assertIn('Confirmation of your order',PaymentPages.pay_product(self,'grey','Large','2'))
     self.driver.get_screenshot_as_file('screenshot_PayConfirm.jpg')
Ejemplo n.º 10
0
 def test_search(self,username,password,scen,productName,Category,result):
     LoginLogoutPage.login_with_valid_credentials(self, username, password)
     self.assertIn(result,SearchPage.search_data(self,productName,Category))