Ejemplo n.º 1
0
    def test_search_customer_by_name(self, setup):
        self.logger.info("************* SearchCustomerByName_005 **********")
        self.driver = setup
        self.driver.get(self.baseURL)
        self.driver.maximize_window()

        self.lp = LoginPage(self.driver)
        self.lp.set_user_name(self.username)
        self.lp.set_password(self.password)
        self.lp.click_login()
        self.logger.info("************* Login successful **********")

        self.logger.info("******* Starting Search Customer By Name **********")

        self.addcust = AddCustomer(self.driver)
        self.addcust.click_on_customers_menu()
        self.addcust.click_on_customers_menu_item()
        time.sleep(2)

        self.logger.info("************* searching customer by Name **********")
        searchcust = SearchCustomer(self.driver)
        searchcust.set_first_name("James")
        searchcust.set_last_name("Pan")
        searchcust.click_search()
        time.sleep(5)
        status = searchcust.search_customer_by_name("James Pan")
        self.driver.close()
        assert True == status
        self.logger.info("***************  TC_SearchCustomerByName_005 Finished  *********** ")
Ejemplo n.º 2
0
    def test_searchCustomerByEmailID(self, setup):
        logger.info(
            "*****************Test_004_SearchCustomerByEmail **************")
        self.driver = setup
        self.driver.get(self.baseurl)
        self.driver.maximize.window()

        lp = LoginPage(self.driver)
        lp.setUserName(self.username)
        lp.setPassword(self.password)
        lp.clickLogin()

        logger.info(
            "**************************LOgin Successfull ******************")

        logger.info(
            "**********************Starting Search by Email test *******************"
        )
        add = AddCustomer(self.driver)
        add.clickonCustomerMenu()
        add.clickOnCustomersSubMenu()
        logger.info(
            "**********************Searching customer by email id ********************"
        )
        search = SearchCustomer(self.driver)
        search.enterEmail("*****@*****.**")
        search.clickSearch()
        time.sleep(4)
        status = search.searchCustomerByEmail(
            "*****@*****.**")
        assert True == status
        logger.info(
            "******************** TC_004_Search customer by email id Finished***************"
        )
        self.driver.close()
    def test_searchCustomerByName(self):
        self.logger.info("************* SearchCustomerByName_005 **********")
        self.driver = webdriver.Chrome(
            executable_path=".\\venv\\chromedriver_win32\\chromedriver")
        self.driver.get(self.baseURl)
        self.driver.maximize_window()

        self.lp = LoginPage(self.driver)
        self.lp.setUserName(self.userName)
        self.lp.setPassword(self.password)
        self.lp.clickLogin()
        self.logger.info("************* Login succesful **********")

        self.logger.info("******* Starting Search Customer By Name **********")

        self.addcust = AddCustomer(self.driver)
        self.addcust.clickOnCustomersMenu()
        self.addcust.clickOnCustomersMenuItem()
        time.sleep(2)

        self.logger.info("************* searching customer by Name **********")
        searchcust = SearchCustomer(self.driver)
        searchcust.setFirstName("Victoria")
        searchcust.setLastName("Terces")
        searchcust.clickSearch()
        time.sleep(5)
        status = searchcust.searchCustomerByName("Victoria Terces")
        self.driver.close()
        assert True == status
        self.logger.info(
            "***************  TC_SearchCustomerByName_005 Finished  *********** "
        )
Ejemplo n.º 4
0
 def __init__(self, context):
     self.base_page = BasePage(context)
     self.cart_page = CartPage(context)
     self.catalog_page = CatalogPage(context)
     self.home_page = HomePage(context)
     self.login_page = LoginPage(context)
     self.product_page = ProductPage(context)
    def test_search_customer_by_email(self, setup):
        self.logger.info("************* SearchCustomerByEmail_004 **********")
        self.driver = setup
        self.driver.get(self.baseURL)
        self.driver.maximize_window()

        self.lp = LoginPage(self.driver)
        self.lp.set_user_name(self.username)
        self.lp.set_password(self.password)
        self.lp.click_login()
        self.logger.info("************* Login succesful **********")

        self.logger.info(
            "******* Starting Search Customer By Email **********")

        self.addcust = AddCustomer(self.driver)
        self.addcust.click_on_customers_menu()
        self.addcust.click_on_customers_menu_item()

        self.logger.info(
            "************* searching customer by emailID **********")
        searchcust = SearchCustomer(self.driver)
        #searchcust.set_email("*****@*****.**")
        searchcust.set_email("*****@*****.**")
        time.sleep(5)
        searchcust.click_search()
        time.sleep(5)
        status = searchcust.search_customer_by_email(
            "*****@*****.**")
        print(status)
        self.driver.close()
        assert True == status
        self.logger.info(
            "***************  TC_SearchCustomerByEmail_004 Finished  *********** "
        )
    def test_CreateAccount_Successfull(self):
        homePage = HomePage(self.driver)
        loginPage = LoginPage(self.driver)
        createAccount = CreateAccountPage(self.driver)
        # Click Sign In Button
        homePage.clickSignIn()
        # Typing email
        loginPage.setEmail_Create(self.emailCreate_successfull)
        # Click button submit
        loginPage.clickSubmit_Create()

        # Typing personal information
        createAccount.setFirstName(self.firstName)
        createAccount.setLastName(self.lastName)
        createAccount.setPassword(self.password)
        createAccount.setAddress(self.address)
        createAccount.setCity(self.city)
        createAccount.selectState(self.state)
        createAccount.setPostalCode(self.postalCode)
        createAccount.setPhone(self.phone)
        createAccount.setAliasAdress(self.aliasAddress)
        createAccount.clickRegister()
        # Check status of creating account
        time.sleep(5)
        self.assertEqual(self.myAccountPage_title, self.driver.title,
                         "Create Account Uncessfully")
Ejemplo n.º 7
0
    def test_searchCustomerByEmail(self):
        self.logger.info("************* SearchCustomerByEmail_004 **********")
        self.driver = webdriver.Chrome(
            executable_path=".\\venv\\chromedriver_win32\\chromedriver")
        self.driver.get(self.baseURl)
        self.driver.maximize_window()

        self.lp = LoginPage(self.driver)
        self.lp.setUserName(self.userName)
        self.lp.setPassword(self.password)
        self.lp.clickLogin()
        self.logger.info("************* Login succesful **********")

        self.logger.info(
            "******* Starting Search Customer By Email **********")

        self.addcust = AddCustomer(self.driver)
        self.addcust.clickOnCustomersMenu()
        self.addcust.clickOnCustomersMenuItem()

        self.logger.info(
            "************* searching customer by emailID **********")
        searchcust = SearchCustomer(self.driver)
        searchcust.setEmail("*****@*****.**")
        searchcust.clickSearch()
        time.sleep(5)
        status = searchcust.searchCustomerByEmail(
            "*****@*****.**")
        self.driver.close()
        assert True == status
        self.logger.info(
            "***************  TC_SearchCustomerByEmail_004 Finished  *********** "
        )
    def test_searchCustomerByEmailID(self,setup):
        logger.info("*****************Test_005_SearchCustomerByName **************")
        self.driver = setup
        self.driver.get(self.baseurl)
        self.driver.maximize_window()

        lp = LoginPage(self.driver)
        lp.setUserName(self.username)
        lp.setPassword(self.password)
        lp.clickLogin()

        logger.info("**************************LOgin Successfull ******************")

        logger.info("**********************Starting Search by name test *******************")
        add = AddCustomer(self.driver)
        time.sleep(2)
        add.clickonCustomerMenu()
        time.sleep(2)
        add.clickOnCustomersSubMenu()
        logger.info("**********************Searching customer by name ********************")
        search = SearchCustomer(self.driver)
        search.enterFirstName("Victoria")
        search.enterLastName("Terces")
        search.clickSearch()
        time.sleep(4)
        status = search.searchCustomerByName("Victoria Terces")
        assert True == status
        logger.info("******************** TC_005_Search customer by name Finished***************")
        self.driver.close()
Ejemplo n.º 9
0
 def loginSuccess(driver, username, password):
     try:
         driver.get(url)
         login = LoginPage(driver)
         # main = MainPage(driver)
         if username:
             login.userNameObj().send_keys(username)
         if password:
             login.passwordObj().send_keys(password)
         login.loginBtn().click()
         time.sleep(1)
         login.loginCon().click()
         time.sleep(1)
         # 判断是否进入住院收费处的页面url_zysf,是则增加一步
         if driver.current_url == url_zysf:
             login.loginfirstSys().click()
             time.sleep(1)
             ActionChains(driver).double_click(login.loginSys()).perform()
         elif driver.current_url == url_hiszysf:
             # 鼠标双击新版His住院收费
             ActionChains(driver).double_click(login.loginSys()).perform()
         # login.userNameObj().clear()
         # login.passwordObj().clear()
         # driver.quit()
     except Exception as e:
         raise e
Ejemplo n.º 10
0
 def test_login(self):
     lp = LoginPage(self.driver)
     lp.setUserName(self.username)
     lp.setPassword(self.password)
     lp.clickLogin()
     time.sleep(5)
     self.assertEqual("Dashboard / nopCommerce administration",
                      self.driver.title, "webpage titile is not match")
    def test_addCustomer(self, setup):
        logger.info("************Test_003_AddCustomer************")
        self.driver = setup
        self.driver.get(self.baseurl)
        self.driver.maximize_window()
        lp = LoginPage(self.driver)
        lp.setUserName(self.username)
        lp.setPassword(self.password)
        lp.clickLogin()
        logger.info("**************** LOgin SuccessFull **************")

        logger.info(
            "******************** Started Add customer test *************")

        add = AddCustomer(self.driver)
        time.sleep(2)
        add.clickonCustomerMenu()
        time.sleep(2)
        add.clickOnCustomersSubMenu()
        add.clickAddNew()
        logger.info(
            "***************** Started adding Customer Info***************")

        email = random_generator() + '@gamail.com'
        add.enterEmail(email)
        add.enerPassword("test1234")
        add.setCustomerRole('Guests')
        add.setManagerofVendor('Vendor 2')
        add.setGender('Male')
        add.setFirstName('Rambabu')
        add.setLastName('Vuyyuri')
        add.setDOB('7/08/1996')
        add.setCompanyName('TechM')
        add.setAdmincontent('This is practice testing')
        add.clickSaveButton()

        logger.info("********************Saving Customer Info***************")

        logger.info(
            "***********************Add customer Validation Started************"
        )
        msg = self.driver.find_element_by_tag_name('body').text

        #print(msg)
        if 'customer has been added successfully.' in msg:
            assert True == True
            logger.info(
                "***************Add Customer test passed ***************")

        else:
            self.driver.save_screenshot(".\\Screenshots\\addCustomer.png")
            logger.error(
                "***************Add customer test failed**************")
            assert True == False

        self.driver.close()
        logger.info("***************Ending Home page title text*************")
    def test_login_ddt(self, setup):
        self.logger.info("******* Starting Test_002_DDT_Login Test **********")
        self.logger.info("******* Starting Login DDT Test **********")
        self.driver = setup
        self.driver.get(self.baseURL)
        self.driver.maximize_window()
        self.lp = LoginPage(self.driver)

        self.rows = XL_Utils.get_row_count(self.path, 'Sheet1')
        print('Number of rows...', self.rows)
        lst_status = []

        for r in range(2, self.rows + 1):
            self.user = XL_Utils.read_data(self.path, 'Sheet1', r, 1)
            self.password = XL_Utils.read_data(self.path, 'Sheet1', r, 2)
            self.exp = XL_Utils.read_data(self.path, 'Sheet1', r, 3)
            print("User name & Password for row : " + str(r) + " is " +
                  self.user + " & " + self.password)
            self.lp.set_user_name(self.user)
            self.lp.set_password(self.password)
            self.lp.click_login()
            time.sleep(5)

            act_title = self.driver.title
            print(act_title)
            exp_title = "Dashboard / nopCommerce administration"

            if act_title == exp_title:
                if self.exp == 'Pass':
                    self.logger.info("**** passed ****")
                    self.lp.click_logout()
                    lst_status.append("Pass")
                elif self.exp == 'Fail':
                    self.logger.info("**** failed ****")
                    self.lp.click_logout()
                    lst_status.append("Fail")

            elif act_title != exp_title:
                if self.exp == 'Pass':
                    self.logger.info("**** failed ****")
                    lst_status.append("Fail")
                elif self.exp == 'Fail':
                    self.logger.info("**** passed ****")
                    lst_status.append("Pass")
            print(lst_status)
        if "Fail" not in lst_status:
            self.logger.info("******* DDT Login test passed **********")
            self.driver.close()
            assert True
        else:
            self.logger.error("******* DDT Login test failed **********")
            self.driver.close()
            assert False

        self.logger.info("******* End of Login DDT Test **********")
        self.logger.info(
            "**************** Completed  TC_LoginDDT_002 ************* ")
