better core list style + test click btn as js

This commit is contained in:
Jordan Blasenhauer 2024-03-01 17:01:16 +01:00
parent d1fff52a67
commit ea7c8da000
5 changed files with 28 additions and 22 deletions

File diff suppressed because one or more lines are too long

View file

@ -295,7 +295,7 @@
}
.core-card-list {
@apply 2xl:col-span-4 3xl:col-span-3 w-full overflow-hidden grid grid-cols-12 max-h-100 sm:max-h-125 col-span-12 p-4 relative break-words bg-white shadow-xl dark:bg-slate-850 dark:shadow-dark-xl rounded-2xl bg-clip-border;
@apply col-span-12 md:col-span-6 w-full overflow-hidden grid grid-cols-12 max-h-100 sm:max-h-125 col-span-12 p-4 relative break-words bg-white shadow-xl dark:bg-slate-850 dark:shadow-dark-xl rounded-2xl bg-clip-border;
}
.w-small.core-card-list {
@ -339,15 +339,15 @@
}
.w-small.core-card-list-wrap {
@apply min-w-[250px];
@apply min-w-[200px];
}
.w-medium.core-card-list-wrap {
@apply min-w-[350px];
@apply min-w-[300px];
}
.w-large.core-card-list-wrap {
@apply min-w-[500px];
@apply min-w-[450px];
}
.core-card-metrics {

View file

@ -35,8 +35,7 @@ try:
log_error("The username is not correct, exiting ...")
exit(1)
username_input.clear()
username_input.send_keys("admin2")
DRIVER.execute_script(f"arguments[0].value = 'admin2'", username_input)
password_input = safe_get_element(DRIVER, By.ID, "curr_password")
assert isinstance(password_input, WebElement), "The password input is not an instance of WebElement"
@ -45,8 +44,8 @@ try:
log_error("The current password is not empty, exiting ...")
exit(1)
password_input.send_keys(UI_PASSWORD)
# execute script using create password_input
DRIVER.execute_script(f"arguments[0].value = '{UI_PASSWORD}'", password_input)
assert_button_click(DRIVER, "//button[@id='username-button' and @class='edit-btn']")
try:

View file

@ -95,12 +95,16 @@ try:
log_info("Bans found, trying to delete them ...")
ban_item_2 = safe_get_element(DRIVER, By.XPATH, "//input[@id='ban-item-2']")
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("arguments[0].scrollIntoView();", ban_item_2)
ban_item_2.click()
unban_button = safe_get_element(DRIVER, By.XPATH, "//button[@data-unban-btn='']")
assert isinstance(delete_ban_button, WebElement), "Delete button is not WebElement"
access_page(DRIVER, "//button[@data-unban-btn='']", "bans", False)
DRIVER.execute_script("arguments[0].click()", unban_button)
access_page(DRIVER, "/html/body/aside[1]/div[1]/div[3]/ul/li[9]/a", "bans")
try:
entries = safe_get_element(DRIVER, By.XPATH, "//ul[@data-bans-list='']/li", multiple=True, error=True)

View file

@ -315,30 +315,33 @@ try:
for item in select_filters:
DRIVER.execute_script(f"""document.querySelector('[data-services-setting-select-dropdown-btn="{item["id"]}"][value="{item["value"]}"]').click()""")
log_info("Filters working as expected, trying to delete app2.example.com ...")
log_info("Filters working as expected, trying to delete app3.example.com ...")
try:
delete_button = safe_get_element(DRIVER, By.XPATH, "//button[@data-services-action='delete' and @data-services-name='app2.example.com']", error=True)
assert isinstance(delete_button, WebElement), "Delete button is not a WebElement"
delete_card_button = safe_get_element(DRIVER, By.XPATH, "//button[@data-services-action='delete' and @data-services-name='app3.example.com']", error=True)
assert isinstance(delete_card_button, WebElement), "Delete button is not a WebElement"
except TimeoutException:
log_exception("Delete button hasn't been found, even though it should be, exiting ...")
exit(1)
log_info("Delete button is present, as expected, deleting the service ...")
DRIVER.execute_script("arguments[0].scrollIntoView();", delete_button)
assert_button_click(DRIVER, delete_button)
# Click on the delete button
DRIVER.execute_script("arguments[0].click()", delete_card_button)
sleep(0.1)
delete_modal_button = safe_get_element(DRIVER, By.XPATH, "//form[@data-services-modal-form-delete='']//button[@type='submit']")
assert isinstance(delete_modal_button, WebElement), "Delete modal button is not a WebElement"
access_page(DRIVER, "//form[@data-services-modal-form-delete='']//button[@type='submit']", "services", False)
DRIVER.execute_script("arguments[0].click()", delete_modal_button)
access_page(DRIVER, "/html/body/aside[1]/div[1]/div[3]/ul/li[4]/a", "services")
if TEST_TYPE == "linux":
wait_for_service()
assert_alert_message(DRIVER, "has been deleted.")
log_info("Service app2.example.com has been deleted, checking if it's still present ...")
log_info("Service app3.example.com has been deleted, checking if it's still present ...")
try:
services = safe_get_element(DRIVER, By.XPATH, "//div[@data-services-service='']", multiple=True, error=True)
@ -351,7 +354,7 @@ try:
log_error(f"The service hasn't been deleted ({len(services)} services found), exiting ...")
exit(1)
log_info("Service app2.example.com has been deleted successfully")
log_info("Service app3.example.com has been deleted successfully")
log_info("✅ Services page tests finished successfully")
except SystemExit as e: