Ejemplo n.º 1
0
    def testAddProductSuccess(self):
        u"""测试正确数据发布产品功能"""

        testcaseid = 'case_0005'
        print testcaseid
        data_list = self.getAddProductDataByTestcaseid(testcaseid)

        sql = "select dd.* from yydscs.IMS_NEWS dd where dd.title="
        old_dataCount = select.SelectFromOracle().selectFromOracle(
            sql, data_list[0])

        LocateAddProductObject.LocateLoginObject().getLocateObject(
            testcaseid, self.browser, data_list)

        time.sleep(4)
        self.browser.get_screenshot_as_file(
            "F:\\testresult\\image_SUCCESSaddProduct.png")
        print("image_SUCCESSaddProduct.png ")

        new_dataCount = select.SelectFromOracle().selectFromOracle(
            sql, data_list[0])
        if new_dataCount > old_dataCount:
            print(u"通过数据库查询到产品发布成功")
        else:
            print(u"通过数据库查询到产品发布失败")

        print(u"断言判定马上就要开始了---------------------------")
        #调用断言判断在前台页面判断产品是否发布成功
        self.assertMethod(data_list, self.browser.current_url)
Ejemplo n.º 2
0
    def testAddProductWithoutWebsiteItem(self):
        u"""测试不选择栏目进行发布产品功能"""

        testcaseid = 'case_0007'
        print testcaseid
        data_list = self.getAddProductDataByTestcaseid(testcaseid)

        sql = "select dd.* from yydscs.IMS_NEWS dd where dd.title="
        old_dataCount = select.SelectFromOracle().selectFromOracle(
            sql, data_list[0])

        LocateAddProductObject.LocateAddProductObject().getLocateObject(
            testcaseid, self.browser, data_list)

        time.sleep(4)
        self.browser.get_screenshot_as_file(
            "F:\\testresult\\image_addProductFailedWithoutWebsiteItem.png")
        print("image_addProductFailedWithoutWebsiteItem.png ")

        new_dataCount = select.SelectFromOracle().selectFromOracle(
            sql, data_list[0])
        if new_dataCount > old_dataCount:
            print(u"通过数据库查询到产品发布成功")
        else:
            print(u"通过数据库查询到产品发布失败")
Ejemplo n.º 3
0
 def assertByOracle(self,register_data_list):
     """
     通过数据库查询判断会员是否注册成功,并且返回查询到的结果总数
     """
     sql="select qy.* from yydscs.csm_user_info qy where qy.login_name="
     count_data=select.SelectFromOracle().selectFromOracleWithoutChineseWord(sql=sql,key=register_data_list[0])
     return count_data