Пример #1
0
	def __init__(self, driver):
		self.driver = driver

		self.page_control = PageControl(driver)

		self.enable = toDict({
			'enable_ok': BtnWithId(driver, 'openModal_okBtn')})

		self.disable = toDict({
			'disable_ok': BtnWithId(driver, 'stopModal_okBtn')})

		self.delete = toDict({
			'delete_ok': BtnWithId(driver, 'delModal_okBtn')})
Пример #2
0
	def __init__(self, driver):

		CommonPage.__init__(self, driver)

		formDriver = self.entry_form_by_id(id_= 'addBtn', formId= 'addModal')

		addForm = {
			'name_': InputWithName(formDriver, 'name_'),
			'shortName': InputWithName(formDriver, 'shortName'),
			'rate': InputWithName(formDriver, 'rate'),
			'batchSpecification': InputWithName(formDriver, 'batchSpecification'),
			'singleSpecification': InputWithName(formDriver, 'singleSpecification'),
			'boxCoefficient': InputWithName(formDriver, 'boxCoefficient'),
			'barCode': InputWithName(formDriver, 'barCode'),
			'packaging': InputWithName(formDriver, 'packaging'),
			'qualityTime': InputWithName(formDriver, 'qualityTime'),
			'remark': InputWithName(formDriver, 'remark'),
			'brandName': DropMenuWithText(formDriver, 'brandName'),
			'typeName': DropMenuWithText(formDriver, 'typeName'),
			'batchUnitName': DropMenuWithText(formDriver, 'batchUnitName'),
			'singleUnitName': DropMenuWithText(formDriver, 'singleUnitName'),
			'cancel': BtnWithText(formDriver, '取消'),
			'submit': BtnWithText(formDriver, '保存'),
		}

		self.sort = ['name_', 'shortName', 'rate', 'batchSpecification', 'singleSpecification', 'boxCoefficient', 'barCode','packaging', 'qualityTime', 
					'remark', 'brandName', 'typeName', 'batchUnitName', 'singleUnitName']

		self.addForm = toDict(addForm)
Пример #3
0
	def __init__(self, driver):

		CommonPage.__init__(self, driver)

		formDriver = self.entry_form_by_id(id_= 'addBtn', formId= 'addModal')

		addForm = {
			'username': PopMenuWithName(formDriver, dict(driver= driver, formId= 'srhMgrForm', srcName= 'userName', tblId= 'sautbl', btnOk= 'getMgrBtn'), name_= 'username'),
			'year': DropMenuWithText(formDriver, 'year'),
			'kpiTypeName': DropMenuWithText(formDriver, 'kpiTypeName'),
			'month1': InputWithName(formDriver, 'month1'),
			'month2': InputWithName(formDriver, 'month2'),
			'month3': InputWithName(formDriver, 'month3'),
			'month4': InputWithName(formDriver, 'month4'),
			'month5': InputWithName(formDriver, 'month5'),
			'month6': InputWithName(formDriver, 'month6'),
			'month7': InputWithName(formDriver, 'month7'),
			'month8': InputWithName(formDriver, 'month8'),
			'month9': InputWithName(formDriver, 'month9'),
			'month10': InputWithName(formDriver, 'month10'),
			'month11': InputWithName(formDriver, 'month11'),
			'month12': InputWithName(formDriver, 'month12'),
			'cancel': BtnWithText(formDriver, '取消'),
			'submit': BtnWithText(formDriver, '保存'),
		}

		self.sort = ['username', 'year', 'kpiTypeName', 'month1', 'month2', 'month3', 'month4', 'month5', 'month6', 'month7', 'month8', 'month9', 'month10', 'month11', 'month12']

		self.addForm = toDict(addForm)
