def test2_mark_as_unstar(self): """测试随机批量邮件标记为星标""" # 快捷登录网页 pl = PageLogin(self.driver) pl.quick_login() # 进入收件箱 ree = ReceiveEmail(self.driver) ree.goto_inbox() # 随机批量勾选:暂定三个 self.driver.switch_to.frame("mainFrame") ree.check_multi(0) # 标记为星标邮件 ree.mark_as_unstar() # 验证已标记为星标 self.driver.switch_to.default_content() assert (ree.star_mail_statistics() <= "21"), "标记星标邮件失败"
def test2_mark_as_unread(self): """测试随机批量未读标记为已读""" # 快捷登录网页 pl = PageLogin(self.driver) pl.quick_login() # 进入收件箱 ree = ReceiveEmail(self.driver) ree.goto_inbox() # 随机批量勾选:暂定三个 self.driver.switch_to.frame("mainFrame") ree.check_multi(1) # 标记为未读 ree.mark_as_read() sleep(2) # 未读邮件统计 assert (self.driver.find_element_by_id("_ur_c").text == "21"), "标记未读失败"
def test2_batch_del(self): """随机批量删除""" # 快捷登录网页 pl = PageLogin(self.driver) pl.quick_login() # 进入收件箱 ree = ReceiveEmail(self.driver) ree.goto_inbox() # 随机批量勾选:暂定三个 self.driver.switch_to.frame("mainFrame") ree.check_multi(0) # 删除勾选的邮件 ree.del_email() sleep(2) # 删除会出现提示 self.driver.switch_to.default_content() assert (ree.get_message_box() == "删除成功 [撤销]"), "未删除成功"
def test2_batch_del(self): """随机批量彻底删除""" # 快捷登录网页 pl = PageLogin(self.driver) pl.quick_login() # 进入收件箱 ree = ReceiveEmail(self.driver) ree.goto_inbox() # 随机批量勾选:暂定三个 self.driver.switch_to.frame("mainFrame") ree.check_multi(0) # 删除勾选的邮件 ree.completely_del_email() # 删除会出现提示 self.driver.switch_to.default_content() ree.prompt_confirmation(0) assert (ree.get_message_box() == "删除成功 [撤销]"), "未删除成功" # 切换到已删除目录,查看彻底删除的邮件是否存在 ree.verify_complete_deletion()
def test2_move_to_sent(self): """测试随机批量勾选邮件标移动到已发送""" # 快捷登录网页 pl = PageLogin(self.driver) pl.quick_login() # 先进入已发送目录,得到初始的已发送信件数:mail_num1 ree = ReceiveEmail(self.driver) mail_num1 = ree.sent_mail_statistics() # 进入收件箱 ree.goto_inbox() # 随机批量勾选:暂定三个 self.driver.switch_to.frame("mainFrame") ree.check_multi(0) # 移动到已发送目录,并对提示信息进行验证 ree.move_to_sent() sleep(1) self.driver.switch_to.default_content() ree.prompt_confirmation(1) # TODO:类似这种地方是否要使用try,之后再做修改吧 assert (ree.get_message_box() == "已将邮件成功移动 [查看] [撤销]"), "移动信件失败" # 进一步验证已发送目录下的信件有没有增加,获取已发送信件数量:mail_num2 mail_num2 = ree.sent_mail_statistics() assert (int(mail_num2) - int(mail_num1) == 3), "信件没有移动到已发送目录"