pyautogui.press('left', presses=3)
@pytest.mark.run(order=300005)
@allure.title("enter,点击ALT+enter,点击shift+enter")
def test_快捷键验证(self):
try:
shift_en(self.driver.find_element(by=By.NAME, value="请输入内容..."))
self.driver.find_element(By.XPATH, '//Document[@Name="hwork-desktop-im"]/Group/Text').click()
self.driver.find_element(By.XPATH, '//Document[@Name="hwork-desktop-im"]/Group/Text').send_keys("醉卧沙场君莫笑")
pyautogui.press('left', presses=3)
time.sleep(1)
pyautogui.hotkey('alt', 'enter')
assert self.driver.find_element(By.XPATH, '//Document[@Name="hwork-desktop-im"]/Group/Text[2]').text == '君莫笑'
self.driver.find_element(By.XPATH, '//Document[@Name="hwork-desktop-im"]/Button[@Name="发送"]').click()
self.driver.find_element(By.XPATH, '//Document[@Name="hwork-desktop-im"]/Group/Text').click()
self.driver.find_element(By.XPATH, '//Document[@Name="hwork-desktop-im"]/Group/Text').send_keys("大漠风尘日色昏")
pyautogui.press('left', presses=3)
time.sleep(1)
pyautogui.hotkey('shift', 'enter')
assert self.driver.find_element(By.XPATH,
'//Document[@Name="hwork-desktop-im"]/Group/Text[2]').text == '日色昏'
self.driver.find_element(By.XPATH, '//Document[@Name="hwork-desktop-im"]/Button[@Name="发送"]').click()
finally:
self.driver.close()