Ejemplo n.º 13
0
    def test_addCustomer(self):
        self.logger.info("************* Test_003_AddCustomer **********")
        self.driver = webdriver.Chrome(
            executable_path=".\\venv\\chromedriver_win32\\chromedriver")
        self.driver.get(self.baseURl)
        self.driver.maximize_window()

        self.lp = LoginPage(self.driver)
        self.lp.setUserName(self.userName)
        self.lp.setPassword(self.password)
        self.lp.clickLogin()
        self.logger.info("************* Login succesful **********")

        self.logger.info("******* Starting Add Customer Test **********")

        self.addcust = AddCustomer(self.driver)
        self.addcust.clickOnCustomersMenu()
        self.addcust.clickOnCustomersMenuItem()

        self.addcust.clickOnAddnew()

        self.logger.info("************* Providing customer info **********")

        self.email = random_generator() + "@gmail.com"
        self.addcust.setEmail(self.email)
        self.addcust.setPassword("test123")
        self.addcust.setCustomerRoles("Guests")
        self.addcust.setManagerOfVendor("Vendor 2")
        self.addcust.setGender("Male")
        self.addcust.setFirstName("Pavan")
        self.addcust.setLastName("Kumar")
        self.addcust.setDob("7/05/1985")  # Format: D / MM / YYY
        self.addcust.setCompanyName("busyQA")
        self.addcust.setAdminContent("This is for testing.........")
        self.addcust.clickOnSave()

        self.logger.info("************* Saving customer info **********")

        self.logger.info(
            "********* Add customer validation started *****************")

        self.msg = self.driver.find_element_by_tag_name("body").text

        # print(self.msg)
        if 'The new customer has been added successfully.' in self.msg:
            assert True
            self.logger.info("********* Add customer Test Passed *********")
        else:
            self.driver.save_screenshot(
                ".\\Screenshots\\" + "test_addCustomer_scr.png")  # Screenshot
            self.logger.error(
                "********* Add customer Test Failed ************")
            assert False

        self.driver.close()
        self.logger.info("******* Ending Add customer test **********")
Ejemplo n.º 14
0
    def test_validLogin(self):
        homePage = HomePage(self.driver)
        loginPage = LoginPage(self.driver)
        uploadPage = UploadPage(self.driver)

        homePage.homeUsersLinkAccess()

        loginPage.homeUserLogin()

        uploadPage.validateUploadSection()
Ejemplo n.º 15
0
 def proceed_to_checkout(self, emailSignIn, passwordSignIn):
     self.click_proceed_to_check_out_summary_process()
     loginPage = LoginPage(self.driver)
     loginPage.sign_in(emailSignIn, passwordSignIn)
     self.click_proceed_to_check_out_address_process()
     self.click_term_agreement()
     self.click_proceed_to_check_out_shippingProcess_xpath()
     self.click_pay_by_bank_wire()
     self.click_confirm_my_order()
     return self.get_complete_message()
