diff options
Diffstat (limited to 'test/data/features')
-rw-r--r-- | test/data/features/app-menu.feature | 24 | ||||
-rw-r--r-- | test/data/features/basics.feature | 29 | ||||
-rw-r--r-- | test/data/features/environment.py | 97 | ||||
-rw-r--r-- | test/data/features/steps/__init__.py | 4 | ||||
-rw-r--r-- | test/data/features/steps/empathy_steps.py | 8 |
5 files changed, 162 insertions, 0 deletions
diff --git a/test/data/features/app-menu.feature b/test/data/features/app-menu.feature new file mode 100644 index 0000000..d38e81e --- /dev/null +++ b/test/data/features/app-menu.feature @@ -0,0 +1,24 @@ +Feature: Empathy App menu actions + + Background: Empathy Setup + * Make sure that Empathy is running + * I open GApplication menu + + @testcase_184264 + Scenario: Contact list - help contents + * I click menu "Help" in GApplication menu + Then Yelp should start + +# 1. Choose 'application menu->Accounts' +# 2. In the 'Messaging and VoIP Accounts' click + to add a new account +# 3. Select 'Google Talk' +# 4. Put 'desktopqe@gmail.com' as a Google ID +# 5. Put 'redhatqe' as password +# 6. Check 'Remember Password' +# 7. Hit 'Apply' + +# @testcase_181366 +# Scenario: Add account - GTalk +# * I click menu "Accounts" in GApplication menu +# Then Account should successfully connect (be 'Available') +# diff --git a/test/data/features/basics.feature b/test/data/features/basics.feature new file mode 100644 index 0000000..4203e79 --- /dev/null +++ b/test/data/features/basics.feature @@ -0,0 +1,29 @@ +@testplan_6306 +Feature: Empathy basics + +# Works probably only in the Gnome3 Classic mode +# +# @testcase_175167 +# Scenario: Close via application menu +# * Make sure that Empathy is running +# * Click to the Empathy on gnome-panel +# * Click Quit +# Then Empathy should quit correctly + + @testcase_172128 + Scenario: Exit using menu + * Make sure that Empathy is running + * I open GApplication menu + * I click menu "Quit" in GApplication menu + Then empathy shouldn't be running anymore + + @testcase_172129 + Scenario: Exit using shortcut + * Make sure that Empathy is running + * Press "<Control>Q" + Then Empathy shouldn't be running anymore + + @testcase_172130 + Scenario: Start using Activities + * Start Empathy via menu + Then Empathy should start diff --git a/test/data/features/environment.py b/test/data/features/environment.py new file mode 100644 index 0000000..dc09990 --- /dev/null +++ b/test/data/features/environment.py @@ -0,0 +1,97 @@ +# -*- coding: UTF-8 -*- + +import os +from common_steps.helpers import dummy, App +from gi.repository import Gio +from dogtail.config import config +import logging +logging.basicConfig(format='%(levelname)s:%(funcName)s:%(message)s', + level=logging.INFO) +from time import sleep + + +def before_all(context): + """Setup empathy stuff + Being executed before all features + """ + + # Reset GSettings + schemas = [x for x + in Gio.Settings.list_schemas() if 'empathy' in x.lower()] + for schema in schemas: + os.system("gsettings reset-recursively %s" % schema) + + # Skip warning dialog + #os.system("gsettings set org.gnome.empathy.shell skip-wrnng-dialog true") + + # Wait for things to settle + sleep(0.5) + + # Skip dogtail actions to print to stdout + config.logDebugToStdOut = False + config.typingDelay = 0.2 + + # Include assertion object + context.assertion = dummy() + + context.app = App('empathy', + # Store evo output in the empathy.log + parameters='> empathy.log 2>&1', + clean_dirs=['~/.local/share/Empathy', + '~/.local/share/telepathy', + '~/.local/share/telepathy-logger', + '~/.cache/Empathy', '~/.cache/telepathy', + '~/.config/Empathy']) + + +def before_tag(context, tag): + """Setup for scenarios marked with tag + If tag contains 'goa', then setup a goa account: + google_goa will setup Google account etc. + """ + try: + if 'goa' in tag: + context.execute_steps( + u"* Add %s account via GOA" % tag.split('_')[1].capitalize()) + except Exception as e: + print("error in before_tag(%s): %s" % (tag, e.message)) + raise RuntimeError + + +def after_step(context, step): + """Teardown after each step. + Here we make screenshot and embed it (if one of formatters supports it) + """ + try: + # Make screnshot if step has failed + if hasattr(context, "embed"): + os.system("gnome-screenshot -f /tmp/screenshot.jpg") + context.embed('image/jpg', open("/tmp/screenshot.jpg", 'r').read()) + + if step.status == 'failed' and os.environ.get('DEBUG_ON_FAILURE'): + import ipdb + ipdb.set_trace() + + except Exception: + #print("Error in after_step: %s" % e) + pass + + +def after_scenario(context, scenario): + """Teardown for each scenario + Kill empathy (in order to make this reliable we send sigkill) + """ + try: + # Stop empathy + os.system("pkill -f empathy &> /dev/null") + + # Attach logs + if hasattr(context, "embed"): + context.embed('text/plain', open("empathy.log", 'r').read()) + os.system("rm -rf empathy.log") + + # Make some pause after scenario + sleep(10) + except Exception: + # Stupid behave simply crashes in case exception has occurred + pass diff --git a/test/data/features/steps/__init__.py b/test/data/features/steps/__init__.py new file mode 100644 index 0000000..9d8b553 --- /dev/null +++ b/test/data/features/steps/__init__.py @@ -0,0 +1,4 @@ +from common_steps.dialogs import * +from common_steps.app import * +from common_steps.gmenu import * +from common_steps.helpers import * diff --git a/test/data/features/steps/empathy_steps.py b/test/data/features/steps/empathy_steps.py new file mode 100644 index 0000000..1eafd65 --- /dev/null +++ b/test/data/features/steps/empathy_steps.py @@ -0,0 +1,8 @@ +# -- FILE: features/steps/example_steps.py +# import os +# from gi.repository import GLib +# from behave import then, step +# from time import sleep +# #from subprocess import Popen, PIPE +# from dogtail.tree import root, SearchError +# from dogtail.rawinput import keyCombo |