Exemplo n.º 1
0
 def choose_baby_category(self):
     # 输入关键词搜索,选中女装类目
     init_element(self.baby_category_locator).click()
     sleep(5)
     ReleaseCommonMethods().search_keyword('女装/女士精品>>连衣裙',
                                           poco(text="女装/女士精品>>连衣裙"))
     locate_by_anchor(poco(text="保证金1000/订单险/账期保障"), 1, 'l0').click()
 def reduction_and_margin(self, price_cut, earnest_money):
     # 降价幅度
     poco(name='android.widget.EditText')[3].set_text(price_cut)
     # 保证金
     poco(name='android.widget.EditText')[4].set_text(earnest_money)
     # 点击'计算降价周期'按钮
     init_element(self.price_cycle_button).click()
 def any_drop_fail(self):
     # 进入任意降页面
     self.auction_common.arbitrary_drop_page()
     # 输入拍卖数量,起拍价,保底价
     self.auction_common.number_and_price(1, 8888, 88888)
     # 设置时间
     self.auction_common.set_time()
     # 输入降价幅度和保证金,点击'计算降价周期'按钮
     self.auction_common.reduction_and_margin(888, 999)
     # 选择宝贝
     self.auction_common.choose_products()
     # 点击上架预展
     init_element(self.on_preview_locator).click()
     # 上架预展前判断是否需要授权
     if init_element(self.impower_locator).exists():
         self.auction_common.impower()
         # 点击上架预展
         init_element(self.on_preview_locator).click()
     # 断言
     try:
         # 确定上架预展是否存在
         poco(text='确定上架预展').exists()
         poco(text='确定上架预展').click()
     except Exception:
         return False
Exemplo n.º 4
0
 def place_and_store_category(self):
     # 切换回基本信息
     init_element(self.basic_information_locator).click()
     BasePage().page_swipe_buttom()
     # init_element(self.place_locator).click()
     init_element(self.store_category_locator).click()
     locate_by_anchor(poco(text="一级分类00"), 2, 'l0l0').click()
     poco(text="确定").click()
 def choose_products(self):
     # 等待页面跳转成功
     init_element(self.choose_products_locator).wait_for_appearance(10)
     # 点击'+'
     locate_by_anchor(init_element(self.choose_products_locator), 1,
                      'v0').click()
     # 搜索宝贝,点击'复制宝贝'
     CommonList().search_by_keyword('测试宝贝不发货', poco(text='测试宝贝不发货不发货'))
     poco(text='测试宝贝不发货不发货').click()
     init_element(self.copy_baby_button).click()
 def set_time(self):
     # 打开日历
     locate_by_anchor(init_element(self.starting_time_locator), 1,
                      'l1l1').click()
     # 点击确定
     poco(text="确定").click()
     # 切换到输入模式,获取分钟的文本信息,基础上加2分钟,如果到58时,则获取小时的文本,基础上加1小时
     init_element(self.input_pattern).click()
     minute1 = init_element(self.minute_locator).get_text()
     if int(minute1) == 58:
         hour1 = init_element(self.hour_locator).get_text()
         hour2 = int(hour1) + 1
         element_sendtext(self.hour_locator, hour2)
         # 点击确定
         poco(name="android:id/button1").click()
     else:
         minute2 = int(minute1) + 2
         element_sendtext(self.minute_locator, minute2)
         # 点击确定
         poco(name="android:id/button1").click()
 def nine_activities_fail(self):
     # 进入九块九页面
     self.auction_common.nine_page()
     # 选择宝贝
     self.auction_common.choose_products()
     # 输入拍卖数量
     self.auction_common.auction_number(999)
     # 点击上架预展
     init_element(self.on_preview_locator).click()
     # 上架预展前判断是否需要授权
     if init_element(self.impower_locator).exists():
         self.auction_common.impower()
         # 点击上架预展
         init_element(self.on_preview_locator).click()
     # 断言
     try:
         # 确定上架预展是否存在
         poco(text='确定上架预展').exists()
         poco(text='确定上架预展').click()
     except Exception:
         return False
 def price_is_empty(self):
     # 进入增价拍页面
     self.auction_common.pat_increase_page()
     # 选择宝贝
     self.auction_common.choose_products()
     # 输入重复上架,封顶价
     self.auction_common.repetition_and_top_price(9, 999999)
     # 设置时间
     self.auction_common.set_time()
     # 点击上架预展
     init_element(self.on_preview_locator).click()
     # 上架预展前判断是否需要授权
     if init_element(self.impower_locator).exists():
         self.auction_common.impower()
         # 点击上架预展
         init_element(self.on_preview_locator).click()
     # 断言
     try:
         # 确定上架预展是否存在
         poco(text='确定上架预展').exists()
         poco(text='确定上架预展').click()
     except Exception:
         return False
