mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
update instances test
This commit is contained in:
parent
9b5924b6b0
commit
329cceab72
1 changed files with 27 additions and 0 deletions
|
|
@ -40,6 +40,33 @@ try:
|
|||
if TEST_TYPE == "linux":
|
||||
wait_for_service()
|
||||
|
||||
log_info("Trying to stop instance ...")
|
||||
|
||||
action = "stop"
|
||||
while no_errors:
|
||||
log_info(f"Trying to {action} BunkerWeb instance ...")
|
||||
|
||||
try:
|
||||
form = safe_get_element(DRIVER, By.XPATH, "//form[starts-with(@id, 'form-instance-')]")
|
||||
except TimeoutException:
|
||||
log_exception("No instance form found, exiting ...")
|
||||
exit(1)
|
||||
|
||||
try:
|
||||
access_page(DRIVER, f"//form[starts-with(@id, 'form-instance-')]//button[@value='{action}']", "instances", False)
|
||||
|
||||
log_info(f"Instance was {action}ed successfully, checking the message ...")
|
||||
assert_alert_message(DRIVER, f"has been {action}ed")
|
||||
no_errors = False
|
||||
except:
|
||||
if retries >= 3:
|
||||
exit(1)
|
||||
retries += 1
|
||||
log_warning("Message list doesn't contain the expected message or is empty, retrying...")
|
||||
|
||||
if TEST_TYPE == "linux":
|
||||
wait_for_service()
|
||||
|
||||
log_info("✅ Instances page tests finished successfully")
|
||||
except SystemExit as e:
|
||||
exit_code = e.code
|
||||
|
|
|
|||
Loading…
Reference in a new issue