Пример #4
0
	def __init__(self, driver):

		CommonPage.__init__(self, driver)

		formDriver = self.entry_form_by_id(id_= 'addBtn', formId= 'addModal')

		addForm = {
			'userName': InputWithName(formDriver, 'userName'),
			'mobilePhone': InputWithName(formDriver, 'mobilePhone'),
			'shortcode': InputWithName(formDriver, 'shortcode'),
			'workcode': InputWithName(formDriver, 'workcode'),
			'tel': InputWithName(formDriver, 'tel'),
			'postcode': InputWithName(formDriver, 'postcode'),
			'email': InputWithName(formDriver, 'email'),
			'idcard': InputWithName(formDriver, 'idcard'),
			'address': InputWithName(formDriver, 'address'),
			'remark': InputWithName(formDriver, 'remark'),
			'roleIds': DropMenuWithText(formDriver, 'roleIds'),
			'positionjob': DropMenuWithText(formDriver, 'positionjob'),
			'saleAreaName': DropMenuWithTitle(formDriver, 'saleAreaName'),
			'managerName': PopMenuWithName(formDriver, dict(driver= driver, formId= 'srhMgrForm', srcName= 'userName', tblId= 'sautbl', btnOk= 'getMgrBtn'), name_= 'managerName'),
			'cancel': BtnWithText(formDriver, '取消'),
			'submit': BtnWithText(formDriver, '保存'),
		}

		self.sort = ['userName', 'mobilePhone', 'shortcode', 'workcode', 'tel', 'postcode', 'email', 'idcard', 'address', 'remark', 'roleIds', 'positionjob', 'saleAreaName', 'managerName']

		self.addForm = toDict(addForm)
Пример #5
0
	def __init__(self, driver):

		CommonPage.__init__(self, driver)

		formDriver = self.entry_form_by_id(id_= 'addBtn', formId= 'addModal')

		addForm = {
			'distributorName': InputWithName(formDriver, 'distributorName'),
			'contactName': InputWithName(formDriver, 'contactName'),
			'contactPhone': InputWithName(formDriver, 'contactPhone'),
			'saleTypeNames': InputWithName(formDriver, 'saleTypeNames'),
			'address': InputWithName(formDriver, 'address'),
			'tel': InputWithName(formDriver, 'tel'),
			'fax': InputWithName(formDriver, 'fax'),
			'email': InputWithName(formDriver, 'email'),
			'remark': InputWithName(formDriver, 'remark'),
			'provinceId': DropMenuWithText(formDriver, 'provinceId'),
			'cityId': DropMenuWithText(formDriver, 'cityId'),
			'districtId': DropMenuWithText(formDriver, 'districtId'),
			'saleAreaName': DropMenuWithText(formDriver, 'saleAreaName'),
			'distributorTypeName': DropMenuWithText(formDriver, 'distributorTypeName'),
			'busManagerName': PopMenuWithName(formDriver, dict(driver= driver, formId= 'srhMgrForm', srcName= 'userName', tblId= 'sautbl', btnOk= 'getMgrBtn'), name_= 'busManagerName'),
			'cancel': BtnWithText(formDriver, '取消'),
			'submit': BtnWithText(formDriver, '保存'),
		}

		self.sort = ['distributorName', 'contactName', 'contactPhone', 'saleTypes', 'address', 'tel', 'fax', 'email', 'remark', 'saleTypeNames','saleAreaName', 'busManagerName', 'distributorTypeName', 'provinceId', 'cityId', 'districtId']

		self.addForm = toDict(addForm)
Пример #6
0
	def advance_search(self, searchInfo):
		searchInfo = toDict(searchInfo)

		for key, value in self.searchForm.items():
			try:
				if isinstance(value, InputWithName):
					inputValue = searchInfo.get(key)
					value.type(inputValue)
				elif isinstance(value, DropMenuWithText):
					text = searchInfo.get(key)
					value.choose(text)
				elif isinstance(value, DropMenuWithTitle):
					text = searchInfo.get(key)
					value.choose_by_title(text)
				elif isinstance(value, PopMenuWithName):
					text = searchInfo.get(key)
					value.choose(text)
				elif isinstance(value, DatePiker):
					text = searchInfo.get(key)
					value.choose(text)
			except exceptions.NoSuchElementException as e:
				#若没找到元素,代表元素名称改变,或者元素不存在
				print '%s is not find' % key
				raise exceptions.NoSuchElementException

		self.searchForm.search.click()
