mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Fix shenanigans in web UI automatic tests
This commit is contained in:
parent
781a861b2f
commit
0aabffb620
3 changed files with 17 additions and 11 deletions
|
|
@ -66,7 +66,7 @@ location /hello {
|
|||
|
||||
assert_alert_message(DRIVER, "Created")
|
||||
|
||||
sleep(30)
|
||||
sleep(5)
|
||||
|
||||
DRIVER.execute_script("window.open('http://www.example.com/hello','_blank');")
|
||||
DRIVER.switch_to.window(DRIVER.window_handles[1])
|
||||
|
|
@ -165,7 +165,7 @@ location /hello {
|
|||
|
||||
assert_alert_message(DRIVER, "Deleted")
|
||||
|
||||
sleep(30)
|
||||
sleep(5)
|
||||
|
||||
resp = get("http://www.example.com/hello", verify=False)
|
||||
|
||||
|
|
@ -202,7 +202,7 @@ location /hello {
|
|||
|
||||
assert_alert_message(DRIVER, "Created")
|
||||
|
||||
sleep(30)
|
||||
sleep(5)
|
||||
|
||||
DRIVER.execute_script("window.open('http://app1.example.com/hello','_blank');")
|
||||
DRIVER.switch_to.window(DRIVER.window_handles[1])
|
||||
|
|
|
|||
|
|
@ -86,7 +86,13 @@ try:
|
|||
|
||||
log_info("Reload filter is working, trying jobs cache ...")
|
||||
|
||||
resp = get(f"http://www.example.com{UI_URL}/jobs/download?job_name=mmdb-country&file_name=country.mmdb", verify=False)
|
||||
cookie = DRIVER.get_cookies()[0]
|
||||
resp = get(
|
||||
f"https://www.example.com{UI_URL}/jobs/download?job_name=mmdb-country&file_name=country.mmdb",
|
||||
headers={"Host": "www.example.com", "User-Agent": DRIVER.execute_script("return navigator.userAgent;")},
|
||||
cookies={cookie["name"]: cookie["value"]},
|
||||
verify=False,
|
||||
)
|
||||
|
||||
if resp.status_code != 200:
|
||||
log_error("The cache download is not working, exiting ...")
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ try:
|
|||
DEACTIVATED_PLUGINS = ("antibot", "blacklist", "bunkernet", "cors", "country", "greylist", "redis", "reversescan")
|
||||
for plugin in DEACTIVATED_PLUGINS:
|
||||
log_info(f"Trying {plugin} plugin page ...")
|
||||
DRIVER.get(f"http://www.example.com{UI_URL}/plugins/{plugin}")
|
||||
DRIVER.get(f"https://www.example.com{UI_URL}/plugins/{plugin}")
|
||||
first_card = safe_get_element(DRIVER, By.XPATH, "/html/body/main/div/div/div/div[1]/h5")
|
||||
assert isinstance(first_card, WebElement), "First card is not a WebElement"
|
||||
|
||||
|
|
@ -122,7 +122,7 @@ try:
|
|||
DRIVER.back()
|
||||
|
||||
log_info("Trying bad behavior plugin page ...")
|
||||
DRIVER.get(f"http://www.example.com{UI_URL}/plugins/badbehavior")
|
||||
DRIVER.get(f"https://www.example.com{UI_URL}/plugins/badbehavior")
|
||||
|
||||
sleep(5)
|
||||
|
||||
|
|
@ -143,7 +143,7 @@ try:
|
|||
DRIVER.back()
|
||||
|
||||
log_info("Trying dnsbl plugin page ...")
|
||||
DRIVER.get(f"http://www.example.com{UI_URL}/plugins/dnsbl")
|
||||
DRIVER.get(f"https://www.example.com{UI_URL}/plugins/dnsbl")
|
||||
|
||||
sleep(5)
|
||||
|
||||
|
|
@ -158,7 +158,7 @@ try:
|
|||
DRIVER.back()
|
||||
|
||||
log_info("Trying errors plugin page ...")
|
||||
DRIVER.get(f"http://www.example.com{UI_URL}/plugins/errors")
|
||||
DRIVER.get(f"https://www.example.com{UI_URL}/plugins/errors")
|
||||
|
||||
sleep(5)
|
||||
|
||||
|
|
@ -179,7 +179,7 @@ try:
|
|||
DRIVER.back()
|
||||
|
||||
log_info("Trying limit plugin page ...")
|
||||
DRIVER.get(f"http://www.example.com{UI_URL}/plugins/limit")
|
||||
DRIVER.get(f"https://www.example.com{UI_URL}/plugins/limit")
|
||||
|
||||
limit_info_elem = safe_get_element(DRIVER, By.XPATH, "/html/body/main/div/div/div[1]/h5")
|
||||
assert isinstance(limit_info_elem, WebElement), "Limit info element is not a WebElement"
|
||||
|
|
@ -192,7 +192,7 @@ try:
|
|||
DRIVER.back()
|
||||
|
||||
log_info("Trying miscellaneous plugin page ...")
|
||||
DRIVER.get(f"http://www.example.com{UI_URL}/plugins/misc")
|
||||
DRIVER.get(f"https://www.example.com{UI_URL}/plugins/misc")
|
||||
|
||||
sleep(5)
|
||||
|
||||
|
|
@ -209,7 +209,7 @@ try:
|
|||
DRIVER.back()
|
||||
|
||||
log_info("Trying whitelist plugin page ...")
|
||||
DRIVER.get(f"http://www.example.com{UI_URL}/plugins/whitelist")
|
||||
DRIVER.get(f"https://www.example.com{UI_URL}/plugins/whitelist")
|
||||
|
||||
sleep(5)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue