(driver, distance)
| 101 | |
| 102 | |
| 103 | def start_drag(driver, distance): |
| 104 | |
| 105 | # 被妖怪吃掉了 |
| 106 | # knob = WAIT.until(EC.presence_of_element_located((By.CSS_SELECTOR, "#gc-box > div > div.gt_slider > div.gt_slider_knob.gt_show"))) |
| 107 | # ActionChains(driver).click_and_hold(knob).perform() |
| 108 | # ActionChains(driver).move_by_offset(xoffset=distance, yoffset=0.1).perform() |
| 109 | # time.sleep(0.5) |
| 110 | # ActionChains(driver).release(knob).perform() |
| 111 | |
| 112 | # 被妖怪吃掉了 |
| 113 | # ActionChains(driver).drag_and_drop_by_offset(knob, distance-10, 0).perform() |
| 114 | |
| 115 | knob = WAIT.until(EC.presence_of_element_located((By.CSS_SELECTOR, "#gc-box > div > div.gt_slider > div.gt_slider_knob.gt_show"))) |
| 116 | result = get_path(distance) |
| 117 | ActionChains(driver).click_and_hold(knob).perform() |
| 118 | |
| 119 | for x in result: |
| 120 | ActionChains(driver).move_by_offset(xoffset=x, yoffset=0).perform() |
| 121 | |
| 122 | time.sleep(0.5) |
| 123 | ActionChains(driver).release(knob).perform() |
| 124 | |
| 125 | |
| 126 | def recognize_code(driver): |
no test coverage detected