mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
update bans test
This commit is contained in:
parent
f5386016d2
commit
727bd32bae
1 changed files with 14 additions and 7 deletions
|
|
@ -9,7 +9,6 @@ from selenium.common.exceptions import TimeoutException
|
|||
from wizard import DRIVER
|
||||
from utils import access_page, assert_button_click, safe_get_element
|
||||
from time import sleep
|
||||
|
||||
exit_code = 0
|
||||
|
||||
try:
|
||||
|
|
@ -117,18 +116,26 @@ try:
|
|||
DRIVER.execute_script(f"""document.querySelector('input[id="ban-item-2"]').click()""")
|
||||
|
||||
log_info("Ban item id=2 checkbox clicked ...")
|
||||
delete_ban_state = DRIVER.execute_script("return arguments[0].checked", delete_ban_checkbox)
|
||||
|
||||
if not delete_ban_state:
|
||||
log_exception("Checkbox not checked...")
|
||||
exit(1)
|
||||
|
||||
unban_button = safe_get_element(DRIVER, By.XPATH, "//button[@data-unban-btn='']")
|
||||
assert isinstance(unban_button, WebElement), "Delete button is not WebElement"
|
||||
|
||||
unban_disabled_state = DRIVER.execute_script("return arguments[0].hasAttribute('disabled')", delete_ban_checkbox)
|
||||
|
||||
if unban_disabled_state:
|
||||
log_exception("Disabled attribut is on unban button ...")
|
||||
exit(1)
|
||||
|
||||
DRIVER.execute_script(f"""document.querySelector('button[data-unban-btn]').click()""")
|
||||
|
||||
log_info("Unban button clicked, wait to check if delete ...")
|
||||
log_info("Unban button clicked, access bans ...")
|
||||
|
||||
sleep(3)
|
||||
|
||||
safe_get_element(DRIVER, By.XPATH, "//button[@data-unban-btn='']")
|
||||
|
||||
log_info("Start checking if delete action worked ...")
|
||||
access_page(DRIVER, False, "bans")
|
||||
|
||||
try:
|
||||
entries = safe_get_element(DRIVER, By.XPATH, "//ul[@data-bans-list='']/li", multiple=True, error=True)
|
||||
|
|
|
|||
Loading…
Reference in a new issue