Compare commits

..

7 Commits

Author SHA1 Message Date
mrlan 74186df292 Merge pull request 'DONE: bug555-fangchen' (#123) from bug555-fangchen into Alpha-snapshot20240618
Reviewed-on: #123
2024-09-01 07:39:04 +08:00
Lan Hui db652d3bf2 conftest.py: remove the extra blank line in the file 2024-09-01 07:38:49 +08:00
Lan Hui b43174ffba Resolve merge conflicts 2024-09-01 07:35:50 +08:00
方晨 35a6f1c828 fix 2024-05-20 21:25:51 +08:00
方晨 a42e63dc27 test bug555 2024-05-20 19:23:31 +08:00
方晨 6500eeca84 test bug 2024-05-20 19:03:33 +08:00
方晨 7d65782728 fixbug555 2024-05-20 18:31:40 +08:00
2 changed files with 45 additions and 0 deletions

View File

@ -284,6 +284,7 @@
update(data['today_article']);
check_pre(data['visited_articles']);
check_next(data['result_of_generate_article']);
toggleHighlighting();
}
}
});
@ -300,6 +301,7 @@
e.style.display = 'none';
update(data['today_article']);
check_pre(data['visited_articles']);
toggleHighlighting();
}
}
});

View File

@ -0,0 +1,43 @@
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 URL
driver = webdriver.Chrome()
def test_bug555():
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.")