def test_find_hide(browser): # get page instance page = GraphPage(browser) page.namespace.check(BOOKINFO) # test find and hide inputs _find_text = 'version=v1' _hide_text = 'version=v2' page.graph_find.fill(_find_text) page.graph_hide.fill(_hide_text) assert _find_text == page.graph_find.text, \ ('Find query mismatch: defined:{}, shown:{}' .format(_find_text, page.graph_find.text)) assert _hide_text == page.graph_hide.text, \ ('Hide query mismatch: defined:{}, shown:{}' .format(_hide_text, page.graph_hide.text)) assert page.graph_find.is_clear_displayed assert page.graph_hide.is_clear_displayed # empty the find assert page.graph_find.clear() assert page.graph_find.is_empty assert '' == page.graph_find.text, \ ('Find query mismatch: defined:{}, shown:{}' .format('', page.graph_find.text)) # empty the hide assert page.graph_hide.clear() assert page.graph_hide.is_empty assert '' == page.graph_hide.text, \ ('Hide query mismatch: defined:{}, shown:{}' .format('', page.graph_hide.text)) assert not page.graph_find.is_clear_displayed assert not page.graph_hide.is_clear_displayed
def test_layout(browser): # get page instance page = GraphPage(browser) # test options options_defined = [item.text for item in GraphPageLayout] options_listed = page.layout.options assert options_defined == options_listed, \ ('Options mismatch: defined:{}, listed:{}'.format(options_defined, options_listed))
def test_refresh_interval(browser): # get page instance page = GraphPage(browser) # test options options_defined = [item.text for item in GraphRefreshInterval] interval = page.interval options_listed = interval.options logger.debug('Options[defined:{}, listed:{}]'.format( options_defined, options_listed)) assert is_equal(options_defined, options_listed), \ ('Options mismatch: defined:{}, listed:{}'.format(options_defined, options_listed))
def test_duration(browser): # get page instance page = GraphPage(browser) # test options options_defined = [item.text for item in TimeIntervalUIText] duration = page.duration options_listed = duration.options logger.debug('Options[defined:{}, listed:{}]'.format( options_defined, options_listed)) assert is_equal(options_defined, options_listed), \ ('Options mismatch: defined:{}, listed:{}'.format(options_defined, options_listed))
def test_filter(browser): # get page instance page = GraphPage(browser) # test available filters options_defined = [item.text for item in GraphPageFilter] options_listed = page.filter.items logger.debug('options[defined:{}, listed:{}]'.format( options_defined, options_listed)) assert is_equal(options_defined, options_listed), \ ('Options mismatch: defined:{}, listed:{}'.format(options_defined, options_listed)) # enable disable each filter for filter_name in options_listed: _filter_test(page, filter_name)
def test_type(browser): # get page instance page = GraphPage(browser) namespace = BOOKINFO page.namespace.check(namespace) # test options options_defined = [item.text for item in GraphType] p_type = page.type side_panel = page.side_panel options_listed = p_type.options assert is_equal(options_defined, options_listed), \ ('Options mismatch: defined:{}, listed:{}'.format(options_defined, options_listed)) for option in options_defined: p_type.select(option) assert namespace == side_panel.get_namespace() assert not side_panel.get_workload() assert not side_panel.get_service()
def test_layout(browser): # get page instance page = GraphPage(browser) page.namespace.check(ISTIO_SYSTEM) # test default layout p_layout = page.layout active_items = p_layout.active_items assert [GraphPageLayout.DAGRE] == active_items, \ ('Options mismatch: defined:{}, listed:{}'.format(GraphPageLayout.DAGRE, active_items)) # test selected layout p_layout.check(GraphPageLayout.COLA) active_items = p_layout.active_items assert [GraphPageLayout.COLA] == active_items, \ ('Options mismatch: defined:{}, listed:{}'.format(GraphPageLayout.COLA, active_items)) p_layout.check(GraphPageLayout.COSE) active_items = p_layout.active_items assert [GraphPageLayout.COSE] == active_items, \ ('Options mismatch: defined:{}, listed:{}'.format(GraphPageLayout.COSE, active_items))