class Test_SearchCustomerByEmail_004:
    baseURL = "http://admin-demo.nopcommerce.com"
    username = "******"
    password = "******"
    logger = LogGen.loggen()  # Logger

    @pytest.mark.regression
    def test_searchCustomerByEmail(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.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  *********** ")
Esempio n. 2
0
class Test_004_SearchCustomerbyEmail:
    baseURL = ReadConfig.getApplicationsURL()
    username = ReadConfig.getUseremail()
    password = ReadConfig.getpassword()
    log = LogGen.loggen()

    @pytest.mark.regression
    def test_searchCustomerbyEmail(self, setup):
        self.log.info("********* Test_004_SearchCustomerbyEmail ********")
        self.log.info("********* Verifying Home Page Title ********")
        self.driver = setup
        self.driver.get(self.baseURL)
        page_title = self.driver.title
        self.lp = LoginPage(self.driver)
        self.lp.setUserName(self.username)
        self.lp.setPassword(self.password)
        self.lp.clickLogin()
        self.log.info("********* Login Successful ********")
        self.log.info("********* Starting Search Customer Test ********")

        self.addCust = AddCustomerPage(self.driver)
        self.addCust.clickonCustomerMenu()
        self.addCust.clickonCustomerMenuItem()

        self.log.info("********* Searching Customer by EmailID ********")

        self.searchCust = SearchCustomer(self.driver)
        self.searchCust.setEmail("*****@*****.**")
        self.searchCust.clicksearch()
        time.sleep(3)
        status = self.searchCust.SearchbyEmail("*****@*****.**")
        assert True == status
        self.log.info("********* Test_004_SearchCustomer Finished ********")
        self.driver.close()
Esempio n. 3
0
class Test_003_AddCustomer:
    baseURL = ReadConfig.getApplicationURL()
    username = ReadConfig.getUseremail()
    password = ReadConfig.getPassword()
    logger = LogGen.loggen()  # Logger

    @pytest.mark.sanity
    def test_addCustomer(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.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.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.setCustomerRoles("Guests")
        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 == 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 True==False

        self.driver.close()
        self.logger.info("******* Ending Add customer test **********")
Esempio n. 4
0
class Test_001_DDT_login:
    # variable creation
    url = ReadConfig.getApplicationURL()
    path = ".//TestData/TestData.xlsx"
    logger = LogGen.loggen()

    def test_login_DDT_001(self, setup):
        self.logger.info("********** test_login_DDT_001 Started ************")
        self.logger.info("********** DDT Test ******")
        self.driver = setup
        self.driver.get(self.url)
        self.lp = LoginPage(self.driver)

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

        lst_status = []  #will use latar empty

        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("**** Test is Passed ****")
                    self.lp.clickLogout()
                    lst_status.append("Pass")
                elif self.exp == "Fail":
                    self.logger.info("**** Test is Failed ****")
                    self.lp.clickLogout()
                    lst_status.append("Fail")
            elif act_title != exp_title:
                if self.exp == "Pass":
                    self.logger.info("**** Test is Failed ****")
                    lst_status.append("Fail")
                elif self.exp == "Fail":
                    self.logger.info("**** Test is Passed ****")
                    lst_status.append("Pass")

        if "Fail" not in lst_status:
            self.logger.info(" **** Login DDT Passed ")
            self.driver.close()
            assert True
        else:
            self.logger.info("**** Login DDT Failed ")
            self.driver.close()
            assert False

        self.logger.info("---------End of Login DDT Test-------")
        self.logger.info("----------Completed TC_001/DDT-------")
Esempio n. 5
0
 def test_login(self):
     lp = LoginPage(self.driver)
     lp.setUserName(self.userName)
     lp.setPassword(self.password)
     lp.clickLogin()
     time.sleep(2)
     self.assertEqual("Dashboard / nopCommerce administration",
                      self.driver.title, "Webpage title is not matching")
Esempio n. 6
0
 def test_Login(self):
     lp = LoginPage(self.driver)
     lp.setUserName(self.username)
     lp.setPassword(self.password)
     lp.clickLogin()
     time.sleep(5)
     self.assertEqual("Security Verification | LinkedIn", self.driver.title,
                      "Title didn't Match")
class Test_002_DDT_Login():

    baseUrl = ReadConfig.get_application_URL()
    path = "./TestData/LoginData.xlsx"
    logger = LogGen.log_gen()


    @pytest.mark.regression
    def test_login_ddt(self,setup):
        self.logger.info("**********Test_002_DDT_Login*********")
        self.logger.info("**********test_login_ddt*************")
        self.logger.info("**********Verifying the Login DDT test*********")
        self.driver = setup
        self.driver.get(self.baseUrl)
        self.lp = LoginPage(self.driver)

        self.row = ExcelUtils.get_row_count(self.path,"data")
        print("No of rows in an excel",self.row)
        lst_status = []

        for r in range(2,self.row+1):
            self.user = ExcelUtils.read_data(self.path,"data",r,1)
            self.pwd = ExcelUtils.read_data(self.path, "data", r, 2)
            self.exp = ExcelUtils.read_data(self.path, "data", r, 3)
            self.lp.setUserName(self.user)
            self.lp.setPassword(self.pwd)
            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=="Fail":
                    self.logger.info("****Passed******")
                    lst_status.append("Pass")
                elif self.exp=="Pass":
                    self.logger.info("*****Failed******")
                    lst_status.append("Fail")
        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 DDT Login TC_002**********")
class Test_003_AddCustomer:
    baseURL = ReadConfig.getApplicationsURL()
    username = ReadConfig.getUseremail()
    password = ReadConfig.getpassword()
    log = LogGen.loggen()

    @pytest.mark.sanity
    def test_homepage_title(self, setup):
        self.log.info("********* Test_003_AddCustomer ********")
        self.log.info("********* Verifying Home Page Title ********")
        self.driver = setup
        self.driver.get(self.baseURL)
        page_title = self.driver.title
        self.lp = LoginPage(self.driver)
        self.lp.setUserName(self.username)
        self.lp.setPassword(self.password)
        self.lp.clickLogin()
        self.log.info("********* Login Successful ********")
        self.log.info("********* Starting Add Customer Test ********")

        self.addCust = AddCustomerPage(self.driver)
        self.addCust.clickonCustomerMenu()
        self.addCust.clickonCustomerMenuItem()
        self.addCust.clickAddNew()

        self.log.info("********* Entering new  Customer Details ********")
        self.email = random_generator() + "@gmail.com"
        self.addCust.setEmail(self.email)
        self.addCust.setPassword("test123")
        # self.addCust.setCustomerRoles("Guests")
        self.addCust.setFirstName("Talha")
        self.addCust.setLastName("Ghaffar")
        self.addCust.setGender("Female")
        self.addCust.enterDOB("1/1/1990")
        self.addCust.setCompanyName("AdvanceQA")
        self.addCust.setNewsletter()
        self.addCust.setCustomerRoles("Vendors")
        self.addCust.setManagerOfVendor("Vendor 2")
        self.addCust.setAdminComment("Hello, This is a new customer")
        self.addCust.clickOnSave()

        self.log.info("********* Saving new  Customer Details ********")
        self.log.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.log.info("********* Add Customer Test Passed ********")
        else:
            self.driver.save_screenshot("./Screenshots/" +
                                        "test_addCustomer.png")
            self.log.error("********* Add Customer Test Failed ********")
            assert False

        self.driver.close()
        self.log.info("******* Ending Add customer test **********")
 def test_login(self):
     lp = LoginPage(self.driver)  #object created for loginpage
     #and initiated the driver
     lp.setUserName(self.username)
     lp.setPassword(self.password)
     lp.clickLogin()
     time.sleep(5)
     self.assertEqual("Dashboard/nopCommerce administration",
                      self.driver.title, "webpage title is not matching ")
Esempio n. 10
0
class Test_001_Login:
    #Hardcoded data
    '''baseURL = "https://admin-demo.nopcommerce.com/"
    username = "******"
    password = "******"
'''
    #commond information by using readconfig (Dynamic)
    baseURL = ReadConfig.getApplicationURL()
    username = ReadConfig.getUseremail()
    password = ReadConfig.getPassword()

    logger = LogGen.loggen()

    @pytest.mark.sanity
    @pytest.mark.regression
    def test_homePageTitle(self, setup):
        self.logger.info("********* test_homePageTitle *******")
        self.logger.info("********* Verifying Home page Title *******")
        self.driver = setup
        self.driver.get(self.baseURL)
        act_title = self.driver.title
        if act_title == "Your store. Login":
            assert True
            self.driver.close()
            self.logger.info(
                "********* Home Page Title Test Case is Passed *******")

        else:
            self.driver.save_screenshot(".\\Screenshots\\" +
                                        "test_homePageTitle.png")
            self.driver.close()
            self.logger.info(
                "********* Home Page Title Test Case is Failed *******")
            assert False

    @pytest.mark.skip
    def test_Login(self, setup):
        self.logger.info("********* test_Login *******")
        self.logger.info("********* Verifying 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("********* Login Test Case is Passed *******")
            self.driver.close()

        else:
            self.driver.save_screenshot(".\\Screenshots\\" + "test_Login.png")
            self.driver.close()
            self.logger.error("********* Login Test case is Failed *******")
            assert False
 def test_Login(self):
     lp = LoginPage(self.driver)
     lp.setUserName(self.username)
     lp.setPassword(self.password)
     lp.clickLogin()
     tit1 = self.driver.title
     
     time.sleep(5)
     
     self.assertEqual("Dashboard / nopCommerce administration",tit1,"Title is different")
Esempio n. 12
0
class Test_002_DDT_Login:
    baseURL = ReadConfig.getApplicationsURL()
    path = "./TestData/LoginData.xlsx"

    log = LogGen.loggen()

    @pytest.mark.regression
    def test_login_ddt(self, setup):
        self.log.info("********* Test_001_ddt_Login ********")
        self.log.info("********* Verifying Login Test ********")
        self.driver = setup
        self.driver.get(self.baseURL)
        self.lp = LoginPage(self.driver)

        lst_status = []
        self.rows = XLUtils.getRowCount(self.path, "Sheet1")
        for r in range(2, self.rows + 1):
            self.user = 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.user)
            self.lp.setPassword(self.password)
            self.lp.clickLogin()
            time.sleep(5)
            page_title = self.driver.title
            if page_title == "Dashboard / nopCommerce administration":
                if self.exp == "Pass":
                    self.lp.clickLogout()
                    self.log.info("********* Passed ********")
                    lst_status.append("Pass")
                elif self.exp == "Fail":
                    self.log.info("********* Failed ********")
                    lst_status.append("Fail")
            elif page_title != "Dashboard / nopCommerce administration":
                if self.exp == "Pass":
                    self.log.info("********* Failed ********")
                    lst_status.append("Fail")
                elif self.exp == "Fail":
                    self.log.info("********* Passed ********")

        if "Fail" not in lst_status:
            self.log.info("Login DDT Test Passed")
            self.driver.close()
            assert True
        else:
            self.log.info("*********** Login DDT Test Failed ***********")
            self.driver.close()
            assert False

        self.log.info("*********** End of DDT Test ************")
        self.log.info("*********** Test_002_DDT_Login Completed ************")
Esempio n. 13
0
class Test_001_Login:

    baseURL = ReadConfig.getApplicationURL()
    username = ReadConfig.getUseremail()
    password = ReadConfig.getPassword()

    logger = LogGen.loggen()

    @pytest.mark.regression
    def test_homePageTitle(self, setup):
        self.logger.info("******Test_001_Login********")
        self.logger.info("******Verifying Home Page Title*******")
        self.driver = setup
        self.driver.get(self.baseURL)
        act_title = self.driver.title

        if act_title == "Your store. Login":
            assert True
            self.driver.close()
            self.logger.info("*****Home page Title Passed ***")
        else:
            self.driver.save_screenshot(".\\Screenshots\\" +
                                        "test_homePageTitle.png")
            self.driver.close()
            self.logger.error("*****Home page Title Failed ***")
            assert False

    @pytest.mark.sanity
    @pytest.mark.regression
    def test_login(self, setup):
        self.driver = setup
        self.logger.info("******Verifyinng Login Test ***")
        self.driver.get(self.baseURL)
        self.lp = LoginPage(self.driver)
        self.lp.setUserName(self.username)
        #time.sleep(5)
        self.lp.setPassword(self.password)
        #time.sleep(5)
        self.lp.clickLogin()
        act_title = self.driver.title

        if act_title == "Dashboard / nopCommerce administration":
            assert True
            self.logger.info("*****Login Test is  Passed ***")
            self.driver.close()
        else:
            self.driver.save_screenshot(".\\Screenshots\\" + "test_login.png")
            self.logger.warning("*****Home page Title Failed ***")
            self.driver.close()
            assert False
class Test_003_AddCustomer:
    baseURL = ReadConfig.getApplicationURL()
    username = ReadConfig.getUseremail()
    password = ReadConfig.getPassword()

    logger = LogGen.loggen()

    def test_001_addcustomer(self, setup):
        self.logger.info("********* TestAdd new customer *******")
        self.logger.info("********* Verifying The Test Cases *******")
        self.driver = setup
        self.driver.get(self.baseURL)
        self.driver.maximize_window()
        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 Successfull ********")

        self.logger.info(" ***** Starting Adding Customer ****** ")
        self.email = random_generator() + "@gmail.com"
        self.addcust = AddCustomer(self.driver)
        self.addcust.ClickonCustomerMenu()
        self.addcust.ClickonCustomerSubmenu()
        self.addcust.ClickaddNew()
        self.addcust.addemail(self.email)
        self.addcust.addFirstName("ANWAR")
        self.addcust.addLastName("SHAIKH")
        self.addcust.setgender("Male")
        self.addcust.addDob("08/03/1991")
        self.addcust.provideCompany("Nuance Communication India Pune")
        self.addcust.addadmincontent("This is Testing ")
        self.addcust.Savetheform()
        self.logger.info(" Customer all information added")

        self.msg = self.driver.find_element_by_tag_name("body").text
        print(self.msg)
        if 'Customer has been added sucessfully.' in self.msg:
            assert True == True
            self.logger.info("******* Add Customer Test Case Passed ******")
        else:
            self.driver.save_screenshot(".\\Screenshots\\" + "AddCustomer.png")
            self.logger.error("****** Add Customer Test Case Failed ******* ")
            assert False == False

        self.driver.close()
        self.logger.info("***** Test has been Ended *****")
class Test_001_Login():

    baseUrl = ReadConfig.get_application_URL()
    username = ReadConfig.get_username()
    password = ReadConfig.get_password()
    logger = LogGen.log_gen()

    @pytest.mark.sanity
    @pytest.mark.regression
    def test_HomePageTitle(self,setup):
        print(self.logger,'&&&&&&&')
        self.logger.info("**********Test_001_Login**********")
        self.logger.info("*************Verifying Home Page Title***************")
        self.driver = setup
        self.driver.get(self.baseUrl)
        act_title = self.driver.title
        if act_title == "Your store. Login":
            self.driver.close()
            self.logger.info("******Home page title test is passed*********")
            assert True
        else:
            self.driver.save_screenshot("./Screenshots/"+"test_HomePageTitle.png")
            self.driver.close()
            self.logger.error("******Home page title test is Failed*********")
            assert False

    @pytest.mark.sanity
    @pytest.mark.regression
    def test_login(self,setup):
        self.logger.info("**********test_login*********")
        self.logger.info("**********Verifying the 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()
        act_title= self.driver.title
        if act_title == "Dashboard / nopCommerce administration":
            self.driver.close()
            self.logger.info("**********Login is succusfull- passed*********")
            assert True
        else:
            self.driver.save_screenshot("./Screenshots/" + "test_login.png")
            self.driver.close()
            self.logger.error("**********Login is not succusful-Failed *********")
            assert False
class Test_001_Login:
    baseURL = "http://admin-demo.nopcommerce.com"
    username = "******"
    password = "******"
    logger = LogGen.loggen()

    def test_homePageTitle(self, setup):
        self.logger.info("*************** Test_001_Login *****************")
        self.logger.info("****Started Home page title test ****")
        self.driver = setup
        self.logger.info("****Opening URL****")
        self.driver.get(self.baseURL)
        act_title = self.driver.title
        if act_title == 'Your store. Login111':
            self.logger.info("**** Home page title test passed ****")
            self.driver.close()
            assert True
        else:
            self.logger.error("**** Home page title test failed****")
            self.driver.save_screenshot(".\\Screenshots\\" +
                                        "test_homePageTitle.png")
            self.driver.close()
            assert False

    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.setUserName(self.username)
        self.lp.setPassword(self.password)
        self.lp.clickLogin()
        act_title = self.driver.title
        if act_title == "Dashboard / nopCommerce administration234":
            self.logger.info("****Login test passed ****")
            self.driver.close()
            assert True

        else:
            self.driver.save_screenshot(".\\Screenshots\\" +
                                        "test_homePageTitle.png")
            self.logger.error("****Login test failed ****")
            self.driver.close()
            assert False
class Test_SearchCustomerByName_T005():

    baseUrl = ReadConfig.get_application_URL()
    username = ReadConfig.get_username()
    password = ReadConfig.get_password()
    logger = LogGen.log_gen()

    @pytest.mark.regression
    def test_search_by_email(self, setup):
        self.logger.info("**********Test_SearchCustomerByName_T005*********")
        self.logger.info("**********Verifying the Login*********")
        self.driver = setup
        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 is successful*********")
        self.logger.info(
            "********Starting Search customer by Name *************")

        self.addcust = AddCustomer(self.driver)
        self.addcust.click_customer_menu()
        time.sleep(2)
        self.addcust.click_customer_menu_item()

        self.logger.info("****** Entering the First Name **************")
        self.searchCust = SearchCustomer(self.driver)
        self.searchCust.set_firstName("Arthur")
        self.searchCust.set_lastName("Holmes")
        self.searchCust.click_search()
        time.sleep(3)
        status = self.searchCust.search_customer_by_name("Arthur Holmes")
        assert True == status
        self.logger.info(
            "******** Test_SearchCustomerByName_T005 Finished *********")
        self.driver.close()
Esempio n. 18
0
class Test_001_Login:
    URL = ReadConfig.getApplicationurl()
    username = ReadConfig.getUsername()
    password = ReadConfig.getPassword()
    path = ReadConfig.getPath()

    logger = logGen.loggen()

   # def test_HomaPageTitle(self,setup):
    #    self.logger.info("****************   Test_001_Login   *********************")
    #    self.logger.info("****************   test_HomePageTitle   *********************")
     #   self.driver = setup
     #   self.driver.get(self.URL)
     #   act_title = self.driver.title
     #   self.driver.close()
    #    if act_title == "Jobseeker's Login: Search the Best Jobs available in India & Abroad - Naukri.com":
      #      assert True
    #        self.logger.info("****************   test_HomePageTitle is passed   *********************")
      #  else:
    #        self.logger.info("****************   test_HomePageTitle is failed  *********************")
    #        assert False

    @pytest.mark.regression
    def test_Login(self,setup):
        self.logger.info("****************   test_Login   *********************")
        self.driver = setup
        self.driver.get(self.URL)
        self.driver.implicitly_wait(5)
        self.lp = LoginPage(self.driver)
        self.lp.setUserName(self.username)
        self.lp.setPassword(self.password)
        self.lp.clickLogin()
        time.sleep(5)
        self.lp.clickupdateProfile()
        time.sleep(5)
        self.lp.UpdateResume(self.path)
        webdriver.ActionChains(self.driver).send_keys(Keys.ENTER).perform()
        time.sleep(5)
        self.driver.save_screenshot("C:\\Users\\Suresh\\PycharmProjects\\001\\Screenshots\\ResumeUpdated.png")
        self.driver.close()
Esempio n. 19
0
class Test_SearchCustomerByEmail_T004():

    baseUrl = ReadConfig.get_application_URL()
    username = ReadConfig.get_username()
    password = ReadConfig.get_password()
    logger = LogGen.log_gen()

    @pytest.mark.sanity
    def test_search_by_email(self,setup):
        self.logger.info("**********Test_SearchCustomerByEmail_T004*********")
        self.logger.info("**********Verifying the Login*********")
        self.driver = setup
        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 is successful*********")
        self.logger.info("********Starting Search customer by email *************")

        self.addcust = AddCustomer(self.driver)
        self.addcust.click_customer_menu()
        time.sleep(2)
        self.addcust.click_customer_menu_item()

        self.logger.info("****** Entering the email id **************")
        self.searchCust = SearchCustomer(self.driver)
        self.searchCust.set_Email("*****@*****.**")
        self.searchCust.click_search()
        time.sleep(3)
        status = self.searchCust.search_customer_by_email("*****@*****.**")
        assert True == status
        self.logger.info("******** Test_SearchCustomerByEmail_T004 Finished *********")
        self.driver.close()
Esempio n. 20
0
class Test_100_Login:
    baseUrl = "https://frontend.nopcommerce.com/"
    username = "******"
    password = "******"

    def test_homePageTitle(self, setup):
        self.driver = setup
        self.driver.get(self.baseUrl)
        act_title = self.driver.title
        if act_title == "nopCommerce demo store":
            assert True
        else:
            assert False
        self.driver.close()

    def test_login(self, setup):
        self.driver = setup
        self.driver.get(self.baseUrl)
        self.lp = LoginPage(self.driver)
        self.lp.clickOnLoginLink()
        self.lp.setUserName(self.username)
        self.lp.setPassword(self.password)
        self.lp.clickOnLogin()
        self.driver.close()
class Test_SearchCustomerByName_005:
    baseURL = ReadConfig.getApplicationURL()
    username = ReadConfig.getUseremail()
    password = ReadConfig.getpassword()
    logger = LogGen.loggen()  # Logger

    @pytest.mark.regression
    def test_searchCustomerByName(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.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  *********** ")
class Test_003_AddCustomer():

    baseUrl = ReadConfig.get_application_URL()
    username = ReadConfig.get_username()
    password = ReadConfig.get_password()
    logger = LogGen.log_gen()


    @pytest.mark.regression
    def test_addCustomer(self,setup):
        self.logger.info("**********Test_003_addCustomer*********")
        self.logger.info("**********Creating the customer and verifying it*********")
        self.driver = setup
        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 Succussfull**********")

        self.logger.info("****** Starting Adding new customer*********")

        self.addcust = AddCustomer(self.driver)
        self.addcust.click_customer_menu()
        time.sleep(2)
        self.addcust.click_customer_menu_item()
        self.addcust.click_on_addNew()

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

        self.email = random_generator() + '@gmail.com'
        self.addcust.set_Email(self.email)
        self.addcust.set_Password("test1234")
        self.addcust.set_First_name("Manjunatha")
        self.addcust.set_LastName("Charu")
        self.addcust.set_Gender("male")
        self.addcust.set_dob("01/01/1989")
        self.addcust.set_company_name("IBS")
        self.addcust.set_customer_roles("Vendors")
        self.addcust.set_mgrOfVendor("Vendor 2")
        self.addcust.set_AdminContent("This is for testing...........")
        time.sleep(2)
        self.addcust.click_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 == True
            self.logger.info("******* Add customer Test Passed *********")
        else:
            self.driver.save_screenshot("./Screenshots/"+"test_addCustomer_scr.png")
            self.logger.error("********* Add customer Test Failed *******")
            assert True == False


        self.driver.close()
        self.logger.info("************** Ending Adding customers succusfull Test ********")
Esempio n. 23
0
class Test_002_DDT_Login():

    baseURL = ReadConfig.getApplicationURL()
    path = ".//TestData/LoginData.xlsx"
    #username = ReadConfig.getUseremail() - field is not required since data is provided by excel
    #password = ReadConfig.getpassword() - field is not required since data is provided by excel
    logger = LogGen.loggen()

    @pytest.mark.regression
    def test_login_ddt(self, setup):

        self.logger.info("****Test_002_DDT_Login*****")
        self.driver = setup
        #Launching application
        self.driver.get(self.baseURL)
        #creating an object:
        self.lp = LoginPage(self.driver)

        self.rows = XLUtils.getRowCount(self.path,
                                        'Sheet1')  #returns number of rows
        print("Number of rows in Excel:", self.rows)

        lst_status = []

        for r in range(2, self.rows + 1):
            self.user = 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.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("Testcase passed")
                    time.sleep(5)
                    self.lp.clickLogout()
                    lst_status.append("Pass")

            if act_title == exp_title:
                if self.exp == "Fail":
                    self.logger.info("Testcase failed")
                    time.sleep(5)
                    self.lp.clickLogout()
                    lst_status.append("Fail")

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

                elif self.exp == "Fail":
                    self.logger.info("Testcase 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 Test_002_DDT_Login*****")
        self.logger.info("****Completed Test_002_DDT_Login*****")
Esempio n. 24
0
class Test_002_DDT_Login:

    baseURL = ReadConfig.getApplicationURL()
    path = ".//TestData/LoginData.xlsx"

    logger = LogGen.loggen()

    @pytest.mark.regression
    def test_login(self, setup):
        self.logger.info("**** Test_002-DDT_Login ****")
        self.logger.info("******Verifyinng Login Test ***")
        self.driver = setup
        self.driver.get(self.baseURL)

        self.lp = LoginPage(self.driver)

        self.rows = XLutils.getRowCount(self.path, 'Sheet1')
        print("Number of rows", self.rows)

        lst_status = []

        for r in range(2, self.rows + 1):
            self.user = 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.user)
            self.lp.setPassword(self.password)
            self.lp.clickLogin()
            time.sleep(5)

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

            time.sleep(5)
            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 TC_loginDDT_002 ****** ")
Esempio n. 25
0
class Test_004_SearchCustmer:
    baseURL = ReadConfig.getApplicationURL()
    username = ReadConfig.getUseremail()
    password = ReadConfig.getPassword()
    logger = LogGen.loggen()

    @pytest.mark.skip
    def test_001_searchcustomer(self,setup):
        self.logger.info("********* Test Search Customer *******")
        self.logger.info("********* Verifying The Test Cases *******")
        self.driver = setup
        self.driver.get(self.baseURL)
        self.driver.maximize_window()
        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 Successfull ********")

        self.logger.info(" ***** Starting Search Customer Test Case ****** ")
        self.addcust=AddCustomer(self.driver)
        self.addcust.ClickonCustomerMenu()
        self.addcust.ClickonCustomerSubmenu()

        ser=SearchCust(self.driver)
        ser.searbyemail("*****@*****.**")
        ser.Clicktosearch()
        time.sleep(5)
        status= ser.searchCustomerbyemail("*****@*****.**")
        assert True==status
        self.logger.info("***** Test has been Ended *****")
        self.driver.close()

    def test_001_nmesearchcustomer(self,setup):
        self.logger.info("********* Test Search Customer *******")
        self.logger.info("********* Verifying The Test Cases *******")
        self.driver = setup
        self.driver.get(self.baseURL)
        self.driver.maximize_window()
        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 Successfull ********")

        self.logger.info(" ***** Starting Search Customer Test Case ****** ")
        self.addcust = AddCustomer(self.driver)
        self.addcust.ClickonCustomerMenu()
        self.addcust.ClickonCustomerSubmenu()

        ser = SearchCust(self.driver)
        ser.searbylastname("Terces")
        ser.searbyfirstname("victoria")
        ser.Clicktosearch()
        time.sleep(5)
        status = ser.searchCustomerbyname("Victoria Terces")
        assert True == status
        self.logger.info("***** Test has been Ended *****")
        self.driver.close()