Ejemplo n.º 16
0
    def test_login_ddt(self, setup):
        self.logger.info("****Test_002_DDT_Login")
        self.logger.info("**********verify login_ddt test*************")
        self.driver = setup
        self.driver.get(self.baseURL)

        self.lp = LoginPage(self.driver)

        self.rows = ExcelUtils.getRowCount(self.path, 'Sheet1')
        print("no.of rows in excel", self.rows)

        lst_status = []  #empty list variable

        for r in range(2, self.rows + 1):
            self.user = ExcelUtils.readdata(self.path, 'Sheet1', r, 1)
            self.password = ExcelUtils.readdata(self.path, 'Sheet1', r, 2)
            self.exp = ExcelUtils.readdata(self.path, 'Sheet1', r, 3)

            self.lp.setUserName(self.user)
            self.lp.setPassword(self.password)
            self.lp.clickLogin()
            time.sleep(5)

            act_title = self.driver.title
            exp_title = "Dashboard/nopCommerce administration"

            if act_title == exp_title:
                if self.exp == "Pass":
                    self.logger.info("******passed")
                    self.lp.clickLogout()
                    lst_status.append("pass")
                elif self.exp == "fail":
                    self.logger.info("*********failed*****")
                    self.lp.clickLogout()
                    lst_status.append("fail")

            elif act_title != exp_title:
                if self.exp == 'Pass':
                    self.logger.info("********failed*****")
                    lst_status.append("Fail")
                elif self.exp == 'fail':
                    self.logger.info("*********passed****")
                    lst_status.append("Pass")

        if "Fail" not in lst_status:
            self.logger.info("**********login ddt test passed****")
            self.driver.close()
            assert True
        else:
            self.logger.info("**********login ddt test failed****")
            self.driver.close()
            assert False

        self.logger.info("end of login ddt test")
        self.logger.info("completed test_002_login_ddt")
Ejemplo n.º 17
0
    def test_DDT_login(self):
        self.driver = webdriver.Chrome(
            executable_path=".\\venv\\chromedriver_win32\\chromedriver")
        self.driver.get(self.baseURl)
        self.driver.implicitly_wait(5)
        self.lp = LoginPage(self.driver)

        self.rows = XLUtils.getRowCount(self.path, 'Sheet1')

        list_status = []
        for r in range(2, self.rows + 1):
            self.userName = XLUtils.readData(self.path, 'Sheet1', r, 1)
            self.password = XLUtils.readData(self.path, 'Sheet1', r, 2)
            self.exp = XLUtils.readData(self.path, 'Sheet1', r, 3)

            self.lp.setUserName(self.userName)
            self.lp.setPassword(self.password)
            self.lp.clickLogin()
            time.sleep(5)

            act_title = self.driver.title
            exp_title = "Dashboard / nopCommerce administration"

            if act_title == exp_title:
                if self.exp == 'pass':
                    self.logger.info("********Passed********")
                    self.lp.clickLogout()
                    list_status.append('pass')

                elif self.exp == 'fail':
                    self.logger.info("***********Failed**********")
                    self.lp.clickLogout()
                    list_status.append('fail')

            elif act_title != exp_title:
                if self.exp == 'fail':
                    self.logger.info("********Passed********")
                    list_status.append('pass')

                elif self.exp == 'pass':
                    self.logger.info("***********Failed**********")
                    list_status.append('fail')

        if 'fail' not in list_status:
            self.logger.info("Login_DDT_test Passed")
            self.driver.close()
            assert True

        else:
            self.logger.error("Login_DDT_Test is failed")
            self.driver.close()
            assert False

        self.logger.info("**********End of TC_002_DDT_login**********")
Ejemplo n.º 18
0
    def test_login_ddt(self, setup):
        self.logger.info("*********test no. 1***********")
        self.logger.info("*********verifying Login DDT test***********")
        self.driver = setup
        self.driver.get(self.baseURL)

        self.lp = LoginPage(self.driver)
        self.rows = ExcelUtils.getRowCount(self.path, 'sheet1')
        print("Number of Row: ", self.rows)

        lst_status = []  #empty list vars

        for row in range(2, self.rows + 1):
            self.username = ExcelUtils.readData(self.path, 'sheet1', row, 1)
            self.password = ExcelUtils.readData(self.path, 'sheet1', row, 2)
            self.exp = ExcelUtils.readData(self.path, 'sheet1', row, 3)

            self.lp.setUserName(self.username)
            self.lp.setPassword(self.password)
            self.lp.clickLogin()
            time.sleep(5)

            act_title = self.driver.title
            exp_title = "Dashboard / nopCommerce administration"

            if act_title == exp_title:
                if self.exp == "Pass":
                    self.logger.info("***Passed***")
                    self.lp.clickLogout()
                    lst_status.append("Pass")
                elif self.exp == "Fail":
                    self.logger.info("**Failed***")
                    self.lp.clickLogout()
                    lst_status.append("Fail")
            elif act_title != exp_title:
                if self.exp == "Pass":
                    self.logger.info("***Failed***")
                    lst_status.append("Fail")
                elif self.exp == "Fail":
                    self.logger.info("***Passed***")
                    lst_status.append("Pass")

        if "Fail" not in lst_status:
            self.logger.info("***Login DDT test has passed***")
            self.driver.close()
            assert True
        else:
            self.logger.info("***Login DDT test has failed***")
            self.driver.close()
            assert False

        self.logger.info(lst_status)
        self.logger.info("end of test")
