示例#1
0
class TestAddMember:

    def setup_class(self):
        self.app = App()

    def teardown_class(self):
        self.app.quit()

    def test_add_member_success(self):
        self.app.start().main().goto_contact().goto_add_member().manual_add_member().add_member('noha','13011100011')
示例#2
0
class TestContact:
    def setup_class(self):
        self.fake = Faker('zh_CN')
        # 启动app
        self.app = App()

    def setup(self):
        self.main = self.app.start().goto_main()

    def teardown(self):
        self.app.back()

    def teardown_class(self):
        self.app.stop()

    def test_addcontact(self):
        name = self.fake.name()
        phonenum = self.fake.phone_number()
        result = self.main.goto_contact(). \
            click_addmember().click_addmember_menual(). \
            edit_member(name, phonenum).verify_toast()
        assert result

    def test_addcontact1(self):
        name = self.fake.name()
        phonenum = self.fake.phone_number()
        result = self.main.goto_contact(). \
            click_addmember().click_addmember_menual(). \
            edit_member(name, phonenum).verify_toast()
        assert result
示例#3
0
class TestContact:
    def setup_class(self):
        self.contactinfo = ContactInfo()
        self.app = App()

    def setup(self):
        # 启动
        self.main = self.app.start().goto_main()

    def teardown(self):
        self.app.restart()

    def teardown_class(self):
        self.app.stop()

    def test_addcontact(self):
        name = self.contactinfo.get_name()
        phonenum = self.contactinfo.get_phonenum()
        self.main.goto_contactList().goto_addmember().\
            addmember_bymenual().edit_member(name,phonenum).find_tost()

    def test_addcontact1(self):
        name = self.faker.name()
        phonenum = self.faker.phone_number()
        self.main.goto_contactList().goto_addmember(). \
            addmember_bymenual().edit_member(name,phonenum).find_tost()

    def test_deletecontact(self):
        self.main.goto_contactList().goto_contactinfo().delete_contact()
示例#4
0
class TestWeixin:
    def setup(self):
        #初始化app
        self.app = App()
        self.main = self.app.start().main()

    def test_addcontact(self):
        element = self.main.goto_address().add_member().add_member_manul().input_name().input_phone().set_gender().click_save()
        assert '成功' in element.goto_toast()
示例#5
0
class TestContact:
    def setup(self):
        self.app = App()
        self.main = self.app.start().goto_main()

    def test_addcontact(self):
        name = "hogwarts"
        gender = "男"
        phone_number = "11111111111"
        result = self.main.goto_address().click_addmember().add_member_menual().add_contact(name, gender, phone_number)
示例#6
0
class TestContact:
    def setup(self):
        self.app = App()
        self.main = self.app.start().goto_main()

    def teardown(self):
        self.app.stop()

    @pytest.mark.parametrize("name,gender,phonenum",get_data())
    def test_add_contact(self,name,gender,phonenum):
        # name = "zhangsi2"
        # gender = '男'
        # phonenum = '13300000002'
        toast = self.main.click_addresslist().add_member().addconect_menual().\
            edit_name(name).edit_gender(gender).edit_phonenum(phonenum).click_save().get_toast()
        assert toast == "添加成功"
示例#7
0
class TestWexin:
    def setup(self):
        """
        启动app
        """
        self.app = App()
        self.main = self.app.start().goto_main()

    def teardown(self):
        self.app.stop()

    @pytest.mark.parametrize('name,gender,phonenum', get_contact())
    def test_addcontact(self, name, gender, phonenum):
        mypage = self.main.goto_addresslist().add_member().addmember_menual() \
            .edit_name(name).edit_gender(gender).edit_phonenum(phonenum) \
            .click_save()

        mytoast = mypage.get_toast()
        assert mytoast == '添加成功'
示例#8
0
class TestConnect():
    def setup(self):
        self.app=App();
    def setup(self):
        self.app = App()
        self.main = self.app.start().gotoMain()

    def teardown(self):
        self.app.stop()



    @pytest.mark.parametrize("name,gender,phone",get_data())

    def test_add_contact(self,name,gender,phone):
        # name = 'zhangsan4'
        # gender = '男'
        # phone = '19800000004'
        toast = self.main.click_addresslist().add_member().addmember_Byhand(). \
            edit_name(name).edit_gender(gender).edit_phonenum(phone).click_save().go_toast()
        assert toast == "添加成功"
示例#9
0
class TestContact:
    def setup_class(self):
        self.app = App()
        self.main = self.app.start().goto_main()

    def teardown_class(self):
        self.app.stop()

    @pytest.mark.skip
    @pytest.mark.parametrize("name,gender,phonenum", get_data("add"))
    def test_add_member(self, name, gender, phonenum):
        #添加成员测试
        # name = "zhangsan3"
        # gender = "男"
        # phonenum = "13101018824"
        toast = self.main.click_addresslist().add_member().addconect_menual().edit_name(name).\
            edit_gender(gender).edit_phone(phonenum).click_save().get_toast()
        assert toast

    def test_personal_info(self):
        #查看个人信息,所属部门
        department = self.main.click_addresslist().view_personal_information(
            "哈哈").get_department_name()
        assert department == "李佳铺子"
示例#10
0
class TestContact:
    def setup(self):
        '''
        应用的启动
        :return:
        '''
        self.app = App()
        self.main = self.app.start().goto_main()

    def teardown(self):
        '''
        应用的关闭
        :return:
        '''
        self.app.stop()

    def test_addcontact(self):
        name = "hogwarts002"
        gender = "男"
        phonenum = "13600000002"
        mypage = self.main.goto_addresslist().add_memeber().addcontact_menual() \
            .edit_name(name).edit_gender(gender).edit_phonenum(phonenum).click_save()
        mytoast = mypage.get_toast()
        assert "添加成功" == mytoast