Пример #7
0
	def add(self, addInfo):
		addInfo = toDict(addInfo)
		for sort in self.sort:
			for key, value in self.addForm.items():
				if key == sort:
					if isinstance(value, InputWithName):
						inputValue = addInfo.get(key)
						value.type(inputValue)
					elif isinstance(value, DropMenuWithText):
						text = addInfo.get(key)
						value.choose(text)
					elif isinstance(value, DropMenuWithTitle):
						text = addInfo.get(key)
						value.choose_by_title(text)
					elif isinstance(value, PopMenuWithName):
						text = addInfo.get(key)
						value.choose(text)
					elif isinstance(value, DatePiker):
						text = addInfo.get(key)
						value.choose(text)
					# elif isinstance(value, Radio):
					# 	text = addInfo.get(key)
					# 	value.choose(text)

		self.addForm.submit.click()
Пример #8
0
	def __init__(self, driver):

		CommonPage.__init__(self, driver)

		formDriver = self.entry_form_by_id(id_= 'addBtn', formId= 'addModal')

		addForm = {
			'kaName': InputWithName(formDriver, 'kaName'),
			'address': InputWithName(formDriver, 'address'),
			'tel': InputWithName(formDriver, 'tel'),
			'fax': InputWithName(formDriver, 'fax'),
			'email': InputWithName(formDriver, 'email'),
			'remark': InputWithName(formDriver, 'remark'),
			'provinceId': DropMenuWithText(formDriver, 'provinceId'),
			'cityId': DropMenuWithText(formDriver, 'cityId'),
			'districtId': DropMenuWithText(formDriver, 'districtId'),
			'saleAreaName': DropMenuWithText(formDriver, 'saleAreaName'),
			'kaTypeName': DropMenuWithText(formDriver, 'kaTypeName'),
			'cancel': BtnWithText(formDriver, '取消'),
			'submit': BtnWithText(formDriver, '保存'),
		}

		self.sort = ['kaName', 'address', 'tel', 'fax', 'email', 'remark', 'kaTypeName','saleAreaName', 'provinceId', 'cityId', 'districtId']

		self.addForm = toDict(addForm)
Пример #9
0
    def __init__(self, driver):

        CommonPage.__init__(self, driver)
        formDriver = self.entry_form_by_id(id_="distriBtn", formId="distriModal")

        self.relateDistributeForm = toDict(
            {
                "unrelate_menu": PopMenuWithName(
                    formDriver,
                    dict(
                        driver=driver,
                        formId="unSrhMgrForm",
                        srcName="distributorName",
                        tblId="undistrModalList",
                        btnOk="related_btn",
                    ),
                    id_="unrelated",
                ),
                "relate_menu": PopMenuWithName(
                    formDriver,
                    dict(
                        driver=driver,
                        formId="srhmgrForm",
                        srcName="distributorName",
                        tblId="distrModalList",
                        btnOk="setDefault_btn",
                    ),
                    id_="related",
                ),
                "setDefault": BtnWithId(formDriver, "setDefault_btn"),
                "exit": BtnWithId(formDriver, "distriModal_closeBtn"),
            }
        )

        self.page_control = PageControl(driver)
Пример #10
0
    def __init__(self, driver):

        CommonPage.__init__(self, driver)

        formDriver = self.entry_form_by_id(id_="addBtn", formId="addModal")

        addForm = {
            "storeName": InputWithName(formDriver, "storeName"),
            "contactName": InputWithName(formDriver, "contactName"),
            "contactPhone": InputWithName(formDriver, "contactPhone"),
            "saleTypes": InputWithName(formDriver, "saleTypes"),
            "address": InputWithName(formDriver, "address"),
            "tel": InputWithName(formDriver, "tel"),
            "fax": InputWithName(formDriver, "fax"),
            "email": InputWithName(formDriver, "email"),
            "remark": InputWithName(formDriver, "remark"),
            "provinceId": DropMenuWithText(formDriver, "provinceId"),
            "cityId": DropMenuWithText(formDriver, "cityId"),
            "districtId": DropMenuWithText(formDriver, "districtId"),
            "saleAreaName": DropMenuWithText(formDriver, "saleAreaName"),
            "storeTypeName": DropMenuWithText(formDriver, "storeTypeName"),
            "storeRankName": DropMenuWithText(formDriver, "storeRankName"),
            "busManagerName": PopMenuWithName(
                formDriver,
                dict(driver=driver, formId="srhMgrForm", srcName="userName", tblId="sautbl", btnOk="getMgrBtn"),
                name_="busManagerName",
            ),
            "kaName": PopMenuWithName(
                formDriver,
                dict(driver=driver, formId="srhMgrForm", srcName="kaName", tblId="katbl", btnOk="getKaBtn"),
                name_="kaName",
            ),
            "cancel": BtnWithText(formDriver, "取消"),
            "submit": BtnWithText(formDriver, "保存"),
        }

        self.sort = [
            "storeName",
            "contactName",
            "contactPhone",
            "saleTypes",
            "address",
            "tel",
            "fax",
            "email",
            "remark",
            "saleAreaName",
            "busManagerName",
            "storeRankName",
            "storeTypeName",
            "provinceId",
            "cityId",
            "districtId",
            "kaName",
        ]

        self.addForm = toDict(addForm)
