Exemplo n.º 1
0
class Test_searchCustBY_Fname:


    baseURL = Readconfig.getAppURL()
    username = Readconfig.getUseName()
    password = Readconfig.getPassWord()
    logger_object = LoG.log_gen()

    def test_searchCustby_Fname(self,setup):

        self.logger_object.info("***search customer by_first Name")
        self.driver =setup
        self.driver.get(self.baseURL)
        self.logger_object.info("******Login the application****")
        self.LP =Loginpage(self.driver)
        self.LP.setUserName(self.username)
        self.LP.setPassword(self.password)
        self.LP.clickLogin()
        time.sleep(3)
        self.addCust =addCustomer(self.driver)
        self.addCust.clickOnCustomerMenu()
        self.addCust.clickOnCustomerSubMenu()
        self.SFN=search_customer(self.driver)
        self.SFN.setFname("James")
        self.SFN.setLName("Pan")
        self.SFN.clickSearch()
        time.sleep(10)
        status = self.SFN.searchCustbyname("James Pan")
        time.sleep(5)
        assert True ==status
        self.logger_object.info("****search customer by fname test caseis passed***")
class Test_searchCustBY_email:

    baseURL = Readconfig.getAppURL()
    username = Readconfig.getUseName()
    password = Readconfig.getPassWord()
    logger_object = LoG.log_gen()

    @pytest.mark.Regression
    def test_searchCustby_Email(self, setup):

        self.logger_object.info("***search customer by_email")
        self.driver = setup
        self.driver.get(self.baseURL)
        self.logger_object.info("******Login the application****")
        self.LP = Loginpage(self.driver)
        self.LP.setUserName(self.username)
        self.LP.setPassword(self.password)
        self.LP.clickLogin()
        time.sleep(3)
        self.addCust = addCustomer(self.driver)
        self.addCust.clickOnCustomerMenu()
        self.addCust.clickOnCustomerSubMenu()
        self.SEmail = search_customer(self.driver)
        self.SEmail.setEmail("*****@*****.**")
        self.SEmail.clickSearch()
        time.sleep(10)
        status = self.SEmail.searchCustbyEmail(
            "*****@*****.**")
        time.sleep(5)
        self.driver.implicitly_wait(5)
        assert True == status
        self.logger_object.info("****search customer test caseis passed***")
        self.driver.close()
Exemplo n.º 3
0
class Test_ExportExcel_006:
    baseUrl = Readconfig.getApplicationURL()
    Username = Readconfig.getUserName()
    password = Readconfig.getPassword()
    logger = LogGen.loggen()

    @pytest.mark.sanity
    def test_ExportExcel(self,setup):
        self.logger.info("************Test_006_Login*******************")
        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 succesfully*****************")

        self.Addcust = AddCustomer(self.driver)
        self.Addcust.clickOnCustomerMenu()
        self.Addcust.clickOnCustomerMenu_item()

        self.logger.info("**************Test_Export the file to excel*****************")
        self.excelEx=ExportFile(self.driver)
        self.excelEx.excelPathDownload()
        self.excelEx.exportExcel()
Exemplo n.º 4
0
class Test_SearchCustomerByEmail_004:
    baseUrl = Readconfig.getApplicationURL()
    Username = Readconfig.getUserName()
    password = Readconfig.getPassword()
    logger = LogGen.loggen()

    def test_SearchCustomerbyEmail(self,setup):
        self.logger.info("************Test_004_Login*******************")
        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 succesfully*****************")

        self.Addcust = AddCustomer(self.driver)
        self.Addcust.clickOnCustomerMenu()
        self.Addcust.clickOnCustomerMenu_item()

        self.logger.info("********searching for customer by emailId***************")
        searchcust=SearchCustomer(self.driver)
        searchcust.setEmail("*****@*****.**")
        searchcust.clickSearch()
        #time.sleep(5)
        status=searchcust.searchCustomerByEmail("*****@*****.**")
        assert True==status
        self.logger.info("********Tc_ searchCustomerByemailId_004 passed***************")
class Test_SearchCustomerByName_005:
    baseUrl = Readconfig.getApplicationURL()
    Username = Readconfig.getUserName()
    password = Readconfig.getPassword()
    logger = LogGen.loggen()

    def test_SearchCustomerbyName(self, setup):
        self.logger.info("************Test_004_Login*******************")
        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 succesfully*****************")

        self.Addcust = AddCustomer(self.driver)
        self.Addcust.clickOnCustomerMenu()
        self.Addcust.clickOnCustomerMenu_item()

        self.logger.info(
            "********searching for customer by Name***************")
        searchcust = SearchCustomer(self.driver)
        searchcust.setFirstName("John")
        searchcust.setLastName("Smith")
        searchcust.clickSearch()

        status = searchcust.searchCustomerByName("John Smith")
        assert True == status
        self.logger.info(
            "********Tc_ searchCustomerByName_005 passed***************")
