From 0e99ad9885400f4540ab0f8b8ddaf8638a706009 Mon Sep 17 00:00:00 2001 From: Lukas Ruzicka Date: Dec 13 2018 11:55:48 +0000 Subject: Start from scratch. --- diff --git a/gnome_terminal/README.md b/gnome_terminal/README.md new file mode 100644 index 0000000..790e855 --- /dev/null +++ b/gnome_terminal/README.md @@ -0,0 +1,3 @@ +# fedora-desktop-testing + +This repository holds the Behave desktop tests for Fedora \ No newline at end of file diff --git a/gnome_terminal/cleanup.py b/gnome_terminal/cleanup.py new file mode 100644 index 0000000..40c8fa1 --- /dev/null +++ b/gnome_terminal/cleanup.py @@ -0,0 +1,16 @@ +from os import system + +# Clean temporary files +system('rm -rf /home/test/Downloads/*') +# Clear additional appts that might be started by the test +system('pkill gnome-software') +system('pkill yelp') +system('pkill firefox') # Discord Opening firefox + +# Disable prompt asking for enabling proprietary sources +system('gsettings set org.gnome.software show-nonfree-prompt false') +# Disable first run dialog appearence +system('gsettings set org.gnome.software first-run false') +# Disable notification bubles because they are blocking some part of UI +# and may steal focus +system("gsettings set org.gnome.desktop.notifications show-banners false") diff --git a/gnome_terminal/features/__init__.py b/gnome_terminal/features/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/gnome_terminal/features/__init__.py diff --git a/gnome_terminal/features/basic_tests.feature b/gnome_terminal/features/basic_tests.feature new file mode 100644 index 0000000..867a9ab --- /dev/null +++ b/gnome_terminal/features/basic_tests.feature @@ -0,0 +1,118 @@ +Feature: Basic tests + + @start_via_command + Scenario: Start Terminal via command + * Start gnome-terminal-server via command + Then gnome-terminal-server should start + + @menu_items + Scenario: check for menu items + * Run gnome-terminal + Then File item is in application menu + And Edit item is in application menu + And View item is in application menu + And Search item is in application menu + And Terminal item is in application menu + And Help item is in application menu + + @open_new_tab_with_shortcut + Scenario: open a new tab with keyboard shortcut + * Run gnome-terminal + When press New Tab shortcut + Then new tab opens + + @open_new_tab_with_button + Scenario: open a new tab with menu button + When Run gnome-terminal + And click on File button + And click on New Tab button + Then new tab opens + + @open_new_window_with_shortcut + Scenario: open a new window with keyboard shortcut + Given Run gnome-terminal + When press New Window shortcut + Then new window opens + + @open_new_window_with_button + Scenario: open a new window with menu button + Given Run gnome-terminal + When click on File button + And click on New Window button + Then new window opens + + @close_active_tab + Scenario: close active tab + When Run gnome-terminal + And press New Tab shortcut + And press Close Tab shortcut + Then active tab closes + + @close_active_window + Scenario: close active window + Given Run gnome-terminal + When press New Window shortcut + And press Close Window shortcut + Then active window closes + + @set_title + Scenario: set new terminal title + Given Run gnome-terminal + When click on Terminal button + And click on Set Title button + And type a new title + Then terminal has new title set + + @run_commands + Scenario Outline: run command in the terminal + Given Run gnome-terminal + When enter terminal command + Then terminal output is + Examples: + | command | output | + | uname | Linux | + | ls / | dev | + | lspci | bridge | + | whoami | test | + | man | manual | + | sudo | usage: | + | df | Filesystem | + + + @write_file + Scenario: create file and write a value + Given Run gnome-terminal + When enter cd terminal command + And enter touch testfile terminal command + And enter echo "TEST FeDoRa" > testfile terminal command + And enter clear terminal command + And enter cat testfile terminal command + Then terminal output is TEST FeDoRa + + @show_help + Scenario: show application Help + Given Run gnome-terminal + When click on Help button + And click on Contents button + Then yelp shows Terminal help page + + @show_about + Scenario: show application About + Given Run gnome-terminal + When click on Help button + And click on About button + Then the About window appears + + @toggle_menu_bar + Scenario: toggle the visibility of the menu bar + Given Run gnome-terminal + When click on View button + And click on Show Menubar button + Then the menu bar disappears + + @open_preferences + Scenario: open the Preferences menu + Given Run gnome-terminal + When click on Edit button + And click on Preferences button + Then the Preferences frame appears diff --git a/gnome_terminal/features/environment.py b/gnome_terminal/features/environment.py new file mode 100644 index 0000000..8d035c1 --- /dev/null +++ b/gnome_terminal/features/environment.py @@ -0,0 +1,43 @@ +# -*- coding: UTF-8 -*- +import sys +import traceback +from common_steps import App, common_before_all, common_after_step, common_after_scenario, setup_gnome_keyring +from dogtail.rawinput import pressKey +from os import system + +def before_all(context): + try: + common_before_all(context) + # Do the cleanup + system("python3 cleanup.py > /dev/null") + # Add Flatpak repos and generate additional scenarios + context.app = App('gnome-terminal', desktopFileName="org.gnome.Terminal", + a11yAppName='gnome-terminal-server', recordVideo=True) + context.app.flatpak = None + + except Exception as e: + print("Error in before_all: %s" %e) + traceback.print_exc(file=sys.stdout) + + +def after_step(context, step): + try: + common_after_step(context, step) + except Exception as e: + print("Error in before_all: %s" %e) + traceback.print_exc(file=sys.stdout) + + +def after_scenario(context, scenario): + try: + # Additional cleanup - nautilus + if hasattr(context, 'nautilus'): + context.nautilus.kill() + # Make sure that command dialog is gone + if 'flathub' in scenario.tags: + pressKey('Esc') + + common_after_scenario(context, scenario, kill=False) + except Exception as e: + print("Error in after_scenario: %s" % e) + traceback.print_exc(file=sys.stdout) diff --git a/gnome_terminal/features/steps/steps.py b/gnome_terminal/features/steps/steps.py new file mode 100755 index 0000000..bc16406 --- /dev/null +++ b/gnome_terminal/features/steps/steps.py @@ -0,0 +1,571 @@ +# -*- coding: UTF-8 -*- +from behave import step, then, given, when +from dogtail.tree import root +from dogtail.rawinput import typeText, pressKey +from dogtail.predicate import GenericPredicate +from common_steps import App +from common_steps.app import * +from common_steps.appmenu import * +from common_steps import limit_execution_time_to, wait_until +from dogtail.utils import GnomeShell, doDelay +from time import sleep +from subprocess import Popen, PIPE + +@step('Run gnome-terminal') +def start(context): + for x in range(5): + try: + context.app.startViaCommand(insideSession=True) + context.app.instance = root.application('gnome-terminal-server') + sleep(2) + return + except AssertionError: + sleep(10) + continue + raise AssertionError('App failed to start') + + +@step(u'Start gnome-terminal') +def start_app(context): + context.proc = popener(context.app.appCommand) + sleep(5) + keyCombo('Q') + sleep(1) + + +@step(u'Go to {page} page') +def go_to_given_page(context, page): + click_on(context, page, 'toggle button') + + +@then('{menuitem} item is in application menu') +def item_in_menu(context, menuitem): + print(f'Checking if {menuitem} is in application menu') + menubar = context.app.instance.findChild(lambda x: x.roleName == 'menu bar') + entries = [x.name for x in menubar.children] + assert menuitem in entries, f'{menuitem} not found in the menu bar.' + +@step('press {option} shortcut') +def press_shortcut(context, option): + if option == 'New Tab': + keyCombo('T') + elif option == 'Close Tab': + keyCombo('W') + elif option == 'New Window': + keyCombo('N') + elif option == 'Close Window': + keyCombo('Q') + else: + pass + +@step('click on {button} button') +def click_button(context, button): + if button == "Set Title": + mItems = context.app.instance.findChildren(lambda x: x.roleName == 'menu item') + for item in mItems: + if "Set Title" in item.name: + namedButton = item + else: + pass + else: + namedButton = context.app.instance.findChild(lambda x: x.name == button) + namedButton.click() + +@then('new tab opens') +def is_new_tab(context): + pageTabList = context.app.instance.findChild(lambda x: x.roleName == 'page tab list') + assert len(pageTabList) == 2, 'The number of opened tabs does not match.' + +@then('active tab closes') +def is_tab_closed(context): + pageTabList = context.app.instance.findChild(lambda x: x.roleName == 'page tab list') + assert len(pageTabList) == 1, 'The number of opened tabs does not match.' + +@then('new window opens') +def is_window_opened(context): + windows = context.app.instance.findChildren(lambda x: x.roleName == 'frame') + assert len(windows) == 2, 'The number of opened windows does not match.' + +@then('active window closes') +def is_window_closed(context): + windows = context.app.instance.findChild(lambda x: x.roleName == 'frame') + assert len(windows) == 1, 'The number of opened windows does not match.' + +@step('type a new title') +def type_title(context): + typeText('Newly set title') + pressKey('Enter') + sleep(5) + +@step('terminal has new title set') +def is_title_set(context): + term = context.app.instance.findChild(lambda x: x.roleName == 'frame') + assert term.name == 'Newly set title', 'The title does not match the expected value.' + +@step('enter {command} terminal command') +def enter_command(context, command): + typeText(command) + sleep(1) + pressKey('Enter') + +@then('terminal output is {output}') +def term_has_output(context, output): + term = context.app.instance.findChild(lambda x: x.roleName == 'terminal') + assert output in term.text, 'The output differs from what was expected.' + +@then('yelp shows Terminal help page') +def yelp_shows_help(context): + yelp = root.application('yelp') + shows = yelp.findChild(lambda x: x.roleName == 'frame') + sleep(2) # Wait so that the assertion can get the correct data + assert shows.name == 'Terminal', 'Yelp does not show the expected content.' + +@then('the {window} window appears') +def window_appears(context, window): + if window == 'About': + rName = 'About GNOME Terminal' + else: + pass + dialog = context.app.instance.findChild(lambda x: x.roleName == 'dialog') + sleep(2) + assert dialog.name == rName, 'No window with that name was opened.' + +@then('the menu bar disappears') +def menu_bar_invisible(context): + mBar = context.app.instance.findChild(lambda x: x.roleName == 'menu bar') + assert mBar.visible == False, 'The menu bar has not been hidden.' + +@then('the {frame} frame appears') +def is_frame_open(context, frame): + frames = [x.name for x in context.app.instance.children] + found = False + for i in frames: + if frame in i: + found = True + else: + pass + assert found == True, 'A window with a title including {frame} was not found.' + +@then(u'Installed page is shown') +def installed_page_is_shown(context): + toggle_btn_checked(context, 'All') + toggle_btn_checked(context, 'Updates') + toggle_btn_checked(context, 'Installed', True) + node_visible(context, 'Installed page', 'panel') + + +@then(u'Updates page is shown') +def updates_page_is_shown(context): + toggle_btn_checked(context, 'All') + toggle_btn_checked(context, 'Installed') + toggle_btn_checked(context, 'Updates', True) + node_visible(context, 'Updates page', 'panel' ) + + +@then(u'Details page is shown') +def details_page_is_shown(context): + toggle_btn_checked(context, 'All') + toggle_btn_checked(context, 'Installed') + toggle_btn_checked(context, 'Updates') + node_visible(context, 'Details page', 'panel') + + +@then(u'"{section}" section is shown') +def section_is_shown(context, section): + lbls = [x.name for x in context.app.instance.findChildren(lambda x: + x.roleName=='label')] + assert section in lbls, 'Requested section not found %s' %section + + +@step(u'Open category "{category}"') +def open_category(context,category): + section = context.app.instance.child('Overview page',roleName='panel').child('Categories',roleName='label') + lst = section.parent.children[section.indexInParent+1] + for attempt in range(10): + if not lst.button(category).visible: + pressKey('Page_Down') + else: + lst.button(category).click() + return True + raise AssertionError('Category %s is not listed!' % category) + + +@step(u'Change sub-category "{name}"') +def change_subcategory(context, name): + click_on(context, 'Subcategories filter menu', 'toggle button') + click_on(context, name) + sleep(5) + + +@step(u'Open sub-category "{name}"') +def open_subcategory(context, name): + click_on(context, name, roleName='radio button') + sleep(5) + + +@step(u'Select "{app}" in the list') +def application_is_in_the_list(context, app): + entry = context.app.instance.findChild(lambda x: app in x.name) + while not entry.showing: + pressKey("PageDown") + entry.click() + sleep(2) + + +@then(u'Editors picks are working') +def all_picks_are_working(context): + picks_lbl = context.app.instance.findChild(lambda x: 'Editor' in x.name) + lst_index = picks_lbl.indexInParent+1 + picks = [i for i in picks_lbl.parent.children[lst_index].children] + for pick in picks: + if pick.showing: + pick.click() + details_page_is_shown(context) + click_on(context, 'Go back') + + +@step(u'Click on featured app banner') +def click_on_featured_app(context): + # featured app is accessible as first visible button in app + context.app.instance.findChild(lambda x: + x.showing and x.roleName=='push button').click() + + +@step(u'Click "{btn}"') +def click_on(context, btn, roleName='push button'): + context.app.instance.child(btn, roleName).click() + sleep(2) + + +@step(u'Type "{string}" in search bar') +def search_string(context, string): + keyCombo('F') + sleep(1) + typeText(string) + sleep(4) + + +def get_app_list(context): + assert wait_until(lambda x: x.findChild(lambda y: y.roleName=='list box'),\ + context.app.instance, timeout=30), "Application not found" + return context.app.instance.child(roleName='list box') + + +@step(u'Select flatpak "{app}" in the list') +@then(u'flatpak "{app}" was found') +def flatpak_in_search_results(context, app): + app_list = [x for x in get_app_list(context) if x.isChild(app)] + app_list = app_list if app_list else get_app_list(context)#GnomeToDo hack + for item in app_list: + try: + item.grabFocus() + item.click() + sleep(1) + assert context.app.instance.findChild(lambda x: # Check sources + x.roleName == 'label' and x.name in flatpak_sources) + return + except: + click_on(context, 'Go back') + continue + raise AssertionError('Flatpak %s is not in the list!' %app) + + +@then(u'"{name}" is in the list and has the source label') +def app_is_in_search_results(context, name): + listbox = context.app.instance.child('Search page',roleName='panel').child(roleName='list box') + for item in listbox: + lbls = [x.name for x in item.findChildren(lambda y: y.roleName=='label')] + if name in lbls and [x for x in lbls if 'Source: ' in x]: + return + raise AssertionError(name+' missing or no sources entry') + + +@step(u'Select app "{app}" in the list') +def select_in_search_results(context, app): + app_list = [x for x in get_app_list(context) if x.isChild(app)] + for item in app_list: + while not item.showing: + pressKey('Down') + item.click() + sleep(1) + # Skip extensions and flatpaks + if (context.app.instance.isChild(name='extensions.gnome.org') or + context.app.instance.isChild(lambda x: x.name in flatpak_sources)): + click_on(context, 'Go back') + continue + return + raise AssertionError('Application %s is not in the list!' %app) + + +@then(u'app "{app}" is in the list') +@then(u'app "{app}" is {neg} in the list') +def app_in_search_results(context, app, neg=None): + if neg: + try: + get_app_list(context) + except SearchError: # No results -> no list found + return + try: + select_in_search_results(context, app) + except AssertionError: # List is there, but application is not listed + return + raise AssertionError('Application %s is in the list!' %app) + else: + labels = context.app.instance.findChildren(lambda x:x.roleName=='label') + assert app in [x.name for x in labels] + + +@then(u'Application "{app}" is in the category') +def application_is_in_the_list(context, app): + assert context.app.instance.findChild(lambda x: + x.roleName=='push button' and app in x.name) + + +@step(u'Open "{app}" details page') +def open_app_details(context, app): + app_in_search_results(context, app) + + +@then(u'Details page contains "{field}" field') +def details_page_contains_field(context,field): + details_page = context.app.instance.child('Details page', roleName='panel') + label = details_page.child(field,roleName='label') + assert label.name==field, 'Field not listed' + + +@then(u'Details page has correct buttons') +def correct_button_on_details_page(context): + try: + node_visible(context, 'Install', 'push button') + node_visible(context, 'Launch', 'push button') + except AssertionError: + node_visible(context, 'Remove', 'push button') + node_visible(context, 'Go back', 'push button') + node_visible(context, 'Write a Review', 'push button') + node_visible(context, 'Website', 'push button') + + + +@then(u'"{dialog}" dialog is shown') +def dialog_is_shown(context, dialog): + assert wait_until(lambda x: x.findChild(lambda y: + y.name==dialog and y.roleName=='dialog'),\ + context.app.instance, timeout=30), "Failed to load %s"%dialog + + +@step(u'Click {btn} radio on "{dialog}" dialog') +def click_radio_on_dialog(context, btn, dialog): + context.app.instance.dialog(dialog).child(btn,roleName='radio button').click() + + +@then(u'{content} was {state}') +def app_was_installed(context, content, state): + if content == 'Extension': + btn_showing(context, 'Extension Settings' if state=='installed' else 'Install') + else: + btn_showing(context, 'Launch' if state=='installed' else 'Install') + + +@then(u'"{name}" window has appeared') +def flatpak_window_has_appeared(context, name): + sleep(10) # First start are heavy for some flatpaks + alt_name = name.strip('GNOME ') + name = name.lower().replace(' ','-') if 'GNOME' in name else name.lower() + try: # 1st method, try to find window name via dogtail - partial name match + assert root.findChild(lambda x: + x.roleName=='application' and name in x.name, recursive=False) + except: + # 2nd, find application window in Xorg root tree or count windows + out = get_cmd_output('xwininfo -tree -root')[0].decode() + window_count = get_cmd_output('wmctrl -l | wc -l')[0].decode() + assert name in out or alt_name in out or \ + int(window_count) > int(context.window_count), 'window not found' + popener('sudo kill -9 $(pgrep flatpak) && sudo pkill '+name) # cleanup + popener('sudo pkill firefox') + + +@step(u'Make sure that "{app}" is {neg} installed') +@step(u'Make sure that "{app}" is installed') +def check_install(context, app, neg=False): + if neg: + popener('sudo dnf -y remove '+app.lower(), wait=True) + else: + popener('sudo dnf -y install '+app.lower(), wait=True) + + +@step(u'Make sure that "{flatpak}" flatpak is installed') +def check_install_flatpak(context, flatpak): + popener('sudo flatpak install -y flathub org.gnome.'+flatpak, wait=True) + + +@step(u'"{action}" "{app}"') +@step(u'"{action}" "{app}" {flatpak}') +def do_action_on_app(context, action, app, flatpak=None): + btn_showing(context, action) + sleep(2) + context.window_count, _ = get_cmd_output('wmctrl -l | wc -l') + click_on(context, action) + if action == 'Remove': + sleep(2) + pressKey('Right') + pressKey('Enter') + sleep(5) + if not flatpak: + handle_auth_window(context) + + +@step(u'"{action}" the extension') +def install_extension(context, action): + btn_showing(context, action) + click_on(context, action) + sleep(2) + pressKey('Right') + pressKey('Enter') # Handle confirmation dialog + sleep(1) + + + +@then('"{extension}" icon is {visibility} visible in panel') +@then('"{extension}" icon is visible in panel') +def icons_is_visible(context, extension, visibility=None): + try: + root.application('gnome-shell').findChild(lambda x: + x.name==extension and x.visible and x.showing) + except SearchError: + if visibility: + return + else: + raise AssertionError('Extension icon is not present in panel') + + +@then(u'Credits is shown on "{dialog}" dialog') +def credits_is_shown_on_about_dialog(context,dialog): + node_visible(context, 'About', 'radio button') + node_visible(context, 'Credits', 'radio button') + node_visible(context, 'Created by', 'label') + toggle_btn_checked(context, 'About', False, 'radio button') + toggle_btn_checked(context, 'Credits', True, 'radio button') + + +@then(u'About is shown on "{dialog}" dialog') +def about_is_shown_on_about_dialog(context,dialog): + node_visible(context, 'About', 'radio button') + node_visible(context, 'Credits', 'radio button') + toggle_btn_checked(context, 'About', True, 'radio button') + toggle_btn_checked(context, 'Credits', False, 'radio button') + + +@then(u'{item} item is in GApplication menu') +def item_is_in_gapplication_menu(context,item): + menu_items = [i.name for i in GnomeShell().getApplicationMenuList()] + assert item in menu_items + + +@then(u'Then Details page is shown') +def detail_page_is_shown(context, app_name): + context.execute_steps(u'Then Details page contains "License" field') + context.execute_steps(u'Then Details page contains "Version" field') + context.execute_steps(u'Then Details page contains "Installed Size" field') + context.execute_steps(u'Then Details page contains "Developer" field') + context.execute_steps(u'Then Details page contains "Category" field') + context.execute_steps(u'Then Details page has correct buttons') + + +@step(u'Make sure that content is loaded') +def content_is_loaded(context): + assert wait_until(lambda x: x.findChild(lambda y: + y.roleName=='label' and y.name=='Categories'),\ + context.app.instance, timeout=180), 'Content failed to load' + sleep(10) + + +@step(u'Download Transmission flatpak') +def download_flatpak(context): + Popen('cd /home/test/Downloads && wget https://flathub.org/repo/appstream/com.transmissionbt.Transmission.flatpakref', shell=True).wait() + + +@step(u'Download rpm') +def download_rpm(context): + Popen('cd /home/test/Downloads && wget http://download.eng.bos.redhat.com/brewroot/vol/rhel-8/packages/hexchat/2.14.1/2.el8/x86_64/hexchat-2.14.1-2.el8.x86_64.rpm', shell=True).wait() + + +@step('Open nautilus and click on "{package}"') +def open_in_nautilus(context, package): + context.nautilus = App('nautilus', recordVideo=False, forceKill=False, desktopFileName='org.gnome.Nautilus') + context.nautilus.parameters = '/home/test/Downloads' + context.nautilus.startViaCommand(insideSession=True) + context.nautilus.instance = root.application('nautilus') + context.nautilus.instance.findChild(lambda x: package in x.name).doubleClick() + sleep(10) + context.app.instance = root.application('gnome-software') + + +@then(u'Each extension has only one entry') +def buttons_inside_list(context): + buttons = context.app.instance.findChildren(lambda x: x.roleName=='push button') + names = [x.name for x in buttons] + for name in names: + assert names.count(name) == 1, 'Item %s is listed more than once'%name + + +@step(u'There is no message "{msg}"') +def check_stdout_stderr(context, msg): + out, err = context.proc.communicate() + assert 'Gs-WARNING' not in out.decode('utf-8'), '%s'%out + assert 'Gs-WARNING' not in out.decode('utf-8'), '%s'%err + assert msg not in out.decode('utf-8'), '%s'%out + assert msg not in err.decode('utf-8'), '%s'%err + + +@step(u'Repo "{repo}" is not in non free repos and list should be empty') +def check_non_free_repos(context, repo): + proc = popener('gsettings get org.gnome.software nonfree-sources') + while (True): + try: + out= proc.communicate()[0].decode('utf-8') + assert repo not in out, '%s repo is installed'%out + assert '' in out, '3rd party repos should be [], the value is: %s'%out + except ValueError: + break; + +# just check of auth window appeared, if so, handle it properly +@step(u"Handle authentication dialog") +def handle_auth_window(context): + try: + root.application('gnome-shell').findChild(lambda x: x.showing and \ + x.name=='Authenticate' and x.roleName=='push button') + typeText('redhat') + pressKey('Enter') + except SearchError: + pass + + +def btn_showing(context, name, roleName='push button', msg='Button not found'): + assert wait_until(lambda x: x.findChild(lambda x: + x.name==name and x.roleName==roleName and x.showing),\ + context.app.instance, timeout=450), msg + + +def popener(cmd, wait=False): + proc = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE) + if wait: + proc.wait() + return proc + + +def get_cmd_output(cmd): + return popener(cmd, wait=True).communicate() + + +def toggle_btn_checked(context, name, checked=False, role_name='toggle button'): + if checked: + assert context.app.instance.child(name, roleName=role_name).checked + else: + assert not context.app.instance.child(name, roleName=role_name).checked + + +def node_visible(context, name, role_name, visible=True): + if visible: + assert context.app.instance.child(name, roleName=role_name).visible + else: + assert not context.app.instance.child(name, roleName=role_name).visible diff --git a/gnome_terminal/mapper.yaml b/gnome_terminal/mapper.yaml new file mode 100644 index 0000000..4466f87 --- /dev/null +++ b/gnome_terminal/mapper.yaml @@ -0,0 +1,85 @@ +component: + arches: + - all + name: gnome-software + tcms: 24836 + +dependencies: + beaker-tasks: + - /desktop/fedora28/install + packages: + - gnome-software + +beaker-hardware: +- x86_64: + group: desktopqe-vm + variant: Workstation + +setup: + +cleanup: + +testmapper: +- start_via_command +- gmenu_items +- gmenu_quit +- gmenu_about +- about_dialog +- software_sources +- start_via_command_no_warning +- featured +- details_page +- search_app +- search_source_entry +- installed_page +- updates_page +- overview_page +- categories +- picks +- install: + timeout: 30m +- remove: + timeout: 30m +- extension_install: + timeout: 30m +- extension_remove: + timeout: 30m +- extension_count +- rpm_download +- install_startup_apps +- no_third_party_repos +- flatpak_list: + timeout: 15m + arches-exclude: + - s390x + - ppc64 + - ppc64le + - aarch64 +- flatpak_install: + timeout: 30m + arches-exclude: + - s390x + - ppc64 + - ppc64le + - aarch64 +- flatpak_remove: + timeout: 30m + arches-exclude: + - s390x + - ppc64 + - ppc64le + - aarch64 +- flatpak_download: + timeout: 15m + arches-exclude: + - s390x + - ppc64 + - ppc64le + - aarch64 +- flathub: + timeout: 2h + arches-exclude: + - s390x + - ppc64 + - ppc64le + - aarch64 diff --git a/gnome_terminal/runtest.sh b/gnome_terminal/runtest.sh new file mode 100755 index 0000000..05d8657 --- /dev/null +++ b/gnome_terminal/runtest.sh @@ -0,0 +1,20 @@ +source common_steps/gdm-control.sh +#!/bin/bash +#env GIT_SSL_NO_VERIFY=true git submodule update --init --recursive +# Here we store exit code for the task in tmp file +# Because we need a report +# TODO: write a better rhts-run-simple-test +set -x +start-gdm + +sudo -u test dogtail-run-headless-next --dont-start --dont-kill "python3 -m behave -t $1 -k -f plain --no-capture"; + +stop-gdm + +rc=$? +RESULT="FAIL" +if [ $rc -eq 0 ]; then + RESULT="PASS" +fi +rhts-report-result $TEST $RESULT "/tmp/report_$TEST.html" +exit $rc diff --git a/gnome_terminal/scenarios.adoc b/gnome_terminal/scenarios.adoc new file mode 100644 index 0000000..9b4ab02 --- /dev/null +++ b/gnome_terminal/scenarios.adoc @@ -0,0 +1,22 @@ += Scenario notes for creating gnome-terminal related tests + +== Help + +1. The menu bar (roleName = menu bar) shows Help (name = Help, roleName = menu). +2. Inside, there is Contents (name = Contents, roleName = menu item) that starts +3. yelp (name = yelp, roleName=application) this yelp has a +4. frame (name = Terminal, roleName = frame). + +== About + +1. The menu bar (roleName = menu bar) shows Help (name = Help, roleName = menu). +2. Inside, there is About (name = About, roleName = menu item) that starts +3. Gnome terminal About dialog (name = About GNOME Terminal, roleName = dialog) + +== Show Menus + +1. Click on menu bar, View. +2. Click on Show Menubar (name) +3. menubar.visible == False +4. terminal (roleName) click(3) +5. pressKey('m')