Пример #11
0
	def __init__(self, driver):

		loginForm = {
			'username': InputWithName(driver, 'mobile'),
			'password': InputWithName(driver, 'password'),
			'validateCode': InputWithName(driver, 'validateCode'),
			'submit': BtnWithClass(driver, 'btn-blue'),
		}

		self.loginForm = toDict(loginForm)
Пример #12
0
	def __init__(self, driver):

		CommonPage.__init__(self, driver)

		formDriver = self.entry_form_by_text(text= '高级查询', formId= 'searchModal')

		searchForm = {
			'username': InputWithName(formDriver, 'username'),
			'kpiTypeName': DropMenuWithText(formDriver, 'kpiTypeName'),
			'search': BtnWithText(formDriver, '查询'),
		}

		self.searchForm = toDict(searchForm)
Пример #13
0
	def __init__(self, driver):

		CommonPage.__init__(self, driver)

		formDriver = self.entry_form_by_text(text= '高级查询', formId= 'searchModal')

		searchForm = {
			'saleAreaName': InputWithName(formDriver, 'saleAreaName'),
			'saleAreaManagerName': InputWithName(formDriver, 'saleAreaManagerName'),
			'status': DropMenuWithText(formDriver, 'status'),
			'search': BtnWithText(formDriver, '查询'),
		}

		self.searchForm = toDict(searchForm)
Пример #14
0
	def __init__(self, driver):

		CommonPage.__init__(self, driver)

		formDriver = self.entry_form_by_text(text= '高级查询', formId= 'searchModal')

		searchForm = {
			'userName': InputWithName(formDriver, 'userName'),
			'mobilePhone': InputWithName(formDriver, 'mobilePhone'),
			'workcode': InputWithName(formDriver, 'workcode'),
			'positionjob': DropMenuWithText(formDriver, 'positionjob'),
			'status': DropMenuWithText(formDriver, 'status'),
			'search': BtnWithText(formDriver, '查询'),
		}

		self.searchForm = toDict(searchForm)
Пример #15
0
	def __init__(self, driver):

		CommonPage.__init__(self, driver)

		formDriver = self.entry_form_by_text(text= '高级查询', formId= 'searchModal')

		searchForm = {
			'promotionName': InputWithName(formDriver, 'promotionName'),
			'promSpecifications': InputWithName(formDriver, 'promSpecifications'),
			'remark': InputWithName(formDriver, 'remark'),
			'status': DropMenuWithText(formDriver, 'status'),
			'promStartTime': DatePiker(formDriver, 'promStartTime'),
			'promEndTime': DatePiker(formDriver, 'promEndTime'),
			'search': BtnWithText(formDriver, '查询'),
		}

		self.searchForm = toDict(searchForm)
Пример #16
0
    def post(self):
        signature = self.get_argument('signature')
        timestamp = self.get_argument('timestamp')
        nonce =  self.get_argument('nonce')
        data = self.request.body
        if valid(signature, timestamp, nonce):
            message = toDict(data)
            message, xdict = return_back(message)
            if message and not is_query(message):
                return self.finish(message)
            elif is_query(message):
                suggestion(message[2:].strip(), partial(self.callback, xdict))
            else:
                return self.finish('not valid')

        else:
            return self.finish('not valid')