Exemplo n.º 6
0
class Test_003_addCustomer:
    baseURL = Readconfig.getAppURL()
    username = Readconfig.getUseName()
    password = Readconfig.getPassWord()
    logger_object = LoG.log_gen()

    @pytest.mark.sanity
    @pytest.mark.Regression
    def test_addCustomer(self, setup):
        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()
        actual_title = self.driver.title
        expected_title = "Dashboard / nopCommerce administration"
        if actual_title == expected_title:
            assert True
            self.logger_object.info("****Loggin test is passed*****")
        else:
            self.driver.get_screenshot_as_file(
                filename="/Screenshots\\test_003_addCustomer.png")
            self.driver.close()
            self.logger_object.info("****Loggin test is failed*****")
            assert False
        self.logger_object.info("****start AddCustomer Test*****")
        self.addCust = addCustomer(self.driver)
        self.addCust.clickOnCustomerMenu()
        self.addCust.clickOnCustomerSubMenu()
        self.addCust.clickOnAddNew()
        self.logger_object.info("***Provide Customer information****")

        self.email = random_generator() + "@gmail.com"
        self.addCust.setEmail(self.email)
        self.addCust.setpassword("test123")
        self.addCust.setFirstName("sairam")
        self.addCust.setLastName("Hari")
        time.sleep(6)
        self.addCust.setGender("Male")
        time.sleep(6)
        self.addCust.setDOB("01/01/1870")
        self.addCust.setCompanyName("shiridiIndia")
        time.sleep(15)
        # self.addCust.setNewsletter("HELLO")
        #self.addCust.setCustomerroles("")
        self.addCust.setCustomerroles("Guests")

        self.addCust.setCustomerroles("Forum Moderators")

        time.sleep(15)
        self.addCust.setManagerOfVendor("Vendor 1")
        time.sleep(10)
        self.addCust.setAdminComment("This is for Testing purpose1")
        self.addCust.click_save()
        self.logger_object.info("****saving customer informatiion****")
        self.logger_object.info("***starting add customer validation***")
        self.msg = self.driver.find_element_by_tag_name("body").text
        print(self.msg)
Exemplo n.º 7
0
class Test_005_Form():
    base_url = Readconfig.getApplicationURL()
    username = Readconfig.getUsername()
    Password = Readconfig.getPassword()
    logger = LogGen.loggen()
    formname = Readconfig.getFormname()
    template_form_description = Readconfig.getFormdescription()

    def test_createform(self,setup):
        self.logger.info("###### Executing Test_004_AssignSuccessor test case ########")
        self.logger.info("############ Setting up with the login test execution ########### ")
        self.driver = setup
        self.driver.get(self.base_url)
        self.driver.maximize_window()
        self.lp = Login(self.driver)
        self.lp.set_Username(self.username)
        time.sleep(1)
        self.lp.click_next_btn()
        time.sleep(2)
        self.lp.set_password(self.Password)
        time.sleep(1)
        self.lp.click_signin_btn()
        time.sleep(1)
        self.lp.click_confirm_btn()
        time.sleep(3)
        self.driver.get_screenshot_as_file(".\\Screenshoots\\login.png")
        self.logger.info("############ User is successfully logged in ########### ")
        print("Login is successfully completed")
        self.logger.info("###### Executing workflow script ######")
        self.form = CreateForm(self.driver)
        time.sleep(3)
        self.form.click_drop_down_menu()
        time.sleep(3)
        self.form.select_admin_from_the_drop_down_menu()
        time.sleep(3)
        self.form.click_breadcrumb_menu()
        time.sleep(3)
        self.form.click_form_management_menu()
        time.sleep(3)
        self.form.click_forms_button()
        time.sleep(3)
        self.form.click_add_form_button()
        time.sleep(2)
        self.form.enable_form_template_toggle()
        time.sleep(2)
        self.form.select_template_name("New hire")
        time.sleep(2)
        self.form.enter_form_name(self.formname)
        # self.driver.find_element_by_xpath("(//*[@id='name'])[2]").send_keys("RP-Starter form")
        time.sleep(2)
        # self.form.enter_descripton(self.template_form_description)
        # time.sleep(2)
        self.form.select_message_type("Hire")
        # select_message_type = Select(self.driver.find_element_by_xpath())
        time.sleep(3)
        self.form.add_request_form()
        time.sleep(5)
