Exemple #1
0
class Test_002_login:
    baseURL = readConfig.getApplicationURL()
    # username = readConfig.getUserName()
    # password = readConfig.getPassword()
    logger = logGen.loggen()

    @pytest.mark.sanity
    def test_loginPage(self, setup):
        self.logger.info("**************** Verifying login test *********")
        self.driver = setup
        self.driver.get(self.baseURL)
        lp = login(self.driver)
        path = ".//TestData/My_data.xlsx"
        rows = XLUtils.getRowCount(path, "Sheet1")
        for r in range(2, rows+1):
            self.username = XLUtils.readData(path, "Sheet1", r, 1)
            self.password = XLUtils.readData(path,"Sheet1", r, 2)
            self.exp = XLUtils.readData(path,"Sheet1", r, 3)
            lst_status = []
            lp.setUserName(self.username)
            lp.setPassword(self.password)
            lp.click_login()
            act_title = self.driver.title
            if act_title == "Dashboard / nopCommerce administration":
                if self.exp == "Pass":
                    self.logger.info("**************** login test passed *********")
                    lp.click_logout()
                    lst_status.append("Pass")
                elif self.exp=="Fail":

                    self.logger.error("**************** login test user2 failed *********")
                    lst_status.append("Fail")


            elif act_title != "Dashboard / nopCommerce administration":
                if self.exp == "Pass":
                    self.logger.info("**************** login user 3 failed test test passed *********")


                    lst_status.append("Fail")
                elif self.exp=="Fail":

                    self.logger.error("**************** login user 4 failed test pass *********")
                    lst_status.append("Pass")


        if "Pass" not in lst_status:
            self.logger.error("************* login test ddt is passed ***************")
            self.driver.close()
            assert True

        else:
            self.logger.error("************* login test ddt is failed ***************")
            self.driver.close()
            assert False

        self.logger.error("************* login test ddt passes ***************")
        self.logger.error("************* completed TC_002 ***************")
Exemple #2
0
class Test_003_AddCustomer:
    baseURL = readConfig.getApplicationURL()
    username = readConfig.getUserName()
    password = readConfig.getPassword()
    logger = logGen.loggen()

    @pytest.mark.sanity
    @pytest.mark.vikas
    def test_addCustomer(self, setup):
        self.logger.info("*************** Test_003 Strted ***********")
        self.driver = setup
        self.driver.get(self.baseURL)
        self.driver.maximize_window()

        self.lp = login(self.driver)
        self.lp.setUserName(self.username)
        self.lp.setPassword(self.password)
        self.lp.click_login()
        self.logger.info("************ Login Succesful **************")

        self.logger.info("************ Add customer start **************")
        self.addcust = AddCustomers(self.driver)
        self.addcust.clickonCustomersMenu()
        self.addcust.clickonCustomersMenuItem()

        self.addcust.clickOnAddnew()
        self.logger.info(
            "***************** Providing cust info***************")

        self.email = random_generator() + "@gmail.com"
        self.addcust.setEmail(self.email)
        self.addcust.setPassword("test123")
        self.addcust.setFirstName("Vikas")
        self.addcust.setLastName("Desadi")
        self.addcust.setGender("Male")
        self.addcust.setDob("03/29/1990")  #M/D/YYYY
        self.addcust.setCompanyName("Coolsoft")
        self.addcust.setCustomerRoles("Registered")
        self.addcust.setMnagerOfVendor("Vendor 2")
        self.addcust.setAdmonComment("This is for testing")
        self.addcust.clickonSave()

        self.logger.info("************ Saving the info *************")
        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 cusomer Passed *********")

        else:
            self.driver.save_screenshot(".//Sceeenshots//" +
                                        "test_addcustomer_src.png")
            self.logger.info("********** Add cusomer failed *********")
            assert True == False
Exemple #3
0
class Test_001:
    Url = ReadConfig.getApplicationURL()
    username = ReadConfig.getUserename()
    Password = ReadConfig.getPassword()

    logger = logGen.loggen()

    def test_HomepageTitle(self, setup):

        self.logger.info("*******Test_001************")
        self.logger.info("**********verify HomepageTitle started*********")
        self.driver = setup
        self.driver.get(self.Url)
        self.driver.maximize_window()
        act_title = self.driver.title

        if act_title == "Your store. Login":
            self.driver.close()
            assert True
            self.logger.info("**********verified HomepageTitle*********")
        else:
            self.driver.save_screenshot(".\\Screenshots\\" +
                                        "test_HomepageTitle.png")
            self.driver.close()
            self.logger.error("********** HomepageTitle failed*********")
            assert False

    def test_login(self, setup):

        self.logger.info("*******Test_001************")
        self.logger.info("**********verify test_login started*********")
        self.driver = setup
        self.driver.get(self.Url)
        self.driver.maximize_window()

        self.dl = Login(self.driver)
        self.dl.setUserName(self.username)
        self.dl.setPassword(self.Password)
        self.dl.clickLogin()
        act_title = self.driver.title

        if act_title == "Dashboard / nopCommerce administration":
            self.dl.clickLogout()
            self.driver.close()
            assert True
            self.logger.info("**********verified loggedin*********")
        else:
            self.driver.save_screenshot(".\\Screenshots\\" + "test_login.png")
            self.dl.clickLogout()
            self.driver.close()
            self.logger.error("**********failed loggedin*********")
            assert False