Пример #17
0
	def __init__(self, driver):

		CommonPage.__init__(self, driver)

		formDriver = self.entry_form_by_id(id_= 'addBtn', formId= 'addModal')

		addForm = {
			'saleAreaName': InputWithName(formDriver, 'saleAreaName'),
			'remark': InputWithName(formDriver, 'remark'),
			'pSaleAreaName': DropMenuWithTitle(formDriver, 'pSaleAreaName'),
			'saleAreaManagerName': PopMenuWithName(formDriver, dict(driver= driver, formId= 'srhMgrForm', srcName= 'userName', tblId= 'sautbl', btnOk= 'getMgrBtn'), name_= 'saleAreaManagerName'),
			'cancel': BtnWithText(formDriver, '取消'),
			'submit': BtnWithText(formDriver, '保存'),
		}

		self.sort = ['saleAreaName', 'pSaleAreaName', 'saleAreaManagerName', 'remark']

		self.addForm = toDict(addForm)
Пример #18
0
	def handover(self, handoverInfo):
		handoverInfo = toDict(handoverInfo)

		for key, value in self.handoverForm.items():
			if isinstance(value, InputWithName):
				inputValue = handoverInfo.get(key)
				value.type(inputValue)
			elif isinstance(value, DropMenuWithText):
				text = handoverInfo.get(key)
				value.choose(text)
			elif isinstance(value, DropMenuWithTitle):
				text = handoverInfo.get(key)
				value.choose_by_title(text)
			elif isinstance(value, PopMenuWithName):
				text = handoverInfo.get(key)
				value.choose(text)

		self.handoverForm.submit.click()
Пример #19
0
	def __init__(self, driver):

		CommonPage.__init__(self, driver)

		formDriver = self.entry_form_by_id(id_= 'addBtn', formId= 'addModal')

		addForm = {
			'name_': InputWithName(formDriver, 'name_'),
			'specification': InputWithName(formDriver, 'specification'),
			'remark': InputWithName(formDriver, 'remark'),
			'unitName': DropMenuWithText(formDriver, 'unitName'),
			'typeName': DropMenuWithText(formDriver, 'typeName'),
			'cancel': BtnWithText(formDriver, '取消'),
			'submit': BtnWithText(formDriver, '保存'),
		}

		self.sort = ['name_', 'specification', 'remark', 'unitName','typeName']

		self.addForm = toDict(addForm)
Пример #20
0
    def __init__(self, driver):

        CommonPage.__init__(self, driver)

        formDriver = self.entry_form_by_text(text="高级查询", formId="searchModal")

        searchForm = {
            "storeName": InputWithName(formDriver, "storeName"),
            "busManagerName": InputWithName(formDriver, "busManagerName"),
            "kaName": InputWithName(formDriver, "kaName"),
            "relationDistribute": InputWithName(formDriver, "relationDistribute"),
            "saleAreaName": DropMenuWithText(formDriver, "saleAreaName"),
            "storeRankName": DropMenuWithText(formDriver, "storeRankName"),
            "storeTypeName": DropMenuWithText(formDriver, "storeTypeName"),
            "status": DropMenuWithText(formDriver, "status"),
            "search": BtnWithText(formDriver, "查询"),
        }

        self.searchForm = toDict(searchForm)
Пример #21
0
	def __init__(self, driver):

		CommonPage.__init__(self, driver)

		formDriver = self.entry_form_by_id(id_= 'addBtn', formId= 'addModal')

		addForm = {
			'promotionName': InputWithName(formDriver, 'promotionName'),
			'promSpecifications': InputWithName(formDriver, 'promSpecifications'),
			'remark': InputWithName(formDriver, 'remark'),
			'promActivityTypeName': DropMenuWithText(formDriver, 'promActivityTypeName'),
			'promPutInType': Radio(formDriver, 'promPutInType'),
			'promPutInType1Ids': DropMenuWithText(formDriver, 'promPutInType1Ids'),
			'promPutInType2Ids': DropMenuWithText(formDriver, 'promPutInType2Ids'),
			'promPutInType3Values': PopMenuWithName(formDriver, dict(driver= driver, formId= 'productMdSrhForm', srcName= 'productName', tblId= 'productMdTblList', btnOk= 'getProductMgrBtn'), name_= 'promPutInType3Values'),
			'promStartTime': DatePiker(formDriver, 'promStartTime'),
			'promEndTime': DatePiker(formDriver, 'promEndTime'),
			'cancel': BtnWithText(formDriver, '取消'),
			'submit': BtnWithText(formDriver, '保存'),
		}

		self.addForm = toDict(addForm)
