Fixed a volume mounting bug, added validation for footer component.
This commit is contained in:
parent
276c2da873
commit
e2e4e9b175
@ -28,6 +28,6 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./test_suite:/tests:ro
|
- ./test_suite:/tests:ro
|
||||||
- ./output:/output:rw
|
- ./output:/output:rw
|
||||||
- ../data:/data:ro
|
- ../src/info/data:/data:ro
|
||||||
user: "1000:1000"
|
user: "1000:1000"
|
||||||
command: 'python3 -m robot -d /output /tests'
|
command: 'python3 -m robot -d /output /tests'
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
|
||||||
# Necessary imports
|
# Necessary imports
|
||||||
from selenium import webdriver
|
|
||||||
from selenium.webdriver.common.by import By
|
from selenium.webdriver.common.by import By
|
||||||
from selenium.webdriver.support.ui import WebDriverWait
|
from robot.api.logger import error
|
||||||
from selenium.webdriver.support import expected_conditions
|
|
||||||
from robot.api.logger import info, debug, trace, console, error
|
|
||||||
|
|
||||||
def grab_button_elements(driver):
|
def grab_button_elements(driver):
|
||||||
# Try to grab button elements of the footer
|
# Try to grab button elements of the footer
|
||||||
@ -18,31 +16,12 @@ def grab_button_elements(driver):
|
|||||||
driver.close()
|
driver.close()
|
||||||
driver.quit()
|
driver.quit()
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
return sites
|
return sites
|
||||||
|
|
||||||
def check_footer_links(driver):
|
|
||||||
# setup wait and grab original tab/window
|
|
||||||
wait = WebDriverWait(driver, 10)
|
|
||||||
main_tab = driver.current_window_handle
|
|
||||||
|
|
||||||
sites = grab_button_elements(driver)
|
def load_data():
|
||||||
|
# I don't have a better method of constructing the data dict
|
||||||
# Iterate through subdomains
|
data = {"Contact": {"url": "https://info.werefox.cafe/contacts"}, " /src": {"url": "https://gitea.werefox.cafe/ada/werefox-cafe"}, "Mutant Standard emoji": {
|
||||||
for e in sites:
|
"url": "https://mutant.tech"}, "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License": {"url": "https://creativecommons.org/licenses/by-nc-sa/4.0/"}}
|
||||||
try:
|
return data
|
||||||
e.click()
|
|
||||||
info(e.text)
|
|
||||||
wait.until(expected_conditions.number_of_windows_to_be(2))
|
|
||||||
for window_handle in driver.window_handles:
|
|
||||||
if window_handle != main_tab:
|
|
||||||
driver.switch_to.window(window_handle)
|
|
||||||
driver.close()
|
|
||||||
driver.switch_to.window(main_tab)
|
|
||||||
except:
|
|
||||||
error("Couldn't find the element somewhere...")
|
|
||||||
driver.close()
|
|
||||||
driver.quit()
|
|
||||||
return False
|
|
||||||
|
|
||||||
return True
|
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
# Necessary imports
|
# Necessary imports
|
||||||
from selenium.webdriver.common.by import By
|
from selenium.webdriver.common.by import By
|
||||||
from robot.api.logger import info, error
|
from robot.api.logger import info, error
|
||||||
from footer_test import check_footer_links
|
|
||||||
from shared_methods import load_data, check_buttons
|
from shared_methods import load_data, check_buttons
|
||||||
|
import footer_test
|
||||||
|
|
||||||
|
|
||||||
def grab_button_elements(driver):
|
def grab_button_elements(driver):
|
||||||
@ -41,10 +41,14 @@ def execute_tests(driver, site_url):
|
|||||||
if (not check_buttons(driver, data, button_elements)):
|
if (not check_buttons(driver, data, button_elements)):
|
||||||
info('Test failed.')
|
info('Test failed.')
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
# A little bit of setup, grabbing the button elements
|
||||||
|
data = footer_test.load_data()
|
||||||
|
button_elements = footer_test.grab_button_elements(driver)
|
||||||
# Check the footer buttons
|
# Check the footer buttons
|
||||||
elif (not check_footer_links(driver)):
|
if (not check_buttons(driver, data, button_elements)):
|
||||||
info('Test failed.')
|
info('Test failed.')
|
||||||
return False
|
return False
|
||||||
else:
|
|
||||||
info('Test succeeded.')
|
info('Test succeeded.')
|
||||||
return True
|
return True
|
||||||
|
Loading…
Reference in New Issue
Block a user