From bfcdcb377f8b6abfd0374b20807f080f20faf365 Mon Sep 17 00:00:00 2001 From: suellenz <35066873+suellenz@users.noreply.github.com> Date: Thu, 7 Jun 2018 15:04:28 -0300 Subject: [PATCH] Hotfix/log and redirect bugfixes (#9) * Fixed errors in log and redirect to home. --- parakeet/__version__.py | 2 +- parakeet/browser.py | 6 +++--- parakeet/common_steps.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/parakeet/__version__.py b/parakeet/__version__.py index 4b5e18e..4b94f8f 100644 --- a/parakeet/__version__.py +++ b/parakeet/__version__.py @@ -5,4 +5,4 @@ # |_| \__,_|_| \__,_|_|\_\___|\___|\__| -__version__ = '0.0.13' +__version__ = '0.0.14' diff --git a/parakeet/browser.py b/parakeet/browser.py index e9a8308..2740093 100644 --- a/parakeet/browser.py +++ b/parakeet/browser.py @@ -49,7 +49,7 @@ def click_and_wait_disappear(self): def type(self, value, type_pause=0): _type_pause = type_pause if type_pause > 0 else self.parakeet.type_pause - LOG.debug('type {} {}'.format(value, _type_pause)) + LOG.debug('type {} {}'.format(value.encode('utf-8', 'replace'), _type_pause)) self.element = self.wait_visibility_of_element_located() self._type_handle(_type_pause, value) @@ -61,11 +61,11 @@ def _type_handle(self, _type_pause, value): if _type_pause > 0: self._type_slowly(value, _type_pause) else: - LOG.debug('type_normal {}'.format(value)) + LOG.debug('type_normal {}'.format(value.encode('utf-8', 'replace'))) self.element.send_keys(value) def _type_slowly(self, value, type_pause): - LOG.debug('type_slowly {}'.format(value)) + LOG.debug('type_slowly {}'.format(value.encode('utf-8', 'replace'))) if not (type_pause and isinstance(type_pause, float) and 0.0 < type_pause < 1): raise ValueError( diff --git a/parakeet/common_steps.py b/parakeet/common_steps.py index 4b65837..479416d 100644 --- a/parakeet/common_steps.py +++ b/parakeet/common_steps.py @@ -18,7 +18,7 @@ def login(step, user_name): google_oauth(user_name) elif world.cfg['login_provider'] == 'google_oauth_gapi2': google_oauth_gapi2(user_name) - LoginPage(world.browser, world.cfg['system_page_title']).redirect_to_home() + LoginPage(world.browser, world.cfg['system_page_title']).redirect_to_home() def google_oauth(user_name):