| | |
| | | from selenium.webdriver.common.by import By |
| | | |
| | | # elements = [ |
| | | # {'name': 'start_btn', 'desc': '开始测试按钮', 'loc': (By.XPATH, "//button"), 'action': 'click()'}, |
| | | # {'name': 'options', 'desc': '题目选项', 'loc': (By.XPATH, "//span[@class='q-item-span-content']"), 'action': None}, |
| | | # {'name': 'continue_testing_btn', 'desc': '继续测试按钮', 'loc': (By.XPATH, "//button/span[text()='继续测试']"), 'action': None}, |
| | | # {'name': 'submit_btn', 'desc': '提交按钮', 'loc': (By.XPATH, "//button/span[contains(text(),'提交')]/.."), 'action': None}, |
| | | # {'name': 'upload_success_title', 'desc': '上传成功标题', |
| | | # 'loc': (By.XPATH, "//main/h2[contains(text(), '数据已经成功地上传至服务器')]"), 'wait': 10, 'action': 'text()'}, |
| | | # {'name': 'loading_text', 'desc': '加载框文字', 'loc': (By.XPATH, "//div[@class='el-loading-spinner']/p"), |
| | | # 'action': 'text()'}, |
| | | # {'name': 'title', 'desc': '标题文字', 'loc': (By.XPATH, "//div[@class='align-center']/span[2]"), 'wait': 10, 'action': 'text()'}, |
| | | # ] |
| | | |
| | | class MAQAnswerElements: |
| | | # 开始测试按钮 |
| | | start_btn = (By.XPATH, "//button") |
| | | start_btn = (By.XPATH, "//button[1]") |
| | | # 题目 |
| | | q_title = (By.XPATH, "//div[@class='q-title']") |
| | | # 题目选项 |
| | | options = (By.XPATH, "//span[@class='q-item-span-content']") |
| | | options = (By.XPATH, "//label[@class='el-radio']") |
| | | # 禁用的选项 |
| | | disabled = (By.XPATH, "//label[@aria-disabled='true']") |
| | | # 继续测试按钮 |
| | | continue_testing_btn = (By.XPATH, "//button/span[text()='继续测试']") |
| | | continue_testing_btn = (By.XPATH, "//button[1]") |
| | | # 提交按钮 |
| | | submit_btn = (By.XPATH, "//button/span[contains(text(),'提交')]/..") |
| | | submit_btn = (By.XPATH, "//button[2]") |
| | | # 练习提交按钮 |
| | | exercise_submit_btn = (By.XPATH, "//button[1]") |
| | | # 上传成功标题 |
| | | upload_success_title = (By.XPATH, "//main/h2[contains(text(), '数据已经成功地上传至服务器')]") |
| | | # 上传成功标题 |
| | | network_exception_title = (By.XPATH, "//main/h2[contains(text(), '网络异常')]") |
| | | |
| | | # 加载框文字 |
| | | loading_text = (By.XPATH, "//div[@class='el-loading-spinner']/p") |
| | | |
| | | # 事中提示语内容 |
| | | hint_text = (By.XPATH, "//main[@class='el-main']/div/p[2]/span[3]/font") |
| | | |
| | | # 标题文字 |
| | | title = (By.XPATH, "//div[@class='align-center']/span[2]") |
| | | |
| | | # 关闭按钮 |
| | | close_btn = (By.XPATH, "//button[1]") |