Пример #22
0
    def __init__(self, driver):

        CommonPage.__init__(self, driver)

        formDriver = self.entry_form_by_id(id_= 'addBtn', formId= 'addModal')

        addForm = {
            'promotionName': InputWithName(formDriver, 'promotionName'),
            'buyCount': InputWithName(formDriver, 'buyCount'),
            'giveCount': InputWithName(formDriver, 'giveCount'),
            'remark': InputWithName(formDriver, 'remark'),
            'productName': PopMenuWithName(formDriver, dict(driver= driver, formId= 'srhMgrForm', srcName= 'productName', tblId= 'producttbl', btnOk= 'getProductMgrBtn'), name_= 'productName'),
            'giftName': PopMenuWithName(formDriver, dict(driver= driver, formId= 'giftSearchForm', srcName= 'productName', tblId= 'gifttbl', btnOk= 'getGiftMgrBtn'), name_= 'giftName'),
            'promStartTime': DatePiker(formDriver, 'promStartTime'),
            'promEndTime': DatePiker(formDriver, 'promEndTime'),
            'cancel': BtnWithText(formDriver, '取消'),
            'submit': BtnWithText(formDriver, '保存'),
        }

        self.sort = ['promotionName', 'remark', 'productName', 'giftName', 'buyCount', 'giveCount', 'promStartTime', 'promEndTime']

        self.addForm = toDict(addForm)
Пример #23
0
	def __init__(self, driver):

		CommonPage.__init__(self, driver)

		formDriver = self.entry_form_by_id(id_= 'accBtn', formId= 'accModal')

		handoverForm = {
			'userName': InputWithName(formDriver, 'userName'),
			'shortcode': InputWithName(formDriver, 'shortcode'),
			'workcode': InputWithName(formDriver, 'workcode'),
			'tel': InputWithName(formDriver, 'tel'),
			'postcode': InputWithName(formDriver, 'postcode'),
			'email': InputWithName(formDriver, 'email'),
			'idcard': InputWithName(formDriver, 'idcard'),
			'address': InputWithName(formDriver, 'address'),
			'remark': InputWithName(formDriver, 'remark'),
			'positionjob': DropMenuWithText(formDriver, 'positionjob'),
			'saleAreaName': DropMenuWithTitle(formDriver, 'saleAreaName'),
			'managerName': PopMenuWithName(formDriver, dict(driver= driver, formId= 'mgrForm4edit', srcName= 'userName', tblId= 'sautbl4edit', btnOk= 'getMgrBtn4edit'), name_= 'managerName'),
			'cancel': BtnWithText(formDriver, '取消'),
			'submit': BtnWithText(formDriver, '保存'),
		}

		self.handoverForm = toDict(handoverForm)
Пример #24
0
	def add(self, addInfo):
		addInfo = toDict(addInfo)
		addForm = self.addForm

		addForm.get('promotionName').type(addInfo.get('promotionName'))
		addForm.get('promSpecifications').type(addInfo.get('promSpecifications'))
		addForm.get('remark').type(addInfo.get('remark'))

		addForm.get('promActivityTypeName').choose(addInfo.get('promActivityTypeName'))

		addForm.get('promPutInType').choose(addInfo.get('promPutInType'))
		if addInfo.has_key('promPutInType1Ids'):
			addForm.get('promPutInType1Ids').choose(addInfo.get('promPutInType1Ids'))
		elif addInfo.has_key('promPutInType2Ids'):
			addForm.get('promPutInType2Ids').choose(addInfo.get('promPutInType2Ids'))
		elif addInfo.has_key('promPutInType3Values'):
			addForm.get('promPutInType3Values').choose(addInfo.get('promPutInType3Values'))

		addForm.get('promStartTime').choose(addInfo.get('promStartTime'))
		addForm.get('promEndTime').choose(addInfo.get('promEndTime'))

		self.addForm.submit.click()
		self.page_control.loading()
		self.addForm.cancel.click()
Пример #25
0
	def __init__(self, driver, menuInfo, name_= None, id_= None):
		self.driver = driver
		self.name_ = name_
		self.id_ = id_
		self.menuInfo = toDict(menuInfo)