| | |
| | | """ |
| | | 分享链接打开的页面 |
| | | """ |
| | | |
| | | def name_input(self, name): |
| | | """ |
| | | 输入姓名 |
| | |
| | | self.click(Share.submit_btn) |
| | | time.sleep(2) |
| | | |
| | | def fill_info_CIAQ(self, info): |
| | | """ |
| | | CIAQ产品包填写基本信息 |
| | | :param info: |
| | | :return: |
| | | """ |
| | | self.send_text_wait(info["email"], Share.ciaq_email_input) |
| | | self.selector(Share.ciaq_sex_select, Share.ciaq_sex_option, info["sex"]) |
| | | self.send_text_wait(info["age"], Share.ciaq_age_input) |
| | | self.selector(Share.ciaq_grade_select, Share.ciaq_grade_option, info["grade"]) |
| | | self.send_text_wait(info["address"], Share.ciaq_address_input) |
| | | self.send_text_wait(info["university"], Share.ciaq_university_input) |
| | | self.send_text_wait(info["universityAddress"], Share.ciaq_universityAddress_input) |
| | | self.send_text_wait(info["college"], Share.ciaq_college_input) |
| | | self.send_text_wait(info["major"], Share.ciaq_major_input) |
| | | self.selector(Share.ciaq_subject_select, Share.ciaq_subject_option, info["subject"]) |
| | | self.send_text_wait(info["GPA"], Share.ciaq_GPA_input) |
| | | self.send_text_wait(info["work"], Share.ciaq_work_input) |
| | | self.selector(Share.ciaq_status_select, Share.ciaq_status_option, info["status"]) |
| | | self.selector(Share.ciaq_workExperience_select, Share.ciaq_workExperience_option, info["workExperience"]) |
| | | self.click_wait(Share.submit_btn) |
| | | |
| | | def selector(self, select_loc, options_loc, text): |
| | | """ |
| | | 通用选择器,直接调用选择下拉框选项 |
| | | :param select_loc: 点击后出现下拉选项的元素定位 |
| | | :param options_loc: 选项的元素定位 |
| | | :param text: 判断点击的文本 |
| | | :return: |
| | | """ |
| | | # 点击下拉框 |
| | | self.click_wait(select_loc) |
| | | time.sleep(1) |
| | | # 获取所有选项 |
| | | options = self.get_elements_wait(options_loc) |
| | | # 判断选项是否与传入的选项相等 |
| | | for opt in options: |
| | | if opt.text == text: |
| | | # 相等则点击该选项 |
| | | opt.click() |
| | | break |