Exemple #1
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()
Exemple #2
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()
Exemple #3
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()
Exemple #4
0
class Test_003_AddCustomer:
    baseurl = ReadConfig.getApplicationURL()
    usernamew = ReadConfig.getuseremailL()
    passord = ReadConfig.getuserpassword()
    logger = logGen.log_gen()

    @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.driver.implicitly_wait(10)

        self.lp = LoginPage(self.driver)
        self.lp.setUsername(self.usernamew)
        self.lp.setPassword(self.passord)
        self.lp.clicklogin()

        self.addcust = Add_customer(self.driver)

        self.addcust.clickcustomermenu()

        self.addcust.clickcustomermenuItem()

        self.addcust.Add_new()

        self.email = random_generator(
        ) + "@gmail.com"  ##creating a random data,the method has given below
        self.addcust.setEmail(self.email)

        self.addcust.setPassword('12345')

        self.firstname = random_generator()
        self.addcust.setFirstname(self.firstname)

        # self.addcust.setFirstname('rohit')
        self.addcust.setLastname('shelke')
        self.addcust.setDOB("2/05/1995")
        self.addcust.setGender("Male")
        self.addcust.setCompanyName("cattleya")
        self.addcust.setAdmincontent("gshvghs")
        #self.addcust.setDropdownVendor('Vendor 2')

        self.addcust.clickbtnsave()

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

        ##below method it will capture everything on the page and it will convert it into text and will save it in variable self.msg
        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:  ##checking "The new customer has been added successfully" this line is present in variable called self .msg
            assert True == True
            print("Add custmeter test is passed")
            self.logger.info("Add custmeter test is passed")
        else:
            self.driver.save_screenshot(".\\Screenshots\\" +
                                        "test_addcustomer_sc2.png")
            self.logger.info("Add custmeter test is failed")
            assert True == False

        self.driver.close()
        self.logger.info("****end of test_add_customer test case")