def pytest_configure(self, config): # Eventually, the setup/teardown work for coverage should be handled by # utils.appliance.Appliance to make multi-appliance support easy self.reporter = config.pluginmanager.getplugin('terminalreporter') self.reporter.write_sep('-', 'Setting up UI coverage reporting') self.install_simplecov() self.install_coverage_hook() self.restart_evm() self.touch_all_the_things() check_appliance_ui(base_url())
def test_services_request_direct_url(generated_request): """Go to the request page, save the url and try to access it directly.""" assert requests.go_to_request(generated_request), "could not find the request!" request_url = sel.current_url() sel.get(sel.base_url()) # I need to flip it with something different here sel.get(request_url) # Ok, direct access now. wait_for( lambda: sel.is_displayed("//body[contains(@onload, 'miqOnLoad')]"), num_sec=20, message="wait for a CFME page appear", delay=0.5 )
def test_services_request_direct_url(generated_request): """Go to the request page, save the url and try to access it directly.""" assert requests.go_to_request( generated_request), "could not find the request!" request_url = sel.current_url() sel.get(sel.base_url()) # I need to flip it with something different here sel.get(request_url) # Ok, direct access now. wait_for( lambda: sel.is_displayed("//body[contains(@onload, 'miqOnLoad')]"), num_sec=20, message="wait for a CFME page appear", delay=0.5)
def is_internal(title): """ Checks if the link leads internally or not Args: title: The title of the button to check. Returns: ``True`` if the element is an internal link, ``False`` if not. """ loc = sel.element(locate(title)) href = sel.get_attribute(loc, 'href').replace(sel.base_url(), '') img = sel.element('//div[@class="panecontent"]//a[@href="%s"]/img' % href) if 'internal' in sel.get_attribute(img, 'src'): return True else: return False
def base_url(self): return sel.base_url()
def get_ip_address(): """Returns an IP address of the appliance """ return urlparse(sel.base_url()).netloc