Exemplo n.º 9
0
 def price_and_quantity(self):
     poco('android.widget.RelativeLayout').swipe('down')
     # BasePage().page_swipe_buttom02()
     init_element(self.fixed_price_locator).click()
     poco(text='设置规格').wait_for_appearance(8)
     # 选择尺码
     init_element(self.choose_size_locator).click()
     poco(text="145/52A").click()
     poco(text="155/60A").click()
     poco(text='确定').click()
     init_element(self.choose_size_locator).invalidate()
     # 选择颜色
     sleep(3)
     init_element(self.choose_color_locator).click()
     poco(text="乳白色").click()
     poco(text="米白色").click()
     init_element(self.sure2_locator).click()
     # 批量填充价格和库存
     poco(text="批量填充").invalidate()
     poco(text="批量填充").click()
     locate_by_anchor(poco(text='价格'), 1, 'l1l0l0').set_text('10000000')
     locate_by_anchor(poco(text='库存'), 1, 'l1l0l0').set_text('999')
     poco(text="确认").click()
     poco(text="确定").click()
 def nine_activities_successful(self):
     # 进入九块九页面
     self.auction_common.nine_page()
     # 选择宝贝
     self.auction_common.choose_products()
     # 输入拍卖数量
     self.auction_common.auction_number(1)
     # 修改活动时间
     self.auction_common.activity_time()
     # 点击上架预展
     self.auction_common.click_on_preview_button()
     # 上架预展前判断是否需要授权
     if init_element(self.impower_locator).exists():
         self.auction_common.impower()
         # 点击上架预展
         self.auction_common.click_on_preview_button()
     sleep(5)
     # 返回拍卖主页
     poco(name="com.taobao.qianniu:id/qn_widmill_nav_bar_back_btn").click()
 def any_drop_warehouse(self):
     # 进入任意降页面
     self.auction_common.arbitrary_drop_page()
     # 输入拍卖数量,起拍价,保底价
     self.auction_common.number_and_price(1, 100, 88)
     # 设置时间
     self.auction_common.set_time()
     # 输入降价幅度和保证金,点击'计算降价周期'按钮
     self.auction_common.reduction_and_margin(5, 999)
     # 选择宝贝
     self.auction_common.choose_products()
     # 点击放入仓库中
     self.auction_common.in_warehouse()
     # 放入仓库中之前判断是否需要授权
     if init_element(self.impower_locator).exists():
         self.auction_common.impower()
         # 点击放入仓库中
         self.auction_common.in_warehouse()
     sleep(5)
     # 返回拍卖主页
     poco(name="com.taobao.qianniu:id/qn_widmill_nav_bar_back_btn").click()
 def pat_increase_warehouse(self):
     # 进入增价拍页面
     self.auction_common.pat_increase_page()
     # 选择宝贝
     self.auction_common.choose_products()
     # 输入起拍价,加价规则
     self.auction_common.rules_for_starting_price(123456, 321)
     # 输入重复上架,封顶价
     self.auction_common.repetition_and_top_price(0, 0)
     # 设置时间
     self.auction_common.set_time()
     # 点击放入仓库中
     self.auction_common.in_warehouse()
     # 放入仓库中之前判断是否需要授权
     if init_element(self.impower_locator).exists():
         self.auction_common.impower()
         # 点击放入仓库中
         self.auction_common.in_warehouse()
     sleep(5)
     # 返回拍卖主页
     poco(name="com.taobao.qianniu:id/qn_widmill_nav_bar_back_btn").click()
