2023-01-17 17:16:49 -06:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
|
|
# Necessary imports
|
2023-01-27 15:53:20 -06:00
|
|
|
from robot.api.logger import info
|
2023-01-26 19:36:12 -06:00
|
|
|
from shared_methods import load_data, check_buttons
|
2023-01-27 10:44:16 -06:00
|
|
|
import footer_test
|
2023-01-21 14:48:07 -06:00
|
|
|
|
2023-01-17 17:16:49 -06:00
|
|
|
|
2023-01-21 14:48:07 -06:00
|
|
|
def execute_tests(driver, site_url):
|
2023-01-26 19:36:12 -06:00
|
|
|
filepaths = ['/data/homepage/subdomains.yml', '/data/homepage/other.yml']
|
|
|
|
data = load_data(filepaths)
|
|
|
|
|
2023-01-21 14:48:07 -06:00
|
|
|
# Load requested site
|
|
|
|
info('Attempting to get page...')
|
|
|
|
driver.get(site_url)
|
|
|
|
info('Page loaded.')
|
|
|
|
|
|
|
|
info('Attempting to click through subdomain buttons...')
|
2023-01-26 19:36:12 -06:00
|
|
|
# Check all the buttons work
|
2023-01-27 15:53:20 -06:00
|
|
|
if (not check_buttons(driver, data)):
|
2023-01-21 14:48:07 -06:00
|
|
|
info('Test failed.')
|
|
|
|
return False
|
2023-01-27 10:44:16 -06:00
|
|
|
|
|
|
|
# A little bit of setup, grabbing the button elements
|
|
|
|
data = footer_test.load_data()
|
2023-01-22 10:02:29 -06:00
|
|
|
# Check the footer buttons
|
2023-01-27 15:53:20 -06:00
|
|
|
if (not check_buttons(driver, data)):
|
2023-01-22 10:02:29 -06:00
|
|
|
info('Test failed.')
|
|
|
|
return False
|
2023-01-27 10:44:16 -06:00
|
|
|
|
|
|
|
info('Test succeeded.')
|
|
|
|
return True
|