示例#1
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 **********")
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  *********** ")
示例#3
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()
class TestLoginPage:

    baseURL = Configs.getURL()
    username = Configs.getUseremail()
    password = Configs.getPassword()
    logs = Loggs.loggen()
    browsers = Browser.browsers

    def test_homePageTitle_001(self, browsers):
        self.driver = browsers
        self.login = LoginPage(browsers)
        self.logs.info(
            "*************** Test_homePageTitle_001 *****************")
        self.logs.info("****Started Home page title test ****")
        self.driver.maximize_window()
        self.driver.get(self.baseURL)
        act_page_title = self.driver.title
        if act_page_title == "Your store. Login":
            self.logs.info("***** Home Page Title Test Passed *****")
            assert True
        else:
            self.driver.error("***** Home Page Title Page Test Failed *****")
            self.driver.save_screenshot("..\\Screenshots\\" +
                                        "test_homepagetitle.png")
            assert False
        self.logs.info("************* Login Successful *************")
        self.logs.info("********** Test Home Page Title **********")
        time.sleep(4)
        self.logs.info("***** Home Page Title Test Successful *****")

    def test_homePageLogin_002(self, browsers):
        self.driver = browsers
        self.login = LoginPage(browsers)
        self.logs.info(
            "*************** Test_homePageLogin_002 *****************")
        self.logs.info("****Started Home page title test ****")
        self.driver.maximize_window()
        self.driver.get(self.baseURL)
        self.login.setUsername(self.username)
        self.login.setPassword(self.password)
        self.login.clickLogin()
        self.logs.info("************* Login Successful *************")
        self.logs.info("********** Test Home Page Title **********")
        time.sleep(4)
        act_page_title = self.driver.title
        if act_page_title == "Dashboard / nopCommerce administration":
            self.logs.info(
                "***** Dashboard Page Title Test Passed -- Your on the Dashboard *****"
            )
            assert True
        else:
            self.driver.error("***** Home Page Title Page Test Failed *****")
            self.driver.save_screenshot("..\\Screenshots\\" +
                                        "test_dashboardpagetitle.png")
            assert False
        #assert "Dashboard / nopCommerce administration" in act_page_title
        time.sleep(4)
        self.login.clickLogout()
        self.logs.info("************* Login Test Successful *************")
示例#5
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-------")
示例#6
0
 def test_Login(self):
     lp=LoginPage(self.driver)
     lp.setUserEmail(self.email)
     lp.setPassword(self.password)
     lp.clickSignin()
     time.sleep(3)
     self.driver.save_screenshot("C:..\\Screenshots\\homepage.png")
     self.assertEqual("DigiCollect CRM", self.driver.title, "web page title is not matching")
 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")
示例#8
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_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 **********")
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**********")
 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 ")
示例#12
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")
示例#14
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 ************")
示例#15
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
示例#16
0
class Test_001_Login:
    baseurl=ReadConfig.getApplicationURL()
    username=ReadConfig.getuseremailL()
    password=ReadConfig.getuserpassword()

    logger=logGen.log_gen()

    @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 test is passed*******")
        else:
            self.driver.save_screenshot(".\\Screenshots\\"+"test_homepageTitle1.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("*********Verifying test_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':
            assert True
            self.logger.info("******Login  test is passed*******")
            self.driver.close()
        else:
            self.driver.save_screenshot(".\\Screenshots\\" + "test_Login1.png")
            self.driver.close()
            self.logger.error("******Login  title test is failed*******")
            assert False
            self.driver.close()
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
    def test_login_with_invalid_user_credentials(self, invalid_login_Data):
        log = self.get_Logger("../Logs/loginUser.log")
        log.info("Navigated to the Base URL:" + self.driver.current_url)

        login = LoginPage(self.driver)
        login.setEmail(invalid_login_Data["email"])
        log.info("user has entered email: " + invalid_login_Data["email"])

        login.setPassword(invalid_login_Data["password"])
        log.info("user has entered password: "******"password"])

        login.click_on_submit()
        log.info("User Clicks On Submit Button")

        error_msg = login.get_Error_Message()
        assert "Login was unsuccessful" in error_msg
        log.info("Login was Unsuccessful")
        log.info("*************Test Case Passed**************")
    def test_login_with_valid_user_credentials(self, valid_login_Data):
        global login
        global log
        log = self.get_Logger("../Logs/loginUser.log")
        log.info("Navigated to the Base URL:" + self.driver.current_url)
        login = LoginPage(self.driver)
        login.setEmail(valid_login_Data["email"])
        log.info("user has entered email: " + valid_login_Data["email"])

        login.setPassword(valid_login_Data["password"])
        log.info("user has entered password: "******"password"])

        login.click_on_submit()
        log.info("User Clicks On Submit Button")
        dashboard_url = "https://admin-demo.nopcommerce.com/admin/"

        assert dashboard_url == self.driver.current_url
        log.info("*************Login ! Successful**************")
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
示例#22
0
class Test_searchcustomerbyEmail__004:
    baseurl = ReadConfig.getApplicationURL()
    username = ReadConfig.getuseremailL()
    password = ReadConfig.getuserpassword()
    logger = logGen.log_gen()

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

        self.logger.info("****Test_004_SearchcustomerbyEmail****")
        self.driver = setup
        self.driver.get(self.baseurl)
        self.driver.maximize_window()
        self.driver.implicitly_wait(10)

        self.lp = LoginPage(self.driver)
        self.lp.setUsername(self.username)
        self.lp.setPassword(self.password)
        self.lp.clicklogin()

        self.logger.info("******Staring Search customer by Email")

        self.Add_cust = Add_customer(self.driver)
        self.Add_cust.clickcustomermenu()
        self.Add_cust.clickcustomermenuItem()

        self.logger.info("******Starting Search customer by Email")

        searchcust = Searchcustomer(self.driver)
        searchcust.setEmail("*****@*****.**")
        searchcust.clicksearch()
        time.sleep(5)
        status = searchcust.searchCustomerByEmail("*****@*****.**")

        assert True == status

        self.logger.info(
            "******Starting Search customer by Email Test case is finished")

        time.sleep(5)

        self.driver.close()