class Test_001_login:
    baseURL = readConfig.getApplicationURL()
    username = readConfig.getUserName()
    password = readConfig.getPassword()
    logger = logGen.loggen()

    @pytest.mark.sanity
    @pytest.mark.vikas
    @pytest.mark.regression
    def test_homepageTitle(self, setup):
        self.logger.info("**************** Test_001_login*********")
        self.logger.info("**************** verifying homepage 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("**************** homepage title passed *********")

        else:
            self.driver.save_screenshot(".//Sceeenshots"+"login_error.png")
            self.driver.close()
            self.logger.error("**************** homepage title failed *********")
            assert False

    @pytest.mark.sanity
    @pytest.mark.vikas
    def test_loginPage(self, setup):
        self.logger.info("**************** Verifying login test *********")
        self.driver = setup
        self.driver.get(self.baseURL)
        lp = login(self.driver)
        lp.setUserName(self.username)
        lp.setPassword(self.password)
        lp.click_login()
        act_title = self.driver.title
        if act_title == "Dashboard / nopCommerce administration":
            self.logger.info("**************** login test passed *********")
            assert True
            self.driver.close()
        else:
            self.driver.close()
            self.logger.error("**************** login test failed *********")
            assert False
Exemple #5
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()
class Test_003_Addcustomer:
    Url = ReadConfig.getApplicationURL()
    username = ReadConfig.getUserename()
    Password = ReadConfig.getPassword()

    logger = logGen.loggen()

    def test_addcustomer(self, setup):

        self.logger.info("*******Test_003************")
        self.driver = setup
        self.driver.get(self.Url)
        self.driver.maximize_window()

        self.dl = Login(self.driver)
        self.dl.setUserName(self.username)
        self.dl.setPassword(self.Password)
        self.dl.clickLogin()
        self.logger.info("*******Login succesfull************")
        self.logger.info("**********started adding  customer info*********")
        self.addcustomer = AddCustomer(self.driver)
        self.addcustomer.clickonCustomersMenu()
        self.addcustomer.clickonCustomersMenuItem()

        self.searchcust = searchCustomer(self.driver)
        self.searchcust.setEmail("*****@*****.**")
        self.searchcust.clickOnBtnSearch()

        time.sleep(5)
        status = self.searchcust.searchCustomerByEmail(
            "*****@*****.**")
        assert True == status

        time.sleep(5)

        self.driver.close()
Exemple #7
0
class Test_003_Addcustomer:
    Url = ReadConfig.getApplicationURL()
    username = ReadConfig.getUserename()
    Password = ReadConfig.getPassword()

    logger = logGen.loggen()

    def test_addcustomer(self, setup):

        self.logger.info("*******Test_003************")
        self.driver = setup
        self.driver.get(self.Url)
        self.driver.maximize_window()

        self.dl = Login(self.driver)
        self.dl.setUserName(self.username)
        self.dl.setPassword(self.Password)
        self.dl.clickLogin()
        self.logger.info("*******Login succesfull************")

        self.logger.info("**********started adding  customer info*********")
        self.addcustomer = AddCustomer(self.driver)
        self.addcustomer.clickonCustomersMenu()
        self.addcustomer.clickonCustomersMenuItem()
        time.sleep(5)
        self.addcustomer.clickonAddnewBtn()
        time.sleep(5)
        self.logger.info("**********providing customer info*********")
        self.email = random_generator() + "@gmail.com"
        self.addcustomer.setEmail(self.email)
        self.addcustomer.setPassword("savitha")
        self.addcustomer.setFirstName("savitha")
        self.addcustomer.setLastName("Thippur")
        self.addcustomer.setGender("Female")
        self.addcustomer.setDob("04/05/2009")
        self.addcustomer.setCompanyname("info")
        self.addcustomer.setCustomerrole("Forum Moderators")
        self.addcustomer.setManagerOfVendor("Not a vendor")
        self.addcustomer.setAdminContent("This is addcustomer testing")
        self.logger.info("**********Ended customer info*********")

        self.addcustomer.clickOnSave()
        self.logger.info("**********Save customer info*********")

        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")
            self.logger.error(
                "********* Add customer Test Failed ************")
            assert False

        self.logger.error(
            "********* Add customer validation tested************")

        time.sleep(5)
        self.driver.close()