#!/usr/bin/python # Necessary imports from robot.api.logger import info from shared_methods import load_data, check_buttons, standardize_url import footer_test def execute_tests(driver, site_url): filepaths = ['/data/pages.yml', '/data/identities.yml'] data = load_data(filepaths) for d in data: temp_url = standardize_url(data[d]['url']) if ('info.werefox.cafe' not in temp_url): data[d]['url'] = f'info.werefox.cafe{temp_url}' else: data[d]['url'] = temp_url # Load requested site info('Attempting to get page...') driver.get(site_url) info('Page loaded.') info('Attempting to click through subdomain buttons...') # Check all the buttons work if (not check_buttons(driver, data)): info('Test failed.') return False # A little bit of setup, grabbing the button elements data = footer_test.load_data() # Check the footer buttons if (not check_buttons(driver, data)): info('Test failed.') return False info('Test succeeded.') return True