Example #1
0
    def test_001(self):
        """ 三方商户创建超级商品:
                            有广告词;不限购;有市场价;卡币促销可用;不显示正品保证;可用优惠券;多张图片;有图文详情;有商品二级分类;
                             一级属性;二级属性;要邮寄;邮费为0;支持退货;需结算
                              扣点
        """

        loginPage(self.driver).login("admin", "admin", self.url)

        driver = self.driver

        po = goodsManagePage(self.driver)
        po.goodsNameInput(u"超级运动鞋")
        po.goodsDescInput(u"智能连接")
        po.goodsAdvInput(u"广告")
        po.skuDescInput(u"尺码")
        po.limitCountInput("0")
        po.marketPriceInput(99.99)
        po.promoteRulesRadio(True)
        po.showQualityRadio(False)
        po.couponRadio(True)
        po.picUploadButtom(
            2,
            "C:\\Users\\yangweijia\\Pictures\\jpg\\9d3f07e61a790d50cc563fd8a28db5762271c535.jpg",
            "C:\\Users\\yangweijia\\Pictures\\jpg\\6630751106351088810.jpg")
        po.detailEdit()
        po.firstClassSelect(u"颜色")
        po.secondClassSelect(u"黑色")
        po.brandInput(u"阿迪达斯")
        js = "window.scrollTo(0,150);"
        driver.execute_script(js)
        po.newAssociateButtom()

        po.firstAttrNamInput(u"颜色")
        po.firstAttrAdd(u"红色", u"翠绿")
        po.secondAttrNamInput(u"尺码")
        po.secondAttrAdd(u"小", u"大")
        po.postRadio(True)
        po.postPriceInput(0)
        po.refundRadio(True, self.thirdManage)
        po.settleRadio(True, self.thirdManage)
        #         driver.get("https://admin.codoon.com/admin/html/item-creator-test.html#!sku_table")
        po.nextSkuConfigButton()

        po.skuInfoInput(1, 2, 1, 2, 1, 20, None, True, None, 50)
        po.skuInfoBatchButton(1, 2, 1, 2, True)
        po.skuInfoBatchPrice_All()
        po.skuInfoBatchNum_All()
        po.skuInfoBatchRebate_All()
        po.skuInfoBatchConfirm()
        po.ConfirmEndButton()

        #验证创建了超级商品
        supGoods = superGoodsManagePage(self.driver)
        print supGoods.getSupGoodsLNameOfEdit()
        try:
            self.assertEqual(supGoods.getSupGoodsLNameOfEdit(), u"超级运动鞋")
        except AssertionError as e:
            self.verificationErrors.append(str(e))
        insert_img(self.driver, "goodsCreate_001.jpg")
Example #2
0
    def test_006(self):
        #自营管理员创建超级商品
        loginPage(self.driver).login("zdh11", "Aa123456", self.url)
        driver = self.driver

        po = goodsManagePage(self.driver)
        po.goodsNameInput(u"超级运动鞋")
        po.goodsDescInput(u"智能连接")
        po.goodsAdvInput(u"广告")
        po.skuDescInput(u"尺码")
        po.limitCountInput("0")
        po.marketPriceInput(99.99)
        po.promoteRulesRadio(True)
        po.showQualityRadio(False)
        po.couponRadio(True)
        po.picUploadButtom(
            2,
            "C:\\Users\\yangweijia\\Pictures\\jpg\\9d3f07e61a790d50cc563fd8a28db5762271c535.jpg",
            "C:\\Users\\yangweijia\\Pictures\\jpg\\6630751106351088810.jpg")
        po.detailEdit()
        po.firstClassSelect(u"颜色")
        po.secondClassSelect(u"黑色")
        po.brandInput(u"阿迪达斯")
        js = "window.scrollTo(0,150);                                         "
        driver.execute_script(js)
        time.sleep(2)
        po.newAssociateButtom()
        driver.get(
            "https://admin.codoon.com/admin/html/item-creator-test.html#!sku_config"
        )
        time.sleep(2)
        po.firstAttrNamInput(u"颜色")
        po.firstAttrAdd(u"红色", u"翠绿")
        po.secondAttrNamInput(u"尺码")
        po.secondAttrAdd(u"小", u"大")
        po.postRadio(True)
        po.postPriceInput(0)
        po.vendorSelect(u"自营国内")
        po.refundRadio(True, self.thirdManage)
        po.settleRadio(True, self.thirdManage)
        po.nextSkuConfigButton()
        time.sleep(5)
        po.skuInfoInput(1, 2, 1, 2, 1, 1, None, True, None, 50)
        po.skuInfoBatchButton(1, 2, 1, 2, True)
        po.skuInfoBatchPrice_All()
        po.skuInfoBatchNum_All()
        po.skuInfoBatchRebate_All()
        po.skuInfoBatchConfirm()
        po.ConfirmEndButton()

        #验证创建了超级商品
        supGoods = superGoodsManagePage(self.driver)
        print supGoods.getSupGoodsLNameOfEdit()
        try:
            self.assertEqual(supGoods.getSupGoodsLNameOfEdit(), u"超级运动鞋")
        except AssertionError as e:
            self.verificationErrors.append("006")
        insert_img(self.driver, "goodsCreate_006.jpg")