Exemplo n.º 8
0
class Test_001_login:

    baseURL= Readconfig.getAppURL()
    username = Readconfig.getUseName()
    password =Readconfig.getPassWord()
    logger_object =LoG.log_gen()


    def test_homepageTitle(self, setup):

        self.logger_object.info("****Test_001_Login*****")
        self.logger_object.info("****verify_homePage*****")
        self.driver = setup
        self.driver.get(self.baseURL)
        actual_title = self.driver.title
        expected_title = "Your store. Login"
        if actual_title == expected_title:
            assert True
            self.driver.close()
            self.logger_object.info("****Home Page title test is passed*****")
        else:
            self.driver.close()
            self.logger_object.info("****Home Page title test is failed*****")
            assert False

    @pytest.mark.sanity
    def test_login(self, setup):
        self.logger_object.info("****Verify Login Page *****")
        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()
        actual_title = self.driver.title
        expected_title = "Dashboard / nopCommerce administration"
        if actual_title == expected_title:
            assert True
            self.logger_object.info("****Loggin test is passed*****")
        else:
            self.driver.get_screenshot_as_file(filename ="/Screenshots\\test_login_001.png")
            self.driver.close()
            self.logger_object.info("****Loggin test is failed*****")
            assert False
        self.logger_object.info("****Test complete*****")
        self.logger_object.info("****Thanks*****")

        self.LP.clicklogout()
Exemplo n.º 9
0
class Test_001_Login:
    baseUrl = Readconfig.getApplicationURL()
    Username = Readconfig.getUserName()
    password = Readconfig.getPassword()

    logger=LogGen.loggen()

    @pytest.mark.sanity
    @pytest.mark.regression
    def test_homePage(self, setup):
        self.logger.info("************Test_001_Login*************")
        self.logger.info("************verifiying homepage************")
        self.driver = setup
        self.driver.get(self.baseUrl)
        act_title = self.driver.title
        print(act_title)
        self.driver.close()
        if act_title == "Your store. Login":
            assert True
            self.logger.info("************homepage test passed*************")

        else:
            self.driver.save_screenshot(".\\Screenshots\\" + "test_homePage1.png")
            assert False
            self.driver.close()
            self.logger.info("************homepage test failed*************")


    def test_Loginpage(self,setup):
        #self.driver =  webdriver.Chrome(ChromeDriverManager().install())
        self.driver = setup
        self.driver.get(self.baseUrl)
        self.lp = Login(self.driver)
        self.lp.setUserName(self.Username)
        self.lp.setPassword(self.password)
        self.lp.Click_Login()
        act_title = self.driver.title
        self.driver.close()
        if act_title == "Dashboard / nopCommerce administration":
            assert True
            self.logger.info("************test_Loginpage passed*************")

        else:
            #self.driver.save_screenshot(".\\Screenshots\\" + "test_Loginpage.png")
            self.driver.save_screenshot(".\\Screenshots\\" + "test_Loginpage1.png")
            assert False
            self.driver.close()
            self.logger.info("************test_Loginpage failed***************")
Exemplo n.º 10
0
class Test_001:
    url=Readconfig.getApplicationURL()
    logger=LogGen.loggen()


    @pytest.mark.sanity
    def test_homepageTitle(self,setup):
        self.logger.info("############ Home Page Test Strted#########")
        self.driver=setup
        self.driver.get(self.url)
        self.driver.maximize_window()


        title=self.driver.title
        if title=="pwa-theme-woocommerce":
            self.logger.info("######## Title Test Passed##########")
            assert True
            self.driver.close()


    @pytest.mark.regression
    def test_addProduct(self,setup):
        self.logger.info("########## Product Test Started")
        self.driver=setup
        self.driver.get(self.url)
        self.driver.maximize_window()
        self.mp=mainPage(self.driver)
        self.mp.checkProduct()
        self.message=self.mp.verifyProduct()
        print(self.message.text)
        assert "Happy Ninja" in self.message.text
        time.sleep(3)
        self.driver.close()
Exemplo n.º 11
0
class Test_002_CreateWorkflow:
    base_url = Readconfig.getApplicationURL()
    username = Readconfig.getUsername()
    Password = Readconfig.getPassword()
    workflow_name = Readconfig.getWorkflowName()
    workflow_description = Readconfig.getDescription()
    status_name = Readconfig.getStatus1()
    logger = LogGen.loggen()

    def test_createworkflow(self, setup):
        self.logger.info("############ Setting up with the login test execution ########### ")
        self.driver = setup
        self.driver.get(self.base_url)
        self.driver.maximize_window()
        self.lp = Login(self.driver)
        self.lp.set_Username(self.username)
        time.sleep(1)
        self.lp.click_next_btn()
        time.sleep(2)
        self.lp.set_password(self.Password)
        time.sleep(1)
        self.lp.click_signin_btn()
        time.sleep(1)
        self.lp.click_confirm_btn()
        time.sleep(3)
        self.driver.get_screenshot_as_file(".\\Screenshoots\\login.png")
        self.logger.info("############ User is successfully logged in ########### ")
        print("Login is successfully completed")
        self.logger.info("######### Creating WorkFlow #########")
        self.wf=CreateWorkflow(self.driver)
        time.sleep(1)
        self.wf.click_drop_down_menu()
        time.sleep(1)
        self.wf.select_admin_from_the_drop_down_menu()
        time.sleep(1)
        self.wf.click_breadcrumb_menu()
        time.sleep(1)
        self.wf.click_workflow_menu()
        time.sleep(1)
        self.wf.click_workflow_sub_menu()
        time.sleep(1)
        self.wf.click_new_button()
        time.sleep(2)
        self.wf.enter_workflow_name(self.workflow_name)
        time.sleep(1)
        self.wf.enter_workflow_description(self.workflow_description)
        time.sleep(1)
        self.wf.active_toggle()
        time.sleep(1)
        self.wf.add_workflow()
        time.sleep(3)
        self.logger.info("####### Workflow is created successfuly ########")