Ejemplo n.º 19
0
    def test_add_customer(self, setup):
        self.logger.info("************* Test_003_AddCustomer **********")
        self.driver = setup
        self.driver.get(self.baseURL)
        self.driver.maximize_window()

        self.lp = LoginPage(self.driver)
        self.lp.set_user_name(self.username)
        self.lp.set_password(self.password)
        self.lp.click_login()
        self.logger.info("************* Login successful **********")

        self.logger.info("******* Starting Add Customer Test **********")

        self.addcust = AddCustomer(self.driver)
        self.addcust.click_on_customers_menu()
        self.addcust.click_on_customers_menu_item()
        time.sleep(2)
        self.addcust.click_on_add_new()
        time.sleep(2)
        self.logger.info("************* Providing customer info **********")

        self.email = random_generator() + "@gmail.com"
        self.addcust.set_email(self.email)
        self.addcust.set_password("test123")
        self.addcust.set_customer_roles("Guests")
        self.addcust.set_manager_of_vendor("Vendor 2")
        self.addcust.set_gender("Male")
        self.addcust.set_first_name("Amit")
        self.addcust.set_last_name("Singh")
        self.addcust.set_dob("07/21/1991")  # Format: D / MM / YYY
        self.addcust.set_company_name("XYZ_ABC")
        self.addcust.set_admin_content("This is for testing.........")
        self.addcust.click_on_save()

        self.logger.info("************* Saving customer info **********")

        self.logger.info("********* Add customer validation started *****************")

        self.msg = self.driver.find_element_by_tag_name("body").text

        print(self.msg)
        if 'customer has been added successfully.' in self.msg:
            assert True
            self.logger.info("********* Add customer Test Passed *********")
        else:
            self.driver.save_screenshot(".\\Screenshots\\" + "test_addCustomer_scr.png")  # Screenshot
            self.logger.error("********* Add customer Test Failed ************")
            assert False

        self.driver.close()
        self.logger.info("******* Ending Add customer test **********")
 def test_CreateAccount_Error(self):
     loginPage = LoginPage(self.driver)
     homePage = HomePage(self.driver)
     # Click Sign In button
     homePage.clickSignIn()
     # Typing email
     loginPage.setEmail_Create(self.emailCreate_fail)
     # Click Submit button
     loginPage.clickSubmit_Create()
     # Check the Invalid Email Message (Create Account)
     create_account_error_message = loginPage.getCreateAccountError_messages(
     )
     self.assertEqual(self.invalidEmailCreate_message,
                      create_account_error_message,
                      "Error Message is not match!")
Ejemplo n.º 21
0
 def loginFail(driver, username, password):
     try:
         driver.get(url)
         login = LoginPage(driver)
         if username:
             login.userNameObj().send_keys(username)
         if password:
             login.passwordObj().send_keys(password)
         login.loginBtn().click()
         time.sleep(1)
         login.errorClose().click()
         login.userNameObj().clear()
         login.passwordObj().clear()
         # driver.quit()
     except Exception as e:
         raise e
 def test_write_a_comment(self):
     # Feature: Chi tiết sản phẩm; Title: Write a comment
     emailSignIn = '*****@*****.**'
     passwordSignIn = '123456'
     homePage = HomePage(self.driver)
     homePage.clickSignIn()
     loginPage = LoginPage(self.driver)
     loginPage.sign_in(emailSignIn, passwordSignIn)
     self.driver.implicitly_wait(10)
     self.driver.get(self.baseURL)
     homePage.click_product_image(1)
     productDetailPage = ProductDetailPage(self.driver)
     productDetailPage.leave_review('Comment', 'Good')
     send_review_message = productDetailPage.get_send_review_message()
     self.assertEqual(
         'Your comment has been added and will be available once approved by a moderator',
         send_review_message, "Send review unsuccessfully")
