mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
update test
This commit is contained in:
parent
f10b35aaa8
commit
f5386016d2
3 changed files with 9 additions and 12 deletions
|
|
@ -114,22 +114,21 @@ try:
|
|||
|
||||
delete_ban_checkbox = safe_get_element(DRIVER, By.XPATH, "//input[@id='ban-item-2']")
|
||||
assert isinstance(delete_ban_checkbox, WebElement), "Delete checkbox is not WebElement"
|
||||
DRIVER.execute_script("arguments[0].click()", delete_ban_checkbox)
|
||||
DRIVER.execute_script(f"""document.querySelector('input[id="ban-item-2"]').click()""")
|
||||
|
||||
log_info("Ban item id=2 checkbox clicked ...")
|
||||
|
||||
unban_button = safe_get_element(DRIVER, By.XPATH, "//button[@data-unban-btn='']")
|
||||
assert isinstance(unban_button, WebElement), "Delete button is not WebElement"
|
||||
DRIVER.execute_script(f"""document.querySelector('button[data-unban-btn]').click()""")
|
||||
|
||||
DRIVER.execute_script("arguments[0].click()", unban_button)
|
||||
|
||||
log_info("Unban button clicked, access bans ...")
|
||||
log_info("Unban button clicked, wait to check if delete ...")
|
||||
|
||||
sleep(3)
|
||||
|
||||
access_page(DRIVER, False, "bans", False)
|
||||
safe_get_element(DRIVER, By.XPATH, "//button[@data-unban-btn='']")
|
||||
|
||||
log_info("Acces page after delete action ...")
|
||||
log_info("Start checking if delete action worked ...")
|
||||
|
||||
try:
|
||||
entries = safe_get_element(DRIVER, By.XPATH, "//ul[@data-bans-list='']/li", multiple=True, error=True)
|
||||
|
|
|
|||
|
|
@ -33,13 +33,13 @@ try:
|
|||
|
||||
# Reset
|
||||
btn_keyword.send_keys("")
|
||||
|
||||
|
||||
no_errors = True
|
||||
retries = 0
|
||||
while no_errors:
|
||||
try:
|
||||
log_info("Trying to save the global config without changing anything ...")
|
||||
access_page(DRIVER, "//form[@id='form-edit-global-configs']//button[@type='submit']", "global config", False)
|
||||
access_page(DRIVER, "//form[@id='form-edit-global-config']//button[@type='submit']", "global config", False)
|
||||
|
||||
log_info("The page reloaded successfully, checking the message ...")
|
||||
assert_alert_message(DRIVER, "The global configuration was not edited because no values were changed.")
|
||||
|
|
@ -71,7 +71,7 @@ try:
|
|||
input_worker.clear()
|
||||
input_worker.send_keys("ZZZ")
|
||||
|
||||
assert_button_click(DRIVER, "//form[@id='form-edit-global-configs']//button[@type='submit']")
|
||||
assert_button_click(DRIVER, "//form[@id='form-edit-global-config']//button[@type='submit']")
|
||||
assert_alert_message(DRIVER, "The global configuration was not edited because no values were changed.")
|
||||
|
||||
log_info("The form was not submitted, trying to edit the global config with good values ...")
|
||||
|
|
@ -79,7 +79,7 @@ try:
|
|||
input_worker.clear()
|
||||
input_worker.send_keys("4096")
|
||||
|
||||
access_page(DRIVER, "//form[@id='form-edit-global-configs']//button[@type='submit']", "global config", False)
|
||||
access_page(DRIVER, "//form[@id='form-edit-global-config']//button[@type='submit']", "global config", False)
|
||||
|
||||
if TEST_TYPE == "linux":
|
||||
wait_for_service()
|
||||
|
|
|
|||
|
|
@ -354,8 +354,6 @@ try:
|
|||
if TEST_TYPE == "linux":
|
||||
wait_for_service()
|
||||
|
||||
assert_alert_message(DRIVER, "has been deleted.")
|
||||
|
||||
log_info("Service app3.example.com has been deleted, checking if it's still present ...")
|
||||
|
||||
try:
|
||||
|
|
|
|||
Loading…
Reference in a new issue