Exemplo n.º 12
0
class Test_002:
    url = Readconfig.getApplicationURL()

    def test_checkout(self, setup):
        self.driver = setup
        self.driver.get(self.url)
        self.driver.maximize_window()
        time.sleep(3)
        self.mp = mainPage(self.driver)
        self.mp.checkProduct()
        self.cp = Checkout(self.driver)
        self.cp.checkoutbtn()
        time.sleep(3)
        self.cp.setusername("KetanP")
        time.sleep(2)
        self.cp.setlastname("puranik")
        time.sleep(2)
        self.cp.setcompany("Barclys")
        self.cp.country()
        time.sleep(3)
        self.cp.setcountryname("uk")
        self.cp.setadress("somnth Nagar")
        time.sleep(2)
        self.cp.setcity("pune")
        time.sleep(2)
        self.cp.setstate()
        time.sleep(2)
        self.cp.setstatetext("Maharashtra")
        time.sleep(2)
        self.cp.setpostalcode("411014")
        time.sleep(2)
        self.cp.setcontactnumber("7517800408")
        time.sleep(2)
        self.cp.setemail("*****@*****.**")
        time.sleep(2)
        total = self.cp.verifyTotal()
        if total.text == "$18.00":
            assert True
        time.sleep(2)
        self.cp.clickpayment()
        time.sleep(2)
        self.cp.clickplaceorder()
        time.sleep(2)
        self.driver.close()
Exemplo n.º 13
0
class Test_003_Login:
    baseUrl = Readconfig.getApplicationURL()
    Username = Readconfig.getUserName()
    password = Readconfig.getPassword()
    logger = LogGen.loggen()

    @pytest.mark.sanity
    @pytest.mark.regression
    def test_addCustomer(self, setup):
        self.logger.info("************Test_003_Login*******************")
        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 succesfully*****************")

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

        self.Addcust = AddCustomer(self.driver)
        self.Addcust.clickOnCustomerMenu()
        self.Addcust.clickOnCustomerMenu_item()

        self.Addcust.click_ADDnew()

        self.logger.info("********Providing customer info***************")
        self.email = random_generator() + "@gmail.com"
        self.Addcust.set_email(self.email)
        self.Addcust.set_Password(self.password)
        #self.Addcust.setcustomerRoles("Guests")
        self.Addcust.setManagerofVendor_xpath("Vendor 2")
        self.Addcust.setGender("Female")
        self.Addcust.setFirstName("Lavanya")
        self.Addcust.setlastName("P")
        self.Addcust.setDOB("10/08/1995")  #Format :DD/MM/YYYY
        self.Addcust.setCompanyName("Capgemini")
        self.Addcust.SetAdminContent("This is for testing data...............")
        self.Addcust.clickOnSave()

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

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

        if 'customer has been added successfully' in self.msg:
            assert True == True
            self.logger.info("******Add customer Test Passed******")
        else:
            self.driver.save_screenshot(".\\Screenshots\\" +
                                        "test_addCustoer_scr.png")
            self.logger.info(
                "*************Add customer failed*******************")
            assert False == False
        time.sleep(5)
        self.driver.quit()
        self.logger.info(
            "***********End of Homepage title test****************")
Exemplo n.º 14
0
class Test_002_DDT_Login:
    baseUrl = Readconfig.getApplicationURL()
    path = ".//Testdata/LoginData.xlsx"
    #Username = R eadconfig.getUserName()
    #password = Readconfig.getPassword()
    logger = LogGen.loggen()

    def test_Loginpage_DDT(self, setup):
        #self.driver =  webdriver.Chrome(ChromeDriverManager().install())
        self.logger.info("************Test_002_DDT_Login************")
        self.logger.info(
            "************test_Loginpage_DDT veriying*************")
        self.driver = setup
        self.driver.get(self.baseUrl)

        self.lp = Login(self.driver)

        self.rows = XLUtils.getRowCount(self.path, 'Sheet1')
        print("numbers of rows", self.rows)
        lst_status = []  #empty list

        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.Click_Login()
            time.sleep(5)

            act_title = self.driver.title
            print(act_title)
            exp_title = "Dashboard / nopCommerce administration"
            print(exp_title)
            if act_title == exp_title:
                if self.exp == "Pass":
                    self.logger.info("*******condition passed*******")
                    print("at=et")
                    self.lp.Click_Logout()
                    lst_status.append("Pass")
                elif self.exp == "Fail":
                    self.logger.info("*******condition failed*******")
                    self.lp.Click_Logout()
                    lst_status.append("Fail")
            elif act_title != exp_title:
                if self.exp == "Pass":
                    self.logger.info("*******condition failed*******")
                    #self.lp.Click_Logout()
                    lst_status.append("Fail")
                elif self.exp == "Fail":
                    self.logger.info("*******condition passed*******")
                    #self.lp.Click_Logout()
                    lst_status.append("Pass")
        if "Fail" not in lst_status:
            self.logger.info("******Login DDT test passed********")
            print("Login DDT test passed")
            self.driver.close()
            assert True
        else:
            self.logger.info("*********Login DDT test failed***************")
            print("Login DDT test failed")
            self.driver.close()
            assert False
        self.logger.info("**********End of Login DDT test****************")
Exemplo n.º 15
0
class Test_001_Login:
    base_url = Readconfig.getApplicationURL()
    username = Readconfig.getUsername()
    Password = Readconfig.getPassword()
    logger = LogGen.loggen()

    def test_home(self, setup):
        self.logger.info(
            "############ Executing testcase TC_001_login ########### ")
        self.driver = setup
        self.driver.get(self.base_url)
        self.driver.maximize_window()
        title = self.driver.title
        print(title)
        print("Login page successfully launched")
        self.logger.info(
            "############ The browser is launched successfully ########### ")

    # @pytest.mark.regression
    def test_login(self):
        self.logger.info(
            "############ Setting up with the login test execution ########### "
        )
        self.driver = webdriver.Chrome(ChromeDriverManager().install())
        self.driver.get(self.base_url)
        self.driver.maximize_window()
        lp = Login(self.driver)
        lp.set_Username(self.username)
        time.sleep(1)
        lp.click_next_btn()
        time.sleep(1)
        lp.set_password(self.Password)
        time.sleep(1)
        lp.click_signin_btn()
        time.sleep(1)
        lp.click_confirm_btn()
        time.sleep(3)
        self.driver.get_screenshot_as_file(".\\Screenshoots\\login.png")
        self.logger.info(
            "############ User is successfully logged in ########### ")
        print("Login is successfully completed")

    def test_logout(self, setup):
        self.driver = setup
        self.driver.get(self.base_url)
        self.driver.maximize_window()
        self.lp = Login(self.driver)
        self.lp.set_Username(self.username)
        time.sleep(1)
        self.lp.click_next_btn()
        time.sleep(1)
        self.lp.set_password(self.Password)
        time.sleep(1)
        self.lp.click_signin_btn()
        time.sleep(1)
        self.lp.click_confirm_btn()
        time.sleep(1)
        print("Login is successfully completed")
        dashboard_text = self.lp.capture_text()
        print(dashboard_text)
        title = self.driver.title
        print(title)
        self.lp.click_user_profile()
        time.sleep(1)
        self.lp.logout_user()
        time.sleep(3)
        self.logger.info(
            "############ User is successfully logged out ########### ")
        print("User is logged out")
