From a42e63dc277b87b4ad2d240617b2d4068a3f6883 Mon Sep 17 00:00:00 2001 From: fangchen <2027002340@qq.com> Date: Mon, 20 May 2024 19:23:31 +0800 Subject: [PATCH] test bug555 --- .../conftest.cpython-312-pytest-8.2.1.pyc | Bin 0 -> 832 bytes ...g555_fangchen.cpython-312-pytest-8.2.1.pyc | Bin 0 -> 2603 bytes app/test/test_bug555_fangchen.py | 45 ++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 app/test/__pycache__/conftest.cpython-312-pytest-8.2.1.pyc create mode 100644 app/test/__pycache__/test_bug555_fangchen.cpython-312-pytest-8.2.1.pyc diff --git a/app/test/__pycache__/conftest.cpython-312-pytest-8.2.1.pyc b/app/test/__pycache__/conftest.cpython-312-pytest-8.2.1.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7e9f8cacbfa3f7568903180c0243b5bd35e38e4a GIT binary patch literal 832 zcmZ`$L2DC16n?XtY&L0A0;Xawq39`>Z7PTmM5?t1QGyt9Sr)=3J4vVAO_rIBbwwd! z(X*%EPY{2K7r~1x6bpLsmXcdfzM1W&_24Y~=6i46d-LY|zLv`+!1by2WDpa8U((5z zb^#Xe5zN2?kN98{wQGUi*9ZhTJ5SOR!#40l^9zA#n<}RJ#h_%D2vFnTde-!E_j1SZ z<-)aB|C5uyl2eXJ-S{IbT6K~Xk7&>1>;>iMTzf|{s%pIYT4MGl%#YYeB&$1N++BJb-7r=!bOrJg zvGK^_^oS!dNpTrU3R$d##WKC?^2A7CVhZZh5t{_*;8x~ZOKGkCI0&$_m&)7iU(uIK zDU$*!5KTB$1glpm_0;t0#pmX|VC+qNdY|9G0!f9~K{MA0AwL0*;a&LzYA4V-C4~>Q ex3x2kkXs8Kw8~tfxe1z?#x=68;%6Enb;Dowe#DIc literal 0 HcmV?d00001 diff --git a/app/test/__pycache__/test_bug555_fangchen.cpython-312-pytest-8.2.1.pyc b/app/test/__pycache__/test_bug555_fangchen.cpython-312-pytest-8.2.1.pyc new file mode 100644 index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L=&mu4~2griSjaxHW-dL#NxoO>Af0}lTC z%nu?5UtvGD*lK^9OP&jXUqS=tj`=hFbnP8Yx9QDHVrOf0TK5*!Td399N@Nv_E-t%i zvluO6x~e3y$71`@<+V{`zHkaA0h?a1B;+zkz;QH{K#T6gs^%E(SxE>oyZ5Ewo`}P* z3bG~BFlhK<-90`1uTim_TFu0E*3sM}aOnSaaF`YWr|CdEtyTymzA7xtu3sEs1M4C< z%Jd=qGAXlJ@?(S9y~}s#eXvVWfKSljIsC{lRYyl3;}0px?qll%Iz01BlJqA4*TL7( q#~}U~M0dcz4tSUU&+LG+|M(=SYZuVrZ_u{`dUgXnQW}p_)BgbPk8R@s literal 0 HcmV?d00001 diff --git a/app/test/test_bug555_fangchen.py b/app/test/test_bug555_fangchen.py index e69de29..f7cee42 100644 --- a/app/test/test_bug555_fangchen.py +++ b/app/test/test_bug555_fangchen.py @@ -0,0 +1,45 @@ +import time +import pytest +import uuid +from selenium import webdriver +from selenium.webdriver import ActionChains +from selenium.webdriver.common.by import By +from selenium.webdriver.support.ui import WebDriverWait +from selenium.webdriver.support import expected_conditions as EC +from selenium.common.exceptions import UnexpectedAlertPresentException, NoAlertPresentException, NoSuchElementException, \ + TimeoutException +from conftest import driver +from conftest import URL + +def test_bug555(): + driver = webdriver.Edge() + try: + driver.maximize_window() + base_url = "http://127.0.0.1:5000" + driver.get(base_url) + article = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.ID, 'article'))) + perform_actions_on_article(driver, article) + + next_button = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.ID, 'load_next_article'))) + next_button.click() + print("Clicked next article button.") + + prev_button = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.ID, 'load_pre_article'))) + prev_button.click() + print("Clicked previous article button.") + + except (TimeoutException, NoSuchElementException) as e: + print(f"An error occurred: {e}") + + finally: + driver.quit() + print("Driver closed.") + +def perform_actions_on_article(driver, article): + actions = ActionChains(driver) + actions.move_to_element(article) + actions.click_and_hold() + actions.move_by_offset(450, 200) + actions.release() + actions.perform() + print("Performed actions on article.") \ No newline at end of file