Example #3
0
    def test_004(self):
        """ 三方商户创建超级商品:
                            没广告词;限购数量2;没有市场价;卡币促销不可用;显示正品保证;不可用优惠券;单张图片;没有图文详情;没有商品二级分类
                             一级属性;二级属性;要邮寄;邮费为0;不支持退货;不需结算
        """

        loginPage(self.driver).login("admin", "admin", self.url)
        driver = self.driver

        po = goodsManagePage(self.driver)
        po.goodsNameInput(u"超级运动鞋")
        po.goodsDescInput(u"智能连接")
        po.skuDescInput(u"尺码")
        po.limitCountInput("2")
        po.marketPriceInput(0)
        po.promoteRulesRadio(False)
        po.showQualityRadio(True)
        po.couponRadio(False)
        po.picUploadButtom(
            1,
            "C:\\Users\\yangweijia\\Pictures\\jpg\\9d3f07e61a790d50cc563fd8a28db5762271c535.jpg"
        )
        po.firstClassSelect(u"颜色")
        po.brandInput(u"阿迪达斯")
        js = "window.scrollTo(0,150);                                         "
        driver.execute_script(js)
        po.newAssociateButtom()

        po.firstAttrNamInput(u"颜色")
        po.firstAttrAdd(u"红色", u"翠绿")
        po.secondAttrNamInput(u"尺码")
        po.secondAttrAdd(u"小", u"大")
        po.postRadio(True)
        po.refundRadio(False, self.thirdManage)
        po.settleRadio(False, self.thirdManage)
        po.nextSkuConfigButton()

        po.skuInfoInput(1, 2, 1, 2, 1, 100, None, False, None, None)
        po.skuInfoBatchButton(1, 2, 1, 2, False)
        po.skuInfoBatchPrice_All()
        po.skuInfoBatchNum_All()
        po.skuInfoBatchConfirm(False)
        po.ConfirmEndButton()

        #验证创建了超级商品
        supGoods = superGoodsManagePage(self.driver)
        print supGoods.getSupGoodsLNameOfEdit()
        insert_img(self.driver, "goodsCreate_002.jpg")
        try:
            self.assertEqual(supGoods.getSupGoodsLNameOfEdit(), u"超级运动鞋")
        except AssertionError as e:
            self.verificationErrors.append("004")
    def test_004(self):
        #超级商品生效(自营管理员)
        loginPage(self.driver).login("test123", "Test123456", self.url)

        po = superGoodsManagePage(self.driver)
        po.searContInput("183345641538749679397800")
        po.searchButton("selfManage")
        po.effectButton()

        insert_img(self.driver, "superGoodsManage_004.jpg")

        try:
            self.assertEqual(po.geteffectText(), u"失效")
        except AssertionError as e:
            self.verificationErrors.append("004")
    def test_003(self):
        #超级商品生效(三方商户)
        loginPage(self.driver).login("wy", "Aa123456", self.url)

        po = superGoodsManagePage(self.driver)
        po.searContInput("298372840340646020969458")
        po.searchButton("thirdManage")
        po.effectButton()

        insert_img(self.driver, "superGoodsManage_003.jpg")

        try:
            self.assertEqual(po.geteffectText(), u"失效")
        except AssertionError as e:
            self.verificationErrors.append("003")
    def test_002(self):
        #超级商品生效(小Boss)
        loginPage(self.driver).login("ywjBoss1", "1234", self.url)

        po = superGoodsManagePage(self.driver)
        po.searContInput("379873516136836933038241")
        po.searchButton("subThirdBoss")
        po.effectButton()

        insert_img(self.driver, "superGoodsManage_002.jpg")

        try:
            self.assertEqual(po.geteffectText(), u"失效")
        except AssertionError as e:
            self.verificationErrors.append("002")
    def test_005(self):
        #超级商品失效(三方Boss)
        loginPage(self.driver).login("boss_admin", "Boss123", self.url)

        po = superGoodsManagePage(self.driver)
        po.searContInput("49649967439324941423407")
        po.searchButton("thirdBoss")
        po.effectButton()
        po.confirmOfEffect()

        insert_img(self.driver, "superGoodsManage_005.jpg")

        try:
            self.assertEqual(po.geteffectText(), u"生效")
        except AssertionError as e:
            self.verificationErrors.append("005")
    def test_001(self):
        #超级商品生效(三方Boss)
        loginPage(self.driver).login("boss_admin", "Boss123", self.url)

        po = superGoodsManagePage(self.driver)
        po.searContInput("299500516141052592407075")

        po.searchButton("thirdBoss")
        po.effectButton()

        insert_img(self.driver, "superGoodsManage_001.jpg")

        try:
            self.assertEqual(po.geteffectText(), u"失效")
        except AssertionError as e:
            self.verificationErrors.append("001")
    def test_007(self):
        #超级商品失效(三方商户)
        loginPage(self.driver).login("admin", "admin", self.url)

        po = superGoodsManagePage(self.driver)
        po.searContInput("15471920739324406367534")
        po.searchButton("thirdManage")
        po.effectButton()
        po.confirmOfEffect()

        insert_img(self.driver, "superGoodsManage_007.jpg")

        try:
            self.assertEqual(po.geteffectText(), u"生效")
        except AssertionError as e:
            self.verificationErrors.append("007")