Exemplo n.º 16
0
class Test_ddt_002:
    baseURL = Readconfig.getAppURL()
    path = "C:\\Users\\rohit\\PycharmProjects\\NOPCOM\\TestData\\Book2.xlsx"
    LO = LoG.log_gen()

    @pytest.mark.Regression
    def test_login_DDT(self, setup):
        self.LO.info("*****Test_ddt_002****")
        self.LO.info("****Verify Login page****")
        self.driver = setup
        self.driver.get(self.baseURL)
        self.LP = Loginpage(self.driver)
        self.rows = XLUtils.getRowCount(self.path, sheetName="Sheet1")
        self.columns = XLUtils.getColumnCount(self.path, sheetName="Sheet1")
        print(" No of rows in excel:", self.rows)
        print("No of columns in excel", self.columns)
        Lis_status = []
        #print(Lis_status)
        for r in range(2, self.rows + 1):
            self.username = XLUtils.readData(self.path,
                                             sheetName="Sheet1",
                                             rownum=r,
                                             columnno=1)
            self.password = XLUtils.readData(self.path,
                                             sheetName="Sheet1",
                                             rownum=r,
                                             columnno=2)
            self.expected = XLUtils.readData(self.path,
                                             sheetName="Sheet1",
                                             rownum=r,
                                             columnno=3)
            self.output = XLUtils.readData(self.path,
                                           sheetName="Sheet1",
                                           rownum=r,
                                           columnno=4)

            self.LP.setUserName(self.username)
            self.LP.setPassword(self.password)
            self.LP.clickLogin()
            time.sleep(10)
            actual_title = self.driver.title
            expected_title = "Dashboard / nopCommerce administration"
            if actual_title == expected_title:
                if self.expected == "pass":
                    self.LO.info("***Passed")
                    self.LP.clicklogout()
                    time.sleep(3)
                    Lis_status.append("Pass")
                    self.output = XLUtils.writeData(self.path,
                                                    sheetName="Sheet1",
                                                    rownum=r,
                                                    columnno=4,
                                                    data="Pass")
                elif self.expected == "fail":
                    self.LO.info("***Failed")
                    self.LP.clicklogout()
                    time.sleep(10)
                    Lis_status.append("Fail")
                    self.output = XLUtils.writeData(self.path,
                                                    sheetName="Sheet1",
                                                    rownum=r,
                                                    columnno=4,
                                                    data="Fail")

            elif actual_title != expected_title:
                if self.expected == "pass":
                    self.LO.info("****Failed")
                    Lis_status.append("Fail")
                    self.output = XLUtils.writeData(self.path,
                                                    sheetName="Sheet1",
                                                    rownum=r,
                                                    columnno=4,
                                                    data="Fail")

                    time.sleep(10)
                elif self.expected == "fail":
                    self.LO.info("****Passed")
                    Lis_status.append("Pass")
                    self.output = XLUtils.writeData(self.path,
                                                    sheetName="Sheet1",
                                                    rownum=r,
                                                    columnno=4,
                                                    data="Pass")

                    time.sleep(5)
        if "Fail" not in Lis_status:
            self.LO.info("The DDT test is passed")
            self.driver.close()
            assert True
        else:
            self.LO.info("the DDT test is failed")
            self.driver.close()
            assert False
        self.LO.info("End of Login_DDT test")
        self.LO.info("complete the test case for data driven")
Exemplo n.º 17
0
class Test_006_Group():
    base_url = Readconfig.getApplicationURL()
    username = Readconfig.getUsername()
    Password = Readconfig.getPassword()
    logger = LogGen.loggen()
    request_group = Readconfig.getRequestgroupname()
    group_description = Readconfig.getGroupdescription()
    RequestType = Readconfig.getRequestTypename()
    RequestType_Description = Readconfig.getRequestTypeDescription()
    workflow_name = Readconfig.getWorkflowName()
    form_name = Readconfig.getFormname()

    def test_creategroup(self, setup):
        self.logger.info(
            "###### Executing Test_004_AssignSuccessor test case ########")
        self.logger.info(
            "############ Setting up with the login test execution ########### "
        )
        self.driver = setup
        self.driver.implicitly_wait(10)
        self.driver.get(self.base_url)
        time.sleep(2)
        self.driver.maximize_window()
        time.sleep(2)
        self.lp = Login(self.driver)
        time.sleep(2)
        self.lp.set_Username(self.username)
        time.sleep(2)
        self.lp.click_next_btn()
        time.sleep(2)
        self.lp.set_password(self.Password)
        time.sleep(2)
        self.lp.click_signin_btn()
        time.sleep(2)
        self.lp.click_confirm_btn()
        time.sleep(2)
        self.driver.get_screenshot_as_file(".\\Screenshoots\\login.png")
        self.logger.info(
            "############ User is successfully logged in ########### ")
        print("Login is successfully completed")
        self.logger.info("###### Executing workflow script ######")
        self.form = CreateForm(self.driver)
        time.sleep(2)
        self.form.click_drop_down_menu()
        time.sleep(2)
        self.form.select_admin_from_the_drop_down_menu()
        time.sleep(2)
        self.form.click_breadcrumb_menu()
        time.sleep(2)
        self.RG = RequestGroup(self.driver)
        self.logger.info(
            "######## Working on the request group creation ########")
        self.RG.click_request_group()
        time.sleep(2)
        self.RG.create_a_new_request_group()
        time.sleep(2)
        self.RG.enter_request_group_name(self.request_group)
        time.sleep(2)
        self.RG.enter_request_group_description(self.group_description)
        time.sleep(2)
        self.RG.click_enable_active_toggle()
        time.sleep(2)
        self.RG.click_add_button()
        time.sleep(2)
        self.logger.info(
            "######## The request group is added successfully ########")
        self.RG.search_request_group_name(self.request_group)
        time.sleep(3)
        self.RG.click_selected_request_group_name()
        time.sleep(3)
        self.RG.create_a_new_request_type()
        time.sleep(3)
        self.RG.enter_request_type_name(self.RequestType)
        time.sleep(2)
        self.RG.add_request_type_description(self.RequestType_Description)
        time.sleep(3)
        self.RG.select_workflow(self.workflow_name)
        time.sleep(3)
        self.RG.select_request_form(self.form_name)
        time.sleep(3)
        self.RG.add_request_type()
        time.sleep(5)
        self.logger.info(
            "######## A new request type is created successfully #########")
