Skip to content

Commit

Permalink
Merge branch 'release/0.11.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
rgonalo committed Nov 11, 2015
2 parents ce69b69 + 39b2cdd commit 321102b
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Toolium Changelog
v0.11.2
-------

*In development*
*Release date: 2015-11-11*

- Compatibility with Python 3

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.11.dev2
0.11.2
5 changes: 3 additions & 2 deletions toolium/lettuce/terrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import re

from lettuce import before, after, world # @UnresolvedImport

from toolium import toolium_driver
from toolium.utils import Utils
from toolium.jira import add_jira_status, change_all_jira_status
Expand Down Expand Up @@ -97,8 +98,8 @@ def finalize_driver(video_name, test_passed=True):
world.driver = None

# Download saved video if video is enabled or if test fails
if world.remote_video_node and (toolium_driver.config.getboolean_optional('Server', 'video_enabled')
or not test_passed):
if world.remote_video_node and (toolium_driver.config.getboolean_optional('Server', 'video_enabled') or
not test_passed):
video_name = video_name if test_passed else 'error_{}'.format(video_name)
world.utils.download_remote_video(world.remote_video_node, session_id, video_name)

Expand Down
2 changes: 1 addition & 1 deletion toolium/pageobjects/page_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ def _update_page_elements(self):
element.set_driver(self.driver)
element.set_utils(self.utils)
# If element is page object, update its page elements
element._update_page_elements()
element._update_page_elements()
2 changes: 1 addition & 1 deletion toolium/test/pageelements/test_page_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def test_select_option(self):

self.assertEqual(len(select_page_element.SeleniumSelect.mock_calls), 1)
self.assertEqual(select_page_element.SeleniumSelect().mock_calls,
[mock.call.select_by_visible_text('new option value')])
[mock.call.select_by_visible_text('new option value')])

def test_click_button(self):
page_object = LoginPageObject(self.driver)
Expand Down
6 changes: 3 additions & 3 deletions toolium/test/test_driver_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_configure_properties_android(self):
self.assertEqual('android', self.wrapper.config.get('Browser', 'browser')) # get last value
self.assertEqual(None, self.wrapper.config.get_optional('Common', 'implicitly_wait')) # only in properties
self.assertEqual('http://invented_url/Demo.apk',
self.wrapper.config.get_optional('AppiumCapabilities', 'app')) # only in android
self.wrapper.config.get_optional('AppiumCapabilities', 'app')) # only in android

def test_configure_properties_two_files(self):
os.environ["Config_prop_filenames"] = (os.path.join(self.root_path, 'conf', 'properties.cfg') + ';' +
Expand All @@ -73,7 +73,7 @@ def test_configure_properties_two_files(self):
self.assertEqual('android', self.wrapper.config.get('Browser', 'browser')) # get last value
self.assertEqual('5', self.wrapper.config.get_optional('Common', 'implicitly_wait')) # only in properties
self.assertEqual('http://invented_url/Demo.apk',
self.wrapper.config.get_optional('AppiumCapabilities', 'app')) # only in android
self.wrapper.config.get_optional('AppiumCapabilities', 'app')) # only in android

def test_configure_properties_two_files_android_first(self):
os.environ["Config_prop_filenames"] = (os.path.join(self.root_path, 'conf', 'android-properties.cfg') + ';' +
Expand All @@ -82,7 +82,7 @@ def test_configure_properties_two_files_android_first(self):
self.assertEqual('firefox', self.wrapper.config.get('Browser', 'browser')) # get last value
self.assertEqual('5', self.wrapper.config.get_optional('Common', 'implicitly_wait')) # only in properties
self.assertEqual('http://invented_url/Demo.apk',
self.wrapper.config.get_optional('AppiumCapabilities', 'app')) # only in android
self.wrapper.config.get_optional('AppiumCapabilities', 'app')) # only in android

def test_configure_properties_system_property(self):
os.environ["Config_prop_filenames"] = os.path.join(self.root_path, 'conf', 'properties.cfg')
Expand Down
4 changes: 2 additions & 2 deletions toolium/test/test_test_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def run_mock(test_name):


class BasicTestCaseTests(unittest.TestCase):
def test_tearDown_pass(self):
def test_tear_down_pass(self):
# Configure logger mock
logger = mock.MagicMock()
logging.getLogger = mock.MagicMock(return_value=logger)
Expand All @@ -64,7 +64,7 @@ def test_tearDown_pass(self):
expected_response = "The test 'MockTestClass.mock_pass' has passed"
logger.info.assert_called_with(expected_response)

def test_tearDown_fail(self):
def test_tear_down_fail(self):
# Configure logger mock
logger = mock.MagicMock()
logging.getLogger = mock.MagicMock(return_value=logger)
Expand Down
8 changes: 4 additions & 4 deletions toolium/test/test_visual_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def test_get_element_locator(self):
self.assertEqual('mock_element', element)
toolium_driver.driver.find_element.assert_called_with(*element_locator)

def test_assertScreenshot_full_and_save_baseline(self):
def test_assert_screenshot_full_and_save_baseline(self):
# Create driver mock
def copy_file_side_effect(output_file):
shutil.copyfile(self.file_v1, output_file)
Expand All @@ -199,7 +199,7 @@ def copy_file_side_effect(output_file):
'screenshot_full.png')
Engine().assertSameFiles(output_file, baseline_file, 0)

def test_assertScreenshot_element_and_save_baseline(self):
def test_assert_screenshot_element_and_save_baseline(self):
# Create element mock
element = get_mock_element(x=250, y=40, height=40, width=300)

Expand All @@ -222,7 +222,7 @@ def test_assertScreenshot_element_and_save_baseline(self):
'screenshot_elem.png')
Engine().assertSameFiles(output_file, baseline_file, 0)

def test_assertScreenshot_full_and_compare(self):
def test_assert_screenshot_full_and_compare(self):
# Create driver mock
def copy_file_side_effect(output_file):
shutil.copyfile(self.file_v1, output_file)
Expand All @@ -239,7 +239,7 @@ def copy_file_side_effect(output_file):
output_file = os.path.join(self.visual.output_directory, '01_screenshot_full__screenshot_suffix.png')
toolium_driver.driver.save_screenshot.assert_called_with(output_file)

def test_assertScreenshot_element_and_compare(self):
def test_assert_screenshot_element_and_compare(self):
# Add baseline image
expected_image = os.path.join(self.root_path, 'resources', 'register_cropped_element.png')
baseline_file = os.path.join(self.root_path, 'output', 'visualtests', 'baseline', 'firefox-base',
Expand Down
4 changes: 2 additions & 2 deletions toolium/test_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ def _finalize_driver(cls, video_name, test_passed=True):
SeleniumTestCase.driver = None

# Download saved video if video is enabled or if test fails
if cls.remote_video_node and (toolium_driver.config.getboolean_optional('Server', 'video_enabled')
or not test_passed):
if cls.remote_video_node and (toolium_driver.config.getboolean_optional('Server', 'video_enabled') or
not test_passed):
video_name = video_name if test_passed else 'error_{}'.format(video_name)
cls.utils.download_remote_video(cls.remote_video_node, session_id, video_name)

Expand Down

0 comments on commit 321102b

Please sign in to comment.