Ejemplo n.º 23
0
    def test_AddCustomer(self, setup):
        self.logger.info("***********Test_001_Login*************")
        self.driver = setup
        self.driver.get(self.baseURL)
        self.lp = LoginPage(self.driver)
        self.lp.setUserName(self.username)
        self.lp.setPassword(self.password)
        self.lp.clickLogin()

        self.logger.info("***********login succesful*************")
        self.logger.info("***********Starting Add Customer test ************")

        self.addcust = AddCustomer(self.driver)
        self.addcust.clickOnCustomersMenu()
        self.addcust.clickOnCustomersMenuItem()
        self.addcust.clickOnAddnew()
        self.logger.info("***********Providing Customer Info ************")
Ejemplo n.º 24
0
    def test_AddCustomer(self, setup):
        self.logger.info("***********Test_001_Login*************")
        self.driver = setup
        self.driver.get(self.baseURL)
        self.lp = LoginPage(self.driver)
        self.lp.setUserName(self.username)
        self.lp.setPassword(self.password)
        self.lp.clickLogin()

        self.logger.info("***********login succesful*************")
        self.logger.info("***********Starting Add Customer test ************")

        self.addcust = AddCustomer(self.driver)
        self.addcust.clickOnCustomersMenu()
        self.addcust.clickOnCustomersMenuItem()
        self.addcust.clickOnAddnew()
        self.logger.info("***********Providing Customer Info ************")

        self.email = random_generator() + "@gmail.com"
        self.addcust.setEmail(self.email)
        self.addcust.setPassword("test123")
        self.addcust.setFirstName("Pooja")
        self.addcust.setLastName("Gupta")
        self.addcust.setGender("Female")
        self.addcust.setDob("09/16/1997")
        self.addcust.setCompanyName("BusyQA")
        self.addcust.setAdminContent("This s for testing")
        self.addcust.setMgrOfVendor("Not a vendor")
        self.addcust.setCustomerRole("Registered")
        self.addcust.clickOnSave()
        self.logger.info("***********Saving Customer Info ************")

        self.logger.info(
            "***********Add Customer validation started************")
        self.msg = self.driver.find_element_by_tag_name("body").text
        print(self.msg)
        if ' customer has been added successfully' in self.msg:
            assert True == True
            self.logger.info("******Add customer Test passed*************")
        else:
            self.driver.save_screenshot(".\\Screenshots\\" +
                                        "test_addcustomer_scr.png")
            self.logger.info("******Add customer Test failed*************")
            assert True == False
        self.driver.close()
        self.logger.info("**********Ending Add Customer Test*********")
Ejemplo n.º 25
0
 def testLogin(self, setUp):
     self.driver = setUp
     self.driver.get(ReadConfig.getLoginPageURL())
     loginp = LoginPage(self.driver)
     loginp.setUserName(self.email)
     loginp.setPassword(self.password)
     loginp.clickLogin()
     time.sleep(5)
     currentUrl = self.driver.current_url
     if currentUrl == ReadConfig.getHomePageURL():
         self.driver.close()
         assert True
     else:
         allure.attach(self.driver.get_screenshot_as_png(),
                       name="Failed Login After Registration",
                       attachment_type=AttachmentType.PNG)
         self.driver.close()
         assert False
Ejemplo n.º 26
0
    def test_login(self):
        self.driver = webdriver.Chrome(
            executable_path="C:\Drivers\chromedriver_win32\chromedriver")
        self.driver.get(self.baseURl)
        self.lp = LoginPage(self.driver)
        self.lp.setUserName(self.userName)
        self.lp.setPassword(self.password)
        self.lp.clickLogin()
        actual_title = self.driver.title
        if actual_title == "Dashboard / nopCommerce administration":
            self.driver.close()
            self.logger.info("*****Test is passed******")
            assert True

        else:
            self.driver.save_screenshot(".\screenshots\loginPage.png")
            self.driver.close()
            self.logger.error("*****Test is Failed******")
            assert False
