From 7d65782728db3a3abeb907bfd4dae0ad6859aef4 Mon Sep 17 00:00:00 2001 From: fangchen <2027002340@qq.com> Date: Mon, 20 May 2024 18:31:40 +0800 Subject: [PATCH 1/5] fixbug555 --- app/templates/userpage_get.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/templates/userpage_get.html b/app/templates/userpage_get.html index 68997ef..fe812a6 100644 --- a/app/templates/userpage_get.html +++ b/app/templates/userpage_get.html @@ -157,6 +157,7 @@ update(data['today_article']); check_pre(data['visited_articles']); check_next(data['result_of_generate_article']); + toggleHighlighting(); } } }); @@ -170,6 +171,7 @@ if(data['today_article']){ update(data['today_article']); check_pre(data['visited_articles']); + toggleHighlighting(); } } }); From 6500eeca8412ea4faed66b1761b06560ca84e9f4 Mon Sep 17 00:00:00 2001 From: fangchen <2027002340@qq.com> Date: Mon, 20 May 2024 19:03:33 +0800 Subject: [PATCH 2/5] test bug --- app/test/test_bug555_fangchen.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 app/test/test_bug555_fangchen.py diff --git a/app/test/test_bug555_fangchen.py b/app/test/test_bug555_fangchen.py new file mode 100644 index 0000000..e69de29 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 3/5] 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 0000000000000000000000000000000000000000..3958c610e92d3bd1a5bf6e23c85d963d754a90c2 GIT binary patch literal 2603 zcmbUjOKTfPcvjDmCE1P?%XS>wN*X6t+9-Cx4Y;Mm4+Tn!2~ADNqDEb5NA@baT6K2U zwu}vd=HNgfIW;+^P-sE|`3)_lE%ag|6`P4o1Eq)D0zS0l)R|e0*LjpcR@(XAkNIZi zoBcf=Zv*rhK6$=;JqW;Gj1Z5nh3wv=$ZenkRnmbhap*JrC7%S0fE<)uNk|THNmveZ z2xUm2PmdUFavRt2>ro>n$2cC)<3_vO&hen$VRXu!91rOSjD(!zcvwGZbje*tN=_Nw za<|bV_i#ScdyPZ#A&y5V-Y54_yzM%W57(tk^eIbwCL@u^A}Xp_TR@l+v5AtcnboOz zMXOqr_D$C57{7#y(_H0}qS=&@L`yYPvXNRS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/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 From 35a6f1c82886174f2ebfae3a290ccf8af3bac146 Mon Sep 17 00:00:00 2001 From: fangchen <2027002340@qq.com> Date: Mon, 20 May 2024 21:25:51 +0800 Subject: [PATCH 4/5] fix --- .../conftest.cpython-312-pytest-8.2.1.pyc | Bin 832 -> 836 bytes ...g555_fangchen.cpython-312-pytest-8.2.1.pyc | Bin 2603 -> 3028 bytes app/test/conftest.py | 2 +- app/test/test_bug555_fangchen.py | 4 +--- 4 files changed, 2 insertions(+), 4 deletions(-) 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 index 7e9f8cacbfa3f7568903180c0243b5bd35e38e4a..21d8cb176631685df758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_1!mG-Ymw^W?md+g#r+aSI~d z1oIh5Hpn{&*Bwh|3GB+PP%NFLK#az9f^GV)i6Xdy2&l2ABBFD&WM0zQ#BCg5&LGbj z?6L%y%VZ=G^Ez1!Rmv!cP8B!W&1mIaX039^^NMIvQxr0MB5P&2&Kf3qCY{!h5zRt;$0{`wgcfo?6kvXQoIqSz?~N15YkUc53bgi_rS5g oS%zue1*G~5wBGTAwn8OODDMdsJnfsVhio$w-i^AML*_{T0;y`b+yDRo delta 1229 zcmah}%}X0W6rbJfZYGIIG|^~``S2r}wQAc#TWCv5H3^E~U7@BiyD6LI!*14(mIOU` zh)_^js2(j8R22Fj6bhw1^pcR2gvEl_LJxu$@zj~bbxR9&VCVhbd%yY3o7uNpX+LbW zd^4Mk0FA)lWPFX@vUCvpTLarR4seE~Gv%6b5r8wUftjwYUmx`hCkl(aDDM$&+msG~ zZ6FbNF&+t0KGAg=^S}T|kOK({xm_NP$P;y!X|VpBB`A-OUE>^iNH)TGQZlQA95}p` z&g*izgjJ1eHb<%q0w6{U-YEs!$GadNrT$s!`2K-6~G>s7SMon+bC;esxBzE=jA_phf>zEmW(?(>c0P ztxFR!{w36hPvh0{CN2L8^fq4bHJl}|teXZ)1luH^QXK|G9~C7bmgHrlf$dRRl9?zM zN%PB6T>kqUfP*Bz?BVNKV3B|KJk1m(QG{qYI37nlvxy6KI%zQFSxde2XFz|i_n_#%t1 z`fbP_X22K56YkToZn?#HPWWV_Y4nDOzkLzk@BuhOGY|*RbO9fxGTcIve Date: Sun, 1 Sep 2024 07:38:49 +0800 Subject: [PATCH 5/5] conftest.py: remove the extra blank line in the file --- app/test/conftest.py | 1 - 1 file changed, 1 deletion(-) diff --git a/app/test/conftest.py b/app/test/conftest.py index aab8a4d..ed4186c 100644 --- a/app/test/conftest.py +++ b/app/test/conftest.py @@ -33,4 +33,3 @@ def restore_sqlite_database(): def restart_englishpal(restore_sqlite_database): (Path(__file__).parent / '../main.py').touch() time.sleep(1) -