Exemplo n.º 18
0
class Test_004_AssignSuccessor:
    base_url = Readconfig.getApplicationURL()
    username = Readconfig.getUsername()
    Password = Readconfig.getPassword()
    workflow_name = Readconfig.getWorkflowName()
    workflow_description = Readconfig.getDescription()
    status_name = Readconfig.getStatus1()
    status_name1 = Readconfig.getStatus2()
    status_name2 = Readconfig.getStatus3()
    status_name3 = Readconfig.getStatus4()
    logger = LogGen.loggen()

    def test_successor(self, setup):
        self.logger.info(
            "###### Executing Test_004_AssignSuccessor test case ########")
        self.logger.info(
            "############ Setting up with the login test execution ########### "
        )
        self.driver = setup
        self.driver.get(self.base_url)
        self.driver.maximize_window()
        self.lp = Login(self.driver)
        self.lp.set_Username(self.username)
        time.sleep(1)
        self.lp.click_next_btn()
        time.sleep(2)
        self.lp.set_password(self.Password)
        time.sleep(1)
        self.lp.click_signin_btn()
        time.sleep(1)
        self.lp.click_confirm_btn()
        time.sleep(3)
        self.driver.get_screenshot_as_file(".\\Screenshoots\\login.png")
        self.logger.info(
            "############ User is successfully logged in ########### ")
        print("Login is successfully completed")
        self.logger.info("###### Executing workflow script ######")
        self.wf = CreateWorkflow(self.driver)
        time.sleep(3)
        self.wf.click_drop_down_menu()
        time.sleep(3)
        self.wf.select_admin_from_the_drop_down_menu()
        time.sleep(3)
        self.wf.click_breadcrumb_menu()
        time.sleep(3)
        self.wf.click_workflow_menu()
        time.sleep(3)
        self.wf.click_workflow_sub_menu()
        time.sleep(3)
        self.driver.get_screenshot_as_file(".\\Screenshoots\\workflow.png")
        self.assignstatus = CreateStatus(self.driver)
        self.assignstatus.search_workflow_name(self.workflow_name)
        time.sleep(3)
        self.assignstatus.select_workflow()
        time.sleep(3)
        self.logger.info(
            "######## Assign successor to the created status ########")
        self.AS = SuccessorAssign(self.driver)
        self.AS.click_three_dot_icon_manager()
        time.sleep(1)
        self.AS.click_manager_successor_btn_three_dot_menu()
        time.sleep(2)
        self.logger.info(
            "###### Assign successor1 to the Manager status ######")
        self.AS.click_create_new_successor_btn()
        time.sleep(2)
        self.AS.assign_successor_to_status("Back to originator")
        time.sleep(1)
        self.AS.assign_next_status_to_successor("Review by originator")
        time.sleep(1)
        self.AS.click_add_successor_btn()
        time.sleep(3)
        self.logger.info(
            "###### Assign successor2 to the Manager status ######")
        self.AS.click_create_new_successor_btn()
        time.sleep(3)
        self.AS.assign_successor_to_status("Approve")
        time.sleep(3)
        self.AS.assign_next_status_to_successor("Approve")
        time.sleep(3)
        self.AS.click_add_successor_btn()
        time.sleep(3)
        self.logger.info(
            "###### Assign successor3 to the Manager status ######")
        self.AS.click_create_new_successor_btn()
        time.sleep(3)
        self.AS.assign_successor_to_status("Reject")
        time.sleep(3)
        self.AS.assign_next_status_to_successor("Reject")
        time.sleep(3)
        self.AS.click_add_successor_btn()
        self.driver.get_screenshot_as_file(".\\Screenshoots\\successor1.png")
        time.sleep(3)
        self.AS.click_back_button()
        self.logger.info("###### Navigate back to status page ######")
        self.logger.info(
            "###### Assign successor to the status Originator ######")
        time.sleep(3)
        self.AS.click_three_dot_icon_originator()
        time.sleep(3)
        self.AS.click_originator_successor_btn_three_dot_menu()
        time.sleep(3)
        self.AS.click_create_new_successor_btn()
        time.sleep(3)
        self.AS.assign_successor_to_status("Back to originator")
        time.sleep(3)
        self.AS.assign_next_status_to_successor("Review by manager")
        time.sleep(3)
        self.AS.click_add_successor_btn()
        time.sleep(2)
        self.driver.get_screenshot_as_file(".\\Screenshoots\\successor2.png")
        self.AS.click_back_button()
        time.sleep(2)