Ejemplo n.º 27
0
 def test_login(self,setup):
     logger.info("************************* Verifying Login Test ******************")
     self.driver = setup
     self.driver.get(self.baseurl)
     lp=LoginPage(self.driver)
     lp.setUserName(self.username)
     lp.setPassword(self.password)
     lp.clickLogin()
     actual_title = self.driver.title
     lp.clickLogout()
     if actual_title == "Dashboard / nopCommerce administration":
         assert True
         self.driver.close()
         logger.info("********************** Login Home page passed ***************")
     else:
         self.driver.save_screenshot(".\\Screenshots\\test_login.png")
         self.driver.close()
         assert False
         logger.info("*************************** LOgin test failed and captured SS: ****************")
    def test_login(self, setup):

        self.logger.info("****Started Login Test****")
        self.driver = setup
        self.driver.get(self.baseURL)
        self.lp = LoginPage(self.driver)
        self.lp.set_user_name(self.username)
        self.lp.set_password(self.password)
        self.lp.click_login()
        act_title = self.driver.title
        if act_title == "Dashboard / nopCommerce administration":
            self.logger.info("****Login test passed ****")
            self.driver.close()
            assert True
        else:
            self.logger.error("****Login test failed ****")
            self.driver.save_screenshot(".\\Screenshots\\" + "test_login.png")
            self.driver.close()
            assert False
Ejemplo n.º 29
0
    def test_login(self, setup):
        self.logger.info("**********verify login test*************")
        self.driver = setup
        self.driver.get(self.baseURL)
        self.lp = LoginPage(self.driver)
        self.lp.setUserName(self.username)
        self.lp.setPassword(self.password)
        self.lp.clickLogin()
        act_title = self.driver.title

        if act_title == "Dashboard / nopCommerce administration":
            assert True
            self.logger.info(
                "***********home page title is passed*************")
            self.driver.close()
        else:
            self.driver.save_screenshot(".\\Screenshots\\" + "test_login.png")
            self.driver.close()
            self.logger.error(
                "***********home page title is failed*************")
            assert False
Ejemplo n.º 30
0
    def test_change_and_order_successfully(self):
        # Feature: Mua hàng; Title: Thay đổi thông tin mua hàng

        # Check total price
        homePage = HomePage(self.driver)
        for i in range(1, 5):
            homePage.add_product_and_continue(i)
        homePage.add_product_and_checkout(5)
        checkOutPage = CheckOutPage(self.driver)
        checkOutPage.set_product_quantity(2, 3)
        checkOutPage.click_delete_product(3)
        time.sleep(10)
        price = 0
        for i in range(1, 5):
            price += checkOutPage.get_product_price(i)
        totalPrice = checkOutPage.get_products_price()
        self.assertEqual(price, totalPrice, "Total price was not suitable")

        # Proceed to checkout (without agree term of service)
        checkOutPage.click_proceed_to_check_out_summary_process()
        loginPage = LoginPage(self.driver)
        loginPage.sign_in(self.emailSignIn, self.passwordSignIn)
        checkOutPage.click_proceed_to_check_out_address_process()
        checkOutPage.click_proceed_to_check_out_shippingProcess_xpath(
        )  # Click proceed to checkout without agree terms of service before
        termsAgreementWarning = checkOutPage.get_terms_agreement_warning()
        self.assertEqual(
            'You must agree to the terms of service before continuing.',
            termsAgreementWarning, 'Terms Agreement warning is not match!')
        checkOutPage.close_terms_agreement_warning(
        )  # Close terms agreement warnings
        checkOutPage.click_term_agreement()  # Click term agreement
        checkOutPage.click_proceed_to_check_out_shippingProcess_xpath(
        )  # Click proceed to checkout with agree terms of service before
        checkOutPage.click_pay_by_bank_wire()
        checkOutPage.click_confirm_my_order()
        completeMessage = checkOutPage.get_complete_message(
        )  # Get complete message
        self.assertEqual('Your order on My Store is complete.',
                         completeMessage, "Proceed to checkout unsuccesfully")