示例#23
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()
示例#24
0
class Test_searchcustomerbyName__005:
    baseurl = ReadConfig.getApplicationURL()
    username = ReadConfig.getuseremailL()
    password = ReadConfig.getuserpassword()
    logger = logGen.log_gen()

    @pytest.mark.regression
    def test_searchCustomerbyName(self, setup):
        self.logger.info("****Test_005_SearchcustomerbyName****")
        self.driver = setup
        self.driver.get(self.baseurl)
        self.driver.maximize_window()
        self.driver.implicitly_wait(10)

        self.lp = LoginPage(self.driver)
        self.lp.setUsername(self.username)
        self.lp.setPassword(self.password)
        self.lp.clicklogin()

        self.logger.info("******Staring Search customer by Name")

        self.Add_cust = Add_customer(self.driver)
        self.Add_cust.clickcustomermenu()
        self.Add_cust.clickcustomermenuItem()

        self.logger.info("******Starting Search customer by Name")

        searchcust = Searchcustomer(self.driver)
        searchcust.setFirstname("Victoria")
        searchcust.setLastname("Terces")
        searchcust.clicksearch()
        time.sleep(5)
        status = searchcust.searchCustomerByName("Victoria Terces")

        assert True == status

        self.logger.info(
            "******Starting Search customer by Name Test case is finished")

        self.driver.close()
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()
class TestAddCustomPage:

    baseURL = Configs.getURL()
    username = Configs.getUseremail()
    password = Configs.getPassword()
    logs = Loggs.loggen()
    browsers = Browser.browsers
    header_title_xpath = "//h1[@class='pull-left']"
    btnSuccessMessage_xpath = "//div[@class='alert alert-success alert-dismissable']"

    def test_addcustomer_003(self, browsers):
        self.driver = browsers
        self.driver.get(self.baseURL)
        self.login = LoginPage(browsers)
        self.logs.info("*****Starting Test Add New Customer 003 *****")
        self.logs.info("**** Login Into Home Page ****")
        self.login.setUsername(self.username)
        self.login.setPassword(self.password)
        self.login.clickLogin()
        self.logs.info("**** Go To Add New Page ****")
        time.sleep(5)
        self.addnew = AddCustomerPage(browsers)
        self.addnew.clickCustomerMenu()
        self.addnew.clickCustomerMenuItem()
        self.addnew.clickAddNew()
        time.sleep(3)
        self.email = random_generator() + "@gmail.com"
        self.addnew.setEmail(self.email)
        self.addnew.setPassword("test123")
        self.addnew.setFirstName("George")
        self.addnew.setLasttName("Robert")
        self.addnew.setGender("Male")
        self.addnew.setDob("12/10/2020")
        self.addnew.setCompanyName("George Farms")
        time.sleep(5)
        self.addnew.setCompanyRole("Administrators")
        self.addnew.setManagerOfVendor("Vendor 1")
        self.addnew.setAdminComment("Testing Add New Customer Page...")
        self.addnew.clickSave()
示例#27
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()
示例#28
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 ********")