Exemplo n.º 13
0
 def add_main_pictures(self):
     # 从本地相册添加5张图片
     init_element(self.upload_pictures_locator).click()
     init_element(self.local_album_locator).click()
     init_element(self.picture_locator)[0].click()
     init_element(self.picture_locator)[1].click()
     init_element(self.picture_locator)[2].click()
     init_element(self.picture_locator)[3].click()
     init_element(self.picture_locator)[4].click()
     init_element(self.sure_locator).click()
Exemplo n.º 14
0
 def time_interval(self):
     init_element(self.time_release_locator).click()
Exemplo n.º 15
0
 def in_the_warehouse(self):
     init_element(self.in_warehouse_locator).click()
Exemplo n.º 16
0
 def immediately_release(self):
     init_element(self.now_release_locator).click()
 def get_amount_in_shots(self):
     in_shooting_quantity = locate_by_anchor(
         init_element(self.in_shooting_locator), 1, 'v0').get_text()
     print('创建活动开拍中的数量:', in_shooting_quantity)
     return in_shooting_quantity
Exemplo n.º 18
0
 def add_year_season(self):
     init_element(self.year_season_locator).wait_for_appearance(8)
     init_element(self.year_season_locator).click()
     # 显性等待跳转到宝贝属性页面
     init_element(self.baby_attribute_locator).wait_for_appearance(8)
     init_element(self.year_season_locator).click()
     poco(text="2016年冬季").click()
     init_element(self.article_number_locator).wait_for_appearance(8)
     locate_by_anchor(init_element(self.article_number_locator), 2,
                      'l1l0l0').set_text('00123')
     init_element(self.save_locator).click()
 def rules_for_starting_price(self, starting_price, rules):
     init_element(self.bottom_price_locator).set_text(starting_price)
     init_element(self.bottom_price_locator)[1].set_text(rules)
 def in_warehouse(self):
     init_element(self.in_warehouse_locator).click()
     init_element(self.sure_in_warehouse_locator).click()
 def repetition_and_top_price(self, repetition, top_price):
     init_element(self.bottom_price_locator)[2].set_text(repetition)
     init_element(self.bottom_price_locator)[3].set_text(top_price)
 def auction_number(self, number):
     init_element(self.number_locator).set_text(number)
 def get_amount_in_preview(self):
     pre_creation_quantity = locate_by_anchor(
         init_element(self.in_preview_locator), 1, 'v0').get_text()
     print('创建活动预展中的数量:', pre_creation_quantity)
     return pre_creation_quantity
 def nine_page(self):
     init_element(self.sign_up_immediately_locator).click()
Exemplo n.º 25
0
 def edit_baby_title(self):
     locate_by_anchor(init_element(self.baby_title_locator), 2,
                      'v1v0v0v0v0').set_text('女装,发布宝贝测试用')
Exemplo n.º 26
0
    def choose_freight_template(self):

        init_element(self.freight_locator).click()
        poco(text="我的模板1").click()
        poco(text="确认").click()
Exemplo n.º 27
0
 def add_details_description(self):
     init_element(self.details_description_locator).click()
     init_element(self.add_text_locator).click()
     locate_by_anchor(poco(text='取消'), 2,
                      'v0v0v0v0').set_text('发布宝贝测试,不发货不发货不发货不发货不发货......')
     poco(text="确定").click()
 def click_on_preview_button(self):
     init_element(self.on_preview_locator).click()
     init_element(self.confirm_shelf_locator).click()
 def get_amount_in_warehouse(self):
     in_warehouse_quantity = locate_by_anchor(
         init_element(self.in_warehouse_locator2), 1, 'v0').get_text()
     print('创建活动仓库中的数量:', in_warehouse_quantity)
     return in_warehouse_quantity