Exemplo n.º 19
0
class Test_003_StatusAssignment:
    base_url = Readconfig.getApplicationURL()
    username = Readconfig.getUsername()
    Password = Readconfig.getPassword()
    workflow_name = Readconfig.getWorkflowName()
    workflow_description = Readconfig.getDescription()
    status_name = Readconfig.getStatus1()
    status_name1 = Readconfig.getStatus2()
    status_name2 = Readconfig.getStatus3()
    status_name3 = Readconfig.getStatus4()
    logger = LogGen.loggen()

    def test_statusassignment(self, setup):
        self.logger.info(
            "############ Setting up with the login test execution ########### "
        )
        self.driver = setup
        self.driver.get(self.base_url)
        self.driver.maximize_window()
        self.lp = Login(self.driver)
        self.lp.set_Username(self.username)
        time.sleep(1)
        self.lp.click_next_btn()
        time.sleep(2)
        self.lp.set_password(self.Password)
        time.sleep(1)
        self.lp.click_signin_btn()
        time.sleep(1)
        self.lp.click_confirm_btn()
        time.sleep(3)
        self.driver.get_screenshot_as_file(".\\Screenshoots\\login.png")
        self.logger.info(
            "############ User is successfully logged in ########### ")
        print("Login is successfully completed")
        self.logger.info("######### Creating WorkFlow #########")
        self.wf = CreateWorkflow(self.driver)
        time.sleep(1)
        self.wf.click_drop_down_menu()
        time.sleep(1)
        self.wf.select_admin_from_the_drop_down_menu()
        time.sleep(1)
        self.wf.click_breadcrumb_menu()
        time.sleep(1)
        self.wf.click_workflow_menu()
        time.sleep(1)
        self.wf.click_workflow_sub_menu()
        time.sleep(1)
        self.driver.get_screenshot_as_file(".\\Screenshoots\\workflow.png")
        self.logger.info("####### Workflow is created successfuly ########")
        self.assignstatus = CreateStatus(self.driver)
        self.assignstatus.search_workflow_name(self.workflow_name)
        time.sleep(3)
        self.assignstatus.select_workflow()
        time.sleep(1)
        self.logger.info("####### Assign status in the workflow ########")
        self.assignstatus.click_add_new_status_btn()
        time.sleep(1)
        self.assignstatus.enter_status(self.status_name)
        time.sleep(1)
        self.logger.info(
            "####### Executing Test_003_StatusAssignment test case for status assignment"
        )
        self.logger.info(
            "####### Assigning manager status1 to the workflow ########")
        self.assignstatus.select_assign_type("Manager")
        time.sleep(2)
        # self.assignstatus.select_fixed_value("Review")
        # time.sleep(2)
        self.assignstatus.enable_assignee_toggle()
        time.sleep(1)
        self.assignstatus.enable_originator_toggle()
        time.sleep(1)
        self.assignstatus.add_status()
        self.driver.get_screenshot_as_file(".\\Screenshoots\\.png")
        time.sleep(3)
        self.logger.info(
            "####### Assigning originator status2 to the workflow ########")
        self.assignstatus.click_add_new_status_btn()
        time.sleep(1)
        self.assignstatus.enter_status(self.status_name1)
        time.sleep(1)
        self.assignstatus.select_assign_type("Originator")
        time.sleep(2)
        self.assignstatus.select_fixed_value("Review")
        time.sleep(2)
        self.assignstatus.enable_assignee_toggle()
        time.sleep(1)
        self.assignstatus.enable_originator_toggle()
        time.sleep(1)
        self.assignstatus.add_status()
        self.driver.get_screenshot_as_file(
            ".\\Screenshots\\status_originator.png")
        time.sleep(3)
        self.logger.info(
            "####### Assigning manager status3 to the workflow ########")
        self.assignstatus.click_add_new_status_btn()
        time.sleep(1)
        self.assignstatus.enter_status(self.status_name2)
        time.sleep(1)
        self.assignstatus.select_assign_type("Manager")
        time.sleep(2)
        self.assignstatus.select_fixed_value("End approved")
        time.sleep(2)
        self.assignstatus.enable_assignee_toggle()
        time.sleep(1)
        self.assignstatus.enable_originator_toggle()
        time.sleep(1)
        self.assignstatus.add_status()
        self.driver.get_screenshot_as_file(".\\Screenshots\\manager2.png")
        time.sleep(3)
        self.logger.info(
            "####### Assigning manager status4 to the workflow ########")
        self.assignstatus.click_add_new_status_btn()
        time.sleep(1)
        self.assignstatus.enter_status(self.status_name3)
        time.sleep(1)
        self.assignstatus.select_assign_type("Manager")
        time.sleep(2)
        self.assignstatus.select_fixed_value("End rejected")
        time.sleep(2)
        self.assignstatus.enable_assignee_toggle()
        time.sleep(1)
        self.assignstatus.enable_originator_toggle()
        time.sleep(1)
        self.assignstatus.add_status()
        self.driver.get_screenshot_as_file(".\\Screenshots\\manager3.png")
        time.sleep(3)
        self.driver.get_screenshot_as_file(
            ".\\Screenshots\\assigned_status.png")