From d4ff793158e1918132ddc48955715f37f95dd535 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Fri, 27 May 2016 11:58:39 +0200 Subject: [PATCH 01/28] Fix failing tests due to the use of deprecated assert_equals. --- tests/scenarios/po/widget_no_uri_attr.py | 2 +- tests/scenarios/po/widget_rel_uri_attr.py | 8 ++++---- tests/scenarios/po/widget_rel_uri_no_name_attr.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/scenarios/po/widget_no_uri_attr.py b/tests/scenarios/po/widget_no_uri_attr.py index edaf867..32ecfc4 100755 --- a/tests/scenarios/po/widget_no_uri_attr.py +++ b/tests/scenarios/po/widget_no_uri_attr.py @@ -10,7 +10,7 @@ class SearchResultPage(Page): @robot_alias("__name__should_have_results") def should_have_results(self, expected): len_results = len(self.find_elements("xpath=id('results')/li", required=False)) - asserts.assert_equals(len_results, int(expected), "Unexpected number of results found on %s, got %s, " + asserts.assert_equal(len_results, int(expected), "Unexpected number of results found on %s, got %s, " "expected %s" %( self.name, len_results, expected)) diff --git a/tests/scenarios/po/widget_rel_uri_attr.py b/tests/scenarios/po/widget_rel_uri_attr.py index cde1c85..5bec179 100755 --- a/tests/scenarios/po/widget_rel_uri_attr.py +++ b/tests/scenarios/po/widget_rel_uri_attr.py @@ -30,20 +30,20 @@ def click_delayed_content_button(self): def delayed_content_should_exist(self): text = self.get_text("delayed content") - asserts.assert_equals(text, "I took about 2 seconds to be inserted") + asserts.assert_equal(text, "I took about 2 seconds to be inserted") return self def delayed_content_should_exist_explicit(self): # This should raise a ValueError, since we told find_element not to wait. text = self.find_element("delayed content", wait=0).text - asserts.assert_equals(text, "I took about 2 seconds to be inserted") + asserts.assert_equal(text, "I took about 2 seconds to be inserted") return self def delayed_content_should_exist_explicit_calling_find_elements(self): # This should raise a ValueError, since we told find_element not to wait. els = self.find_elements("delayed content", wait=0) text = els[0].text - asserts.assert_equals(text, "I took about 2 seconds to be inserted") + asserts.assert_equal(text, "I took about 2 seconds to be inserted") return self def get_templated_selector_element_text(self): @@ -61,7 +61,7 @@ class SearchResultPage(Page): @robot_alias("__name__should_have_results") def should_have_results(self, expected): len_results = len(self.find_elements("results")) - asserts.assert_equals(len_results, int(expected), "Unexpected number of results found on %s, got %s, " + asserts.assert_equal(len_results, int(expected), "Unexpected number of results found on %s, got %s, " "expected %s" %(self.name, len_results, expected)) return self diff --git a/tests/scenarios/po/widget_rel_uri_no_name_attr.py b/tests/scenarios/po/widget_rel_uri_no_name_attr.py index acf3394..401ed6b 100755 --- a/tests/scenarios/po/widget_rel_uri_no_name_attr.py +++ b/tests/scenarios/po/widget_rel_uri_no_name_attr.py @@ -19,7 +19,7 @@ class WidgetSearchResultPage(Page): @robot_alias("__name__should_have_results") def should_have_results(self, expected): len_results = len(self.find_elements("xpath=id('results')/li", required=False)) - asserts.assert_equals(len_results, int(expected), "Unexpected number of results found on %s, got %s, " + asserts.assert_equal(len_results, int(expected), "Unexpected number of results found on %s, got %s, " "expected %s" %( self.name, len_results, expected)) return self From d7fb8500d8fde49cb6ca0a5457433e2453caa03b Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Fri, 27 May 2016 11:59:32 +0200 Subject: [PATCH 02/28] Add a few files that were missing in .gitignore. --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 98cbbde..99c1d72 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ RELEASE-VERSION .idea *.pyc *.egg-info +*.egg *.log report.html log.html @@ -9,4 +10,6 @@ output.xml \#*\# *~ nosetests.xml -po_log.txt \ No newline at end of file +po_log.txt +libdoc.xml + From 1ba149120073302637a50dd417d3bc2920681172 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Fri, 10 Jun 2016 15:20:16 +0200 Subject: [PATCH 03/28] Run tests against Python 3.5 and allow those to fail on travis (for now). --- .travis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3d443ad..2253dab 100755 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,11 @@ env: secure: aStjr7/mZJDdPqJ210HPRZygxXA36SzXyBraK9x6eqaDR+yqZpGJBIYMlRzqV1Fwlh1BUFbOYNczmLEQs+Sf3uPxyEWhFc5L0qKlvUE98fsf6IJuFJdwfwBG1/vrJTNm0JviBI/6lPlB2/EYtJJBWmYQGsrXXoP5Cc38T+z/a0s= language: python python: - - "2.7" + - 2.7 + - 3.5 +matrix: + allow_failures: + - python: 3.5 install: - pip install . script: From c332b5ef084937b7e0ac3876137ea4935f14ac9d Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Fri, 10 Jun 2016 15:40:15 +0200 Subject: [PATCH 04/28] Move tests folder into robotpageobjects in order to allow proper imports. --- .travis.yml | 2 +- {tests => robotpageobjects/tests}/README.md | 0 {tests => robotpageobjects/tests}/__init.__.py | 0 {tests => robotpageobjects/tests}/basetestcase.py | 0 {tests => robotpageobjects/tests}/sauce_vars.py | 0 {tests => robotpageobjects/tests}/scenarios/__init__.py | 0 {tests => robotpageobjects/tests}/scenarios/po/__init__.py | 0 .../tests}/scenarios/po/basepageobjects/__init__.py | 0 .../tests}/scenarios/po/basepageobjects/homepage.py | 0 .../tests}/scenarios/po/basepageobjects/resultspage.py | 0 .../tests}/scenarios/po/keyword_naming.py | 0 {tests => robotpageobjects/tests}/scenarios/po/loggingpage.py | 0 .../tests}/scenarios/po/mydbpageobjects/__init__.py | 0 .../tests}/scenarios/po/mydbpageobjects/homepage.py | 0 .../tests}/scenarios/po/mydbpageobjects/resultspage.py | 0 {tests => robotpageobjects/tests}/scenarios/po/ncbi.py | 0 {tests => robotpageobjects/tests}/scenarios/po/nouripage.py | 0 .../tests}/scenarios/po/page_with_component.py | 0 .../tests}/scenarios/po/result_component.py | 0 .../tests}/scenarios/po/selectors_duplicate.py | 0 .../tests}/scenarios/po/selectors_page.py | 0 .../tests}/scenarios/po/stacktracepage.py | 0 .../tests}/scenarios/po/widget_no_uri_attr.py | 0 .../tests}/scenarios/po/widget_rel_uri_attr.py | 0 .../tests}/scenarios/po/widget_rel_uri_no_name_attr.py | 0 .../tests}/scenarios/po/widget_template.py | 0 .../tests}/scenarios/site/category/home-and-garden/123.html | 0 {tests => robotpageobjects/tests}/scenarios/site/index.html | 0 {tests => robotpageobjects/tests}/scenarios/site/result.html | 0 .../tests}/scenarios/test_bad_selector.py | 0 .../scenarios/test_can_call_aliased_method_with_page_name.robot | 0 .../test_can_call_aliased_method_without_page_name.robot | 0 .../test_can_call_unaliased_method_with_page_name.robot | 0 .../tests}/scenarios/test_does_not_return.robot | 0 ...fy_page_name_for_keyword_when_2_page_objects_define_it.robot | 0 ...fy_page_name_in_keyword_when_2_page_objects_inherit_it.robot | 0 ...ave_to_specify_page_name_when_extending_se2lib_keyword.robot | 0 {tests => robotpageobjects/tests}/scenarios/test_fail.py | 0 {tests => robotpageobjects/tests}/scenarios/test_fail.robot | 0 .../tests}/scenarios/test_fail_se2lib_keyword.robot | 0 .../tests}/scenarios/test_find_elements_with_selector.py | 0 {tests => robotpageobjects/tests}/scenarios/test_go_to.py | 0 {tests => robotpageobjects/tests}/scenarios/test_go_to.robot | 0 .../tests}/scenarios/test_implicit_se_wait.py | 0 .../tests}/scenarios/test_implicit_se_wait_0.py | 0 {tests => robotpageobjects/tests}/scenarios/test_is_visible.py | 0 .../scenarios/test_location_should_be_for_absolute_path.py | 0 .../scenarios/test_location_should_be_for_relative_path.py | 0 .../tests}/scenarios/test_log_above_threshold.robot | 0 .../tests}/scenarios/test_log_at_threshold.py | 0 .../tests}/scenarios/test_log_at_threshold.robot | 0 .../tests}/scenarios/test_log_at_threshold_is_console_false.py | 0 .../tests}/scenarios/test_log_below_threshold.py | 0 .../tests}/scenarios/test_log_below_threshold.robot | 0 .../scenarios/test_log_below_threshold_is_console_false.py | 0 .../scenarios/test_log_below_threshold_is_console_false.robot | 0 .../tests}/scenarios/test_manual_screen_shot.py | 0 .../tests}/scenarios/test_manual_screen_shot.robot | 0 .../scenarios/test_negative_index_in_table_keywords.robot | 0 {tests => robotpageobjects/tests}/scenarios/test_no_selector.py | 0 {tests => robotpageobjects/tests}/scenarios/test_no_uri.robot | 0 .../scenarios/test_page_override_without_override_class.py | 0 .../tests}/scenarios/test_page_with_component.robot | 0 .../tests}/scenarios/test_pass_explicit_wait_to_find_element.py | 0 .../tests}/scenarios/test_rel_uri_attr.py | 0 .../tests}/scenarios/test_rel_uri_attr.robot | 0 .../tests}/scenarios/test_rel_uri_attr_no_name_attr.robot | 0 .../tests}/scenarios/test_s2l_imported_multiple_a.robot | 0 .../tests}/scenarios/test_s2l_imported_multiple_b.robot | 0 .../tests}/scenarios/test_s2l_keyword_with_selector.robot | 0 {tests => robotpageobjects/tests}/scenarios/test_sauce.py | 0 {tests => robotpageobjects/tests}/scenarios/test_sauce.robot | 0 .../tests}/scenarios/test_se2lib_called_before_po.robot | 0 .../tests}/scenarios/test_se2lib_imported_before_po.robot | 0 .../tests}/scenarios/test_selector_self_ref.py | 0 .../tests}/scenarios/test_selector_with_se2lib_keyword.robot | 0 .../tests}/scenarios/test_stack_trace.robot | 0 .../tests}/scenarios/test_template_passed.py | 0 .../tests}/scenarios/test_template_passed.robot | 0 .../tests}/scenarios/test_templated_selector.py | 0 .../tests}/scenarios/test_templated_selector_wrong_num.py | 0 ...arning_log_warning_logs_warning_to_file_and_stdout_python.py | 0 .../tests}/scenarios/test_wait_until_not_visible.py | 0 {tests => robotpageobjects/tests}/test_functional.py | 0 {tests => robotpageobjects/tests}/test_unit.py | 0 {tests => robotpageobjects/tests}/vars.py | 0 86 files changed, 1 insertion(+), 1 deletion(-) rename {tests => robotpageobjects/tests}/README.md (100%) rename {tests => robotpageobjects/tests}/__init.__.py (100%) rename {tests => robotpageobjects/tests}/basetestcase.py (100%) rename {tests => robotpageobjects/tests}/sauce_vars.py (100%) rename {tests => robotpageobjects/tests}/scenarios/__init__.py (100%) rename {tests => robotpageobjects/tests}/scenarios/po/__init__.py (100%) rename {tests => robotpageobjects/tests}/scenarios/po/basepageobjects/__init__.py (100%) rename {tests => robotpageobjects/tests}/scenarios/po/basepageobjects/homepage.py (100%) rename {tests => robotpageobjects/tests}/scenarios/po/basepageobjects/resultspage.py (100%) rename {tests => robotpageobjects/tests}/scenarios/po/keyword_naming.py (100%) rename {tests => robotpageobjects/tests}/scenarios/po/loggingpage.py (100%) rename {tests => robotpageobjects/tests}/scenarios/po/mydbpageobjects/__init__.py (100%) rename {tests => robotpageobjects/tests}/scenarios/po/mydbpageobjects/homepage.py (100%) rename {tests => robotpageobjects/tests}/scenarios/po/mydbpageobjects/resultspage.py (100%) rename {tests => robotpageobjects/tests}/scenarios/po/ncbi.py (100%) rename {tests => robotpageobjects/tests}/scenarios/po/nouripage.py (100%) rename {tests => robotpageobjects/tests}/scenarios/po/page_with_component.py (100%) rename {tests => robotpageobjects/tests}/scenarios/po/result_component.py (100%) rename {tests => robotpageobjects/tests}/scenarios/po/selectors_duplicate.py (100%) rename {tests => robotpageobjects/tests}/scenarios/po/selectors_page.py (100%) rename {tests => robotpageobjects/tests}/scenarios/po/stacktracepage.py (100%) rename {tests => robotpageobjects/tests}/scenarios/po/widget_no_uri_attr.py (100%) rename {tests => robotpageobjects/tests}/scenarios/po/widget_rel_uri_attr.py (100%) rename {tests => robotpageobjects/tests}/scenarios/po/widget_rel_uri_no_name_attr.py (100%) rename {tests => robotpageobjects/tests}/scenarios/po/widget_template.py (100%) rename {tests => robotpageobjects/tests}/scenarios/site/category/home-and-garden/123.html (100%) rename {tests => robotpageobjects/tests}/scenarios/site/index.html (100%) rename {tests => robotpageobjects/tests}/scenarios/site/result.html (100%) rename {tests => robotpageobjects/tests}/scenarios/test_bad_selector.py (100%) rename {tests => robotpageobjects/tests}/scenarios/test_can_call_aliased_method_with_page_name.robot (100%) rename {tests => robotpageobjects/tests}/scenarios/test_can_call_aliased_method_without_page_name.robot (100%) rename {tests => robotpageobjects/tests}/scenarios/test_can_call_unaliased_method_with_page_name.robot (100%) rename {tests => robotpageobjects/tests}/scenarios/test_does_not_return.robot (100%) rename {tests => robotpageobjects/tests}/scenarios/test_dont_have_to_specify_page_name_for_keyword_when_2_page_objects_define_it.robot (100%) rename {tests => robotpageobjects/tests}/scenarios/test_dont_have_to_specify_page_name_in_keyword_when_2_page_objects_inherit_it.robot (100%) rename {tests => robotpageobjects/tests}/scenarios/test_dont_have_to_specify_page_name_when_extending_se2lib_keyword.robot (100%) rename {tests => robotpageobjects/tests}/scenarios/test_fail.py (100%) rename {tests => robotpageobjects/tests}/scenarios/test_fail.robot (100%) rename {tests => robotpageobjects/tests}/scenarios/test_fail_se2lib_keyword.robot (100%) rename {tests => robotpageobjects/tests}/scenarios/test_find_elements_with_selector.py (100%) rename {tests => robotpageobjects/tests}/scenarios/test_go_to.py (100%) rename {tests => robotpageobjects/tests}/scenarios/test_go_to.robot (100%) rename {tests => robotpageobjects/tests}/scenarios/test_implicit_se_wait.py (100%) rename {tests => robotpageobjects/tests}/scenarios/test_implicit_se_wait_0.py (100%) rename {tests => robotpageobjects/tests}/scenarios/test_is_visible.py (100%) rename {tests => robotpageobjects/tests}/scenarios/test_location_should_be_for_absolute_path.py (100%) rename {tests => robotpageobjects/tests}/scenarios/test_location_should_be_for_relative_path.py (100%) rename {tests => robotpageobjects/tests}/scenarios/test_log_above_threshold.robot (100%) rename {tests => robotpageobjects/tests}/scenarios/test_log_at_threshold.py (100%) rename {tests => robotpageobjects/tests}/scenarios/test_log_at_threshold.robot (100%) rename {tests => robotpageobjects/tests}/scenarios/test_log_at_threshold_is_console_false.py (100%) rename {tests => robotpageobjects/tests}/scenarios/test_log_below_threshold.py (100%) rename {tests => robotpageobjects/tests}/scenarios/test_log_below_threshold.robot (100%) rename {tests => robotpageobjects/tests}/scenarios/test_log_below_threshold_is_console_false.py (100%) rename {tests => robotpageobjects/tests}/scenarios/test_log_below_threshold_is_console_false.robot (100%) rename {tests => robotpageobjects/tests}/scenarios/test_manual_screen_shot.py (100%) rename {tests => robotpageobjects/tests}/scenarios/test_manual_screen_shot.robot (100%) rename {tests => robotpageobjects/tests}/scenarios/test_negative_index_in_table_keywords.robot (100%) rename {tests => robotpageobjects/tests}/scenarios/test_no_selector.py (100%) rename {tests => robotpageobjects/tests}/scenarios/test_no_uri.robot (100%) rename {tests => robotpageobjects/tests}/scenarios/test_page_override_without_override_class.py (100%) rename {tests => robotpageobjects/tests}/scenarios/test_page_with_component.robot (100%) rename {tests => robotpageobjects/tests}/scenarios/test_pass_explicit_wait_to_find_element.py (100%) rename {tests => robotpageobjects/tests}/scenarios/test_rel_uri_attr.py (100%) rename {tests => robotpageobjects/tests}/scenarios/test_rel_uri_attr.robot (100%) rename {tests => robotpageobjects/tests}/scenarios/test_rel_uri_attr_no_name_attr.robot (100%) rename {tests => robotpageobjects/tests}/scenarios/test_s2l_imported_multiple_a.robot (100%) rename {tests => robotpageobjects/tests}/scenarios/test_s2l_imported_multiple_b.robot (100%) rename {tests => robotpageobjects/tests}/scenarios/test_s2l_keyword_with_selector.robot (100%) rename {tests => robotpageobjects/tests}/scenarios/test_sauce.py (100%) rename {tests => robotpageobjects/tests}/scenarios/test_sauce.robot (100%) rename {tests => robotpageobjects/tests}/scenarios/test_se2lib_called_before_po.robot (100%) rename {tests => robotpageobjects/tests}/scenarios/test_se2lib_imported_before_po.robot (100%) rename {tests => robotpageobjects/tests}/scenarios/test_selector_self_ref.py (100%) rename {tests => robotpageobjects/tests}/scenarios/test_selector_with_se2lib_keyword.robot (100%) rename {tests => robotpageobjects/tests}/scenarios/test_stack_trace.robot (100%) rename {tests => robotpageobjects/tests}/scenarios/test_template_passed.py (100%) rename {tests => robotpageobjects/tests}/scenarios/test_template_passed.robot (100%) rename {tests => robotpageobjects/tests}/scenarios/test_templated_selector.py (100%) rename {tests => robotpageobjects/tests}/scenarios/test_templated_selector_wrong_num.py (100%) rename {tests => robotpageobjects/tests}/scenarios/test_threshold_at_warning_log_warning_logs_warning_to_file_and_stdout_python.py (100%) rename {tests => robotpageobjects/tests}/scenarios/test_wait_until_not_visible.py (100%) rename {tests => robotpageobjects/tests}/test_functional.py (100%) rename {tests => robotpageobjects/tests}/test_unit.py (100%) rename {tests => robotpageobjects/tests}/vars.py (100%) diff --git a/.travis.yml b/.travis.yml index 2253dab..afc0a68 100755 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ matrix: install: - pip install . script: - - nosetests -vs --with-xunit tests/test_unit.py tests/test_functional.py + - nosetests -vs --with-xunit robotpageobjects/tests/test_unit.py robotpageobjects/tests/test_functional.py deploy: provider: pypi user: hellmanj diff --git a/tests/README.md b/robotpageobjects/tests/README.md similarity index 100% rename from tests/README.md rename to robotpageobjects/tests/README.md diff --git a/tests/__init.__.py b/robotpageobjects/tests/__init.__.py similarity index 100% rename from tests/__init.__.py rename to robotpageobjects/tests/__init.__.py diff --git a/tests/basetestcase.py b/robotpageobjects/tests/basetestcase.py similarity index 100% rename from tests/basetestcase.py rename to robotpageobjects/tests/basetestcase.py diff --git a/tests/sauce_vars.py b/robotpageobjects/tests/sauce_vars.py similarity index 100% rename from tests/sauce_vars.py rename to robotpageobjects/tests/sauce_vars.py diff --git a/tests/scenarios/__init__.py b/robotpageobjects/tests/scenarios/__init__.py similarity index 100% rename from tests/scenarios/__init__.py rename to robotpageobjects/tests/scenarios/__init__.py diff --git a/tests/scenarios/po/__init__.py b/robotpageobjects/tests/scenarios/po/__init__.py similarity index 100% rename from tests/scenarios/po/__init__.py rename to robotpageobjects/tests/scenarios/po/__init__.py diff --git a/tests/scenarios/po/basepageobjects/__init__.py b/robotpageobjects/tests/scenarios/po/basepageobjects/__init__.py similarity index 100% rename from tests/scenarios/po/basepageobjects/__init__.py rename to robotpageobjects/tests/scenarios/po/basepageobjects/__init__.py diff --git a/tests/scenarios/po/basepageobjects/homepage.py b/robotpageobjects/tests/scenarios/po/basepageobjects/homepage.py similarity index 100% rename from tests/scenarios/po/basepageobjects/homepage.py rename to robotpageobjects/tests/scenarios/po/basepageobjects/homepage.py diff --git a/tests/scenarios/po/basepageobjects/resultspage.py b/robotpageobjects/tests/scenarios/po/basepageobjects/resultspage.py similarity index 100% rename from tests/scenarios/po/basepageobjects/resultspage.py rename to robotpageobjects/tests/scenarios/po/basepageobjects/resultspage.py diff --git a/tests/scenarios/po/keyword_naming.py b/robotpageobjects/tests/scenarios/po/keyword_naming.py similarity index 100% rename from tests/scenarios/po/keyword_naming.py rename to robotpageobjects/tests/scenarios/po/keyword_naming.py diff --git a/tests/scenarios/po/loggingpage.py b/robotpageobjects/tests/scenarios/po/loggingpage.py similarity index 100% rename from tests/scenarios/po/loggingpage.py rename to robotpageobjects/tests/scenarios/po/loggingpage.py diff --git a/tests/scenarios/po/mydbpageobjects/__init__.py b/robotpageobjects/tests/scenarios/po/mydbpageobjects/__init__.py similarity index 100% rename from tests/scenarios/po/mydbpageobjects/__init__.py rename to robotpageobjects/tests/scenarios/po/mydbpageobjects/__init__.py diff --git a/tests/scenarios/po/mydbpageobjects/homepage.py b/robotpageobjects/tests/scenarios/po/mydbpageobjects/homepage.py similarity index 100% rename from tests/scenarios/po/mydbpageobjects/homepage.py rename to robotpageobjects/tests/scenarios/po/mydbpageobjects/homepage.py diff --git a/tests/scenarios/po/mydbpageobjects/resultspage.py b/robotpageobjects/tests/scenarios/po/mydbpageobjects/resultspage.py similarity index 100% rename from tests/scenarios/po/mydbpageobjects/resultspage.py rename to robotpageobjects/tests/scenarios/po/mydbpageobjects/resultspage.py diff --git a/tests/scenarios/po/ncbi.py b/robotpageobjects/tests/scenarios/po/ncbi.py similarity index 100% rename from tests/scenarios/po/ncbi.py rename to robotpageobjects/tests/scenarios/po/ncbi.py diff --git a/tests/scenarios/po/nouripage.py b/robotpageobjects/tests/scenarios/po/nouripage.py similarity index 100% rename from tests/scenarios/po/nouripage.py rename to robotpageobjects/tests/scenarios/po/nouripage.py diff --git a/tests/scenarios/po/page_with_component.py b/robotpageobjects/tests/scenarios/po/page_with_component.py similarity index 100% rename from tests/scenarios/po/page_with_component.py rename to robotpageobjects/tests/scenarios/po/page_with_component.py diff --git a/tests/scenarios/po/result_component.py b/robotpageobjects/tests/scenarios/po/result_component.py similarity index 100% rename from tests/scenarios/po/result_component.py rename to robotpageobjects/tests/scenarios/po/result_component.py diff --git a/tests/scenarios/po/selectors_duplicate.py b/robotpageobjects/tests/scenarios/po/selectors_duplicate.py similarity index 100% rename from tests/scenarios/po/selectors_duplicate.py rename to robotpageobjects/tests/scenarios/po/selectors_duplicate.py diff --git a/tests/scenarios/po/selectors_page.py b/robotpageobjects/tests/scenarios/po/selectors_page.py similarity index 100% rename from tests/scenarios/po/selectors_page.py rename to robotpageobjects/tests/scenarios/po/selectors_page.py diff --git a/tests/scenarios/po/stacktracepage.py b/robotpageobjects/tests/scenarios/po/stacktracepage.py similarity index 100% rename from tests/scenarios/po/stacktracepage.py rename to robotpageobjects/tests/scenarios/po/stacktracepage.py diff --git a/tests/scenarios/po/widget_no_uri_attr.py b/robotpageobjects/tests/scenarios/po/widget_no_uri_attr.py similarity index 100% rename from tests/scenarios/po/widget_no_uri_attr.py rename to robotpageobjects/tests/scenarios/po/widget_no_uri_attr.py diff --git a/tests/scenarios/po/widget_rel_uri_attr.py b/robotpageobjects/tests/scenarios/po/widget_rel_uri_attr.py similarity index 100% rename from tests/scenarios/po/widget_rel_uri_attr.py rename to robotpageobjects/tests/scenarios/po/widget_rel_uri_attr.py diff --git a/tests/scenarios/po/widget_rel_uri_no_name_attr.py b/robotpageobjects/tests/scenarios/po/widget_rel_uri_no_name_attr.py similarity index 100% rename from tests/scenarios/po/widget_rel_uri_no_name_attr.py rename to robotpageobjects/tests/scenarios/po/widget_rel_uri_no_name_attr.py diff --git a/tests/scenarios/po/widget_template.py b/robotpageobjects/tests/scenarios/po/widget_template.py similarity index 100% rename from tests/scenarios/po/widget_template.py rename to robotpageobjects/tests/scenarios/po/widget_template.py diff --git a/tests/scenarios/site/category/home-and-garden/123.html b/robotpageobjects/tests/scenarios/site/category/home-and-garden/123.html similarity index 100% rename from tests/scenarios/site/category/home-and-garden/123.html rename to robotpageobjects/tests/scenarios/site/category/home-and-garden/123.html diff --git a/tests/scenarios/site/index.html b/robotpageobjects/tests/scenarios/site/index.html similarity index 100% rename from tests/scenarios/site/index.html rename to robotpageobjects/tests/scenarios/site/index.html diff --git a/tests/scenarios/site/result.html b/robotpageobjects/tests/scenarios/site/result.html similarity index 100% rename from tests/scenarios/site/result.html rename to robotpageobjects/tests/scenarios/site/result.html diff --git a/tests/scenarios/test_bad_selector.py b/robotpageobjects/tests/scenarios/test_bad_selector.py similarity index 100% rename from tests/scenarios/test_bad_selector.py rename to robotpageobjects/tests/scenarios/test_bad_selector.py diff --git a/tests/scenarios/test_can_call_aliased_method_with_page_name.robot b/robotpageobjects/tests/scenarios/test_can_call_aliased_method_with_page_name.robot similarity index 100% rename from tests/scenarios/test_can_call_aliased_method_with_page_name.robot rename to robotpageobjects/tests/scenarios/test_can_call_aliased_method_with_page_name.robot diff --git a/tests/scenarios/test_can_call_aliased_method_without_page_name.robot b/robotpageobjects/tests/scenarios/test_can_call_aliased_method_without_page_name.robot similarity index 100% rename from tests/scenarios/test_can_call_aliased_method_without_page_name.robot rename to robotpageobjects/tests/scenarios/test_can_call_aliased_method_without_page_name.robot diff --git a/tests/scenarios/test_can_call_unaliased_method_with_page_name.robot b/robotpageobjects/tests/scenarios/test_can_call_unaliased_method_with_page_name.robot similarity index 100% rename from tests/scenarios/test_can_call_unaliased_method_with_page_name.robot rename to robotpageobjects/tests/scenarios/test_can_call_unaliased_method_with_page_name.robot diff --git a/tests/scenarios/test_does_not_return.robot b/robotpageobjects/tests/scenarios/test_does_not_return.robot similarity index 100% rename from tests/scenarios/test_does_not_return.robot rename to robotpageobjects/tests/scenarios/test_does_not_return.robot diff --git a/tests/scenarios/test_dont_have_to_specify_page_name_for_keyword_when_2_page_objects_define_it.robot b/robotpageobjects/tests/scenarios/test_dont_have_to_specify_page_name_for_keyword_when_2_page_objects_define_it.robot similarity index 100% rename from tests/scenarios/test_dont_have_to_specify_page_name_for_keyword_when_2_page_objects_define_it.robot rename to robotpageobjects/tests/scenarios/test_dont_have_to_specify_page_name_for_keyword_when_2_page_objects_define_it.robot diff --git a/tests/scenarios/test_dont_have_to_specify_page_name_in_keyword_when_2_page_objects_inherit_it.robot b/robotpageobjects/tests/scenarios/test_dont_have_to_specify_page_name_in_keyword_when_2_page_objects_inherit_it.robot similarity index 100% rename from tests/scenarios/test_dont_have_to_specify_page_name_in_keyword_when_2_page_objects_inherit_it.robot rename to robotpageobjects/tests/scenarios/test_dont_have_to_specify_page_name_in_keyword_when_2_page_objects_inherit_it.robot diff --git a/tests/scenarios/test_dont_have_to_specify_page_name_when_extending_se2lib_keyword.robot b/robotpageobjects/tests/scenarios/test_dont_have_to_specify_page_name_when_extending_se2lib_keyword.robot similarity index 100% rename from tests/scenarios/test_dont_have_to_specify_page_name_when_extending_se2lib_keyword.robot rename to robotpageobjects/tests/scenarios/test_dont_have_to_specify_page_name_when_extending_se2lib_keyword.robot diff --git a/tests/scenarios/test_fail.py b/robotpageobjects/tests/scenarios/test_fail.py similarity index 100% rename from tests/scenarios/test_fail.py rename to robotpageobjects/tests/scenarios/test_fail.py diff --git a/tests/scenarios/test_fail.robot b/robotpageobjects/tests/scenarios/test_fail.robot similarity index 100% rename from tests/scenarios/test_fail.robot rename to robotpageobjects/tests/scenarios/test_fail.robot diff --git a/tests/scenarios/test_fail_se2lib_keyword.robot b/robotpageobjects/tests/scenarios/test_fail_se2lib_keyword.robot similarity index 100% rename from tests/scenarios/test_fail_se2lib_keyword.robot rename to robotpageobjects/tests/scenarios/test_fail_se2lib_keyword.robot diff --git a/tests/scenarios/test_find_elements_with_selector.py b/robotpageobjects/tests/scenarios/test_find_elements_with_selector.py similarity index 100% rename from tests/scenarios/test_find_elements_with_selector.py rename to robotpageobjects/tests/scenarios/test_find_elements_with_selector.py diff --git a/tests/scenarios/test_go_to.py b/robotpageobjects/tests/scenarios/test_go_to.py similarity index 100% rename from tests/scenarios/test_go_to.py rename to robotpageobjects/tests/scenarios/test_go_to.py diff --git a/tests/scenarios/test_go_to.robot b/robotpageobjects/tests/scenarios/test_go_to.robot similarity index 100% rename from tests/scenarios/test_go_to.robot rename to robotpageobjects/tests/scenarios/test_go_to.robot diff --git a/tests/scenarios/test_implicit_se_wait.py b/robotpageobjects/tests/scenarios/test_implicit_se_wait.py similarity index 100% rename from tests/scenarios/test_implicit_se_wait.py rename to robotpageobjects/tests/scenarios/test_implicit_se_wait.py diff --git a/tests/scenarios/test_implicit_se_wait_0.py b/robotpageobjects/tests/scenarios/test_implicit_se_wait_0.py similarity index 100% rename from tests/scenarios/test_implicit_se_wait_0.py rename to robotpageobjects/tests/scenarios/test_implicit_se_wait_0.py diff --git a/tests/scenarios/test_is_visible.py b/robotpageobjects/tests/scenarios/test_is_visible.py similarity index 100% rename from tests/scenarios/test_is_visible.py rename to robotpageobjects/tests/scenarios/test_is_visible.py diff --git a/tests/scenarios/test_location_should_be_for_absolute_path.py b/robotpageobjects/tests/scenarios/test_location_should_be_for_absolute_path.py similarity index 100% rename from tests/scenarios/test_location_should_be_for_absolute_path.py rename to robotpageobjects/tests/scenarios/test_location_should_be_for_absolute_path.py diff --git a/tests/scenarios/test_location_should_be_for_relative_path.py b/robotpageobjects/tests/scenarios/test_location_should_be_for_relative_path.py similarity index 100% rename from tests/scenarios/test_location_should_be_for_relative_path.py rename to robotpageobjects/tests/scenarios/test_location_should_be_for_relative_path.py diff --git a/tests/scenarios/test_log_above_threshold.robot b/robotpageobjects/tests/scenarios/test_log_above_threshold.robot similarity index 100% rename from tests/scenarios/test_log_above_threshold.robot rename to robotpageobjects/tests/scenarios/test_log_above_threshold.robot diff --git a/tests/scenarios/test_log_at_threshold.py b/robotpageobjects/tests/scenarios/test_log_at_threshold.py similarity index 100% rename from tests/scenarios/test_log_at_threshold.py rename to robotpageobjects/tests/scenarios/test_log_at_threshold.py diff --git a/tests/scenarios/test_log_at_threshold.robot b/robotpageobjects/tests/scenarios/test_log_at_threshold.robot similarity index 100% rename from tests/scenarios/test_log_at_threshold.robot rename to robotpageobjects/tests/scenarios/test_log_at_threshold.robot diff --git a/tests/scenarios/test_log_at_threshold_is_console_false.py b/robotpageobjects/tests/scenarios/test_log_at_threshold_is_console_false.py similarity index 100% rename from tests/scenarios/test_log_at_threshold_is_console_false.py rename to robotpageobjects/tests/scenarios/test_log_at_threshold_is_console_false.py diff --git a/tests/scenarios/test_log_below_threshold.py b/robotpageobjects/tests/scenarios/test_log_below_threshold.py similarity index 100% rename from tests/scenarios/test_log_below_threshold.py rename to robotpageobjects/tests/scenarios/test_log_below_threshold.py diff --git a/tests/scenarios/test_log_below_threshold.robot b/robotpageobjects/tests/scenarios/test_log_below_threshold.robot similarity index 100% rename from tests/scenarios/test_log_below_threshold.robot rename to robotpageobjects/tests/scenarios/test_log_below_threshold.robot diff --git a/tests/scenarios/test_log_below_threshold_is_console_false.py b/robotpageobjects/tests/scenarios/test_log_below_threshold_is_console_false.py similarity index 100% rename from tests/scenarios/test_log_below_threshold_is_console_false.py rename to robotpageobjects/tests/scenarios/test_log_below_threshold_is_console_false.py diff --git a/tests/scenarios/test_log_below_threshold_is_console_false.robot b/robotpageobjects/tests/scenarios/test_log_below_threshold_is_console_false.robot similarity index 100% rename from tests/scenarios/test_log_below_threshold_is_console_false.robot rename to robotpageobjects/tests/scenarios/test_log_below_threshold_is_console_false.robot diff --git a/tests/scenarios/test_manual_screen_shot.py b/robotpageobjects/tests/scenarios/test_manual_screen_shot.py similarity index 100% rename from tests/scenarios/test_manual_screen_shot.py rename to robotpageobjects/tests/scenarios/test_manual_screen_shot.py diff --git a/tests/scenarios/test_manual_screen_shot.robot b/robotpageobjects/tests/scenarios/test_manual_screen_shot.robot similarity index 100% rename from tests/scenarios/test_manual_screen_shot.robot rename to robotpageobjects/tests/scenarios/test_manual_screen_shot.robot diff --git a/tests/scenarios/test_negative_index_in_table_keywords.robot b/robotpageobjects/tests/scenarios/test_negative_index_in_table_keywords.robot similarity index 100% rename from tests/scenarios/test_negative_index_in_table_keywords.robot rename to robotpageobjects/tests/scenarios/test_negative_index_in_table_keywords.robot diff --git a/tests/scenarios/test_no_selector.py b/robotpageobjects/tests/scenarios/test_no_selector.py similarity index 100% rename from tests/scenarios/test_no_selector.py rename to robotpageobjects/tests/scenarios/test_no_selector.py diff --git a/tests/scenarios/test_no_uri.robot b/robotpageobjects/tests/scenarios/test_no_uri.robot similarity index 100% rename from tests/scenarios/test_no_uri.robot rename to robotpageobjects/tests/scenarios/test_no_uri.robot diff --git a/tests/scenarios/test_page_override_without_override_class.py b/robotpageobjects/tests/scenarios/test_page_override_without_override_class.py similarity index 100% rename from tests/scenarios/test_page_override_without_override_class.py rename to robotpageobjects/tests/scenarios/test_page_override_without_override_class.py diff --git a/tests/scenarios/test_page_with_component.robot b/robotpageobjects/tests/scenarios/test_page_with_component.robot similarity index 100% rename from tests/scenarios/test_page_with_component.robot rename to robotpageobjects/tests/scenarios/test_page_with_component.robot diff --git a/tests/scenarios/test_pass_explicit_wait_to_find_element.py b/robotpageobjects/tests/scenarios/test_pass_explicit_wait_to_find_element.py similarity index 100% rename from tests/scenarios/test_pass_explicit_wait_to_find_element.py rename to robotpageobjects/tests/scenarios/test_pass_explicit_wait_to_find_element.py diff --git a/tests/scenarios/test_rel_uri_attr.py b/robotpageobjects/tests/scenarios/test_rel_uri_attr.py similarity index 100% rename from tests/scenarios/test_rel_uri_attr.py rename to robotpageobjects/tests/scenarios/test_rel_uri_attr.py diff --git a/tests/scenarios/test_rel_uri_attr.robot b/robotpageobjects/tests/scenarios/test_rel_uri_attr.robot similarity index 100% rename from tests/scenarios/test_rel_uri_attr.robot rename to robotpageobjects/tests/scenarios/test_rel_uri_attr.robot diff --git a/tests/scenarios/test_rel_uri_attr_no_name_attr.robot b/robotpageobjects/tests/scenarios/test_rel_uri_attr_no_name_attr.robot similarity index 100% rename from tests/scenarios/test_rel_uri_attr_no_name_attr.robot rename to robotpageobjects/tests/scenarios/test_rel_uri_attr_no_name_attr.robot diff --git a/tests/scenarios/test_s2l_imported_multiple_a.robot b/robotpageobjects/tests/scenarios/test_s2l_imported_multiple_a.robot similarity index 100% rename from tests/scenarios/test_s2l_imported_multiple_a.robot rename to robotpageobjects/tests/scenarios/test_s2l_imported_multiple_a.robot diff --git a/tests/scenarios/test_s2l_imported_multiple_b.robot b/robotpageobjects/tests/scenarios/test_s2l_imported_multiple_b.robot similarity index 100% rename from tests/scenarios/test_s2l_imported_multiple_b.robot rename to robotpageobjects/tests/scenarios/test_s2l_imported_multiple_b.robot diff --git a/tests/scenarios/test_s2l_keyword_with_selector.robot b/robotpageobjects/tests/scenarios/test_s2l_keyword_with_selector.robot similarity index 100% rename from tests/scenarios/test_s2l_keyword_with_selector.robot rename to robotpageobjects/tests/scenarios/test_s2l_keyword_with_selector.robot diff --git a/tests/scenarios/test_sauce.py b/robotpageobjects/tests/scenarios/test_sauce.py similarity index 100% rename from tests/scenarios/test_sauce.py rename to robotpageobjects/tests/scenarios/test_sauce.py diff --git a/tests/scenarios/test_sauce.robot b/robotpageobjects/tests/scenarios/test_sauce.robot similarity index 100% rename from tests/scenarios/test_sauce.robot rename to robotpageobjects/tests/scenarios/test_sauce.robot diff --git a/tests/scenarios/test_se2lib_called_before_po.robot b/robotpageobjects/tests/scenarios/test_se2lib_called_before_po.robot similarity index 100% rename from tests/scenarios/test_se2lib_called_before_po.robot rename to robotpageobjects/tests/scenarios/test_se2lib_called_before_po.robot diff --git a/tests/scenarios/test_se2lib_imported_before_po.robot b/robotpageobjects/tests/scenarios/test_se2lib_imported_before_po.robot similarity index 100% rename from tests/scenarios/test_se2lib_imported_before_po.robot rename to robotpageobjects/tests/scenarios/test_se2lib_imported_before_po.robot diff --git a/tests/scenarios/test_selector_self_ref.py b/robotpageobjects/tests/scenarios/test_selector_self_ref.py similarity index 100% rename from tests/scenarios/test_selector_self_ref.py rename to robotpageobjects/tests/scenarios/test_selector_self_ref.py diff --git a/tests/scenarios/test_selector_with_se2lib_keyword.robot b/robotpageobjects/tests/scenarios/test_selector_with_se2lib_keyword.robot similarity index 100% rename from tests/scenarios/test_selector_with_se2lib_keyword.robot rename to robotpageobjects/tests/scenarios/test_selector_with_se2lib_keyword.robot diff --git a/tests/scenarios/test_stack_trace.robot b/robotpageobjects/tests/scenarios/test_stack_trace.robot similarity index 100% rename from tests/scenarios/test_stack_trace.robot rename to robotpageobjects/tests/scenarios/test_stack_trace.robot diff --git a/tests/scenarios/test_template_passed.py b/robotpageobjects/tests/scenarios/test_template_passed.py similarity index 100% rename from tests/scenarios/test_template_passed.py rename to robotpageobjects/tests/scenarios/test_template_passed.py diff --git a/tests/scenarios/test_template_passed.robot b/robotpageobjects/tests/scenarios/test_template_passed.robot similarity index 100% rename from tests/scenarios/test_template_passed.robot rename to robotpageobjects/tests/scenarios/test_template_passed.robot diff --git a/tests/scenarios/test_templated_selector.py b/robotpageobjects/tests/scenarios/test_templated_selector.py similarity index 100% rename from tests/scenarios/test_templated_selector.py rename to robotpageobjects/tests/scenarios/test_templated_selector.py diff --git a/tests/scenarios/test_templated_selector_wrong_num.py b/robotpageobjects/tests/scenarios/test_templated_selector_wrong_num.py similarity index 100% rename from tests/scenarios/test_templated_selector_wrong_num.py rename to robotpageobjects/tests/scenarios/test_templated_selector_wrong_num.py diff --git a/tests/scenarios/test_threshold_at_warning_log_warning_logs_warning_to_file_and_stdout_python.py b/robotpageobjects/tests/scenarios/test_threshold_at_warning_log_warning_logs_warning_to_file_and_stdout_python.py similarity index 100% rename from tests/scenarios/test_threshold_at_warning_log_warning_logs_warning_to_file_and_stdout_python.py rename to robotpageobjects/tests/scenarios/test_threshold_at_warning_log_warning_logs_warning_to_file_and_stdout_python.py diff --git a/tests/scenarios/test_wait_until_not_visible.py b/robotpageobjects/tests/scenarios/test_wait_until_not_visible.py similarity index 100% rename from tests/scenarios/test_wait_until_not_visible.py rename to robotpageobjects/tests/scenarios/test_wait_until_not_visible.py diff --git a/tests/test_functional.py b/robotpageobjects/tests/test_functional.py similarity index 100% rename from tests/test_functional.py rename to robotpageobjects/tests/test_functional.py diff --git a/tests/test_unit.py b/robotpageobjects/tests/test_unit.py similarity index 100% rename from tests/test_unit.py rename to robotpageobjects/tests/test_unit.py diff --git a/tests/vars.py b/robotpageobjects/tests/vars.py similarity index 100% rename from tests/vars.py rename to robotpageobjects/tests/vars.py From 6fd503e4f60878b5f1c2203aff50e616f16afe77 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Fri, 10 Jun 2016 15:56:12 +0200 Subject: [PATCH 05/28] Use Python 3 compatible Exception as. --- robotpageobjects/monkeypatches.py | 42 +++++++++---------- robotpageobjects/page.py | 2 +- robotpageobjects/tests/basetestcase.py | 2 +- .../scenarios/test_wait_until_not_visible.py | 4 +- robotpageobjects/tests/test_unit.py | 14 +++---- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/robotpageobjects/monkeypatches.py b/robotpageobjects/monkeypatches.py index d387b29..0b964f8 100755 --- a/robotpageobjects/monkeypatches.py +++ b/robotpageobjects/monkeypatches.py @@ -17,7 +17,7 @@ def _make_phantomjs(self , remote , desired_capabilities , profile_dir): try: browser = self._generic_make_browser(webdriver.PhantomJS, webdriver.DesiredCapabilities.PHANTOMJS, remote, desired_capabilities) - except WebDriverException, e: + except WebDriverException as e: print "Couldn't connect to webdriver. WebDriverException was: " + str(e) browser = None tries += 1 @@ -29,17 +29,17 @@ def _make_phantomjs(self , remote , desired_capabilities , profile_dir): Selenium2Library._make_phantomjs = _make_phantomjs ### BEGIN QAR-48165 monkey patch - ### This adds consistent support for negative indexes in Robot keywords. - + ### This adds consistent support for negative indexes in Robot keywords. + __old_tef_init = TableElementFinder.__init__.__func__ def __new_tef_init(self, *args, **kwargs): """ - The _locator_suffixes data attribute is used at the end of built-in + The _locator_suffixes data attribute is used at the end of built-in locator strings used by Selenium2Library. - - Monkey patch: added support for negative indexes (QAR-48165). The + + Monkey patch: added support for negative indexes (QAR-48165). The additional locator suffixes are used by the monkey-patched methods - 'find_by_row' and 'find_by_col' defined below. + 'find_by_row' and 'find_by_col' defined below. """ __old_tef_init(self, *args, **kwargs) self._locator_suffixes[('css', 'last-row')] = [' tr:nth-last-child(%s)'] @@ -51,12 +51,12 @@ def __new_tef_init(self, *args, **kwargs): TableElementFinder.__init__ = __new_tef_init def find_by_row(self, browser, table_locator, row, content): - """ + """ Selenium2Library locator method used by _TableElementKeywords.table_row_should_contain This in turn is used by the built-in Robot keyword 'Table Row Should Contain'. - + Monkey patch: added support for negative indexes (QAR-48165). - """ + """ location_method = "row" if "-" == row[0]: row = row[1:] @@ -68,11 +68,11 @@ def find_by_row(self, browser, table_locator, row, content): TableElementFinder.find_by_row = find_by_row def find_by_col(self, browser, table_locator, col, content): - """ + """ Selenium2Library locator method used by _TableElementKeywords.table_row_should_contain - + Monkey patch: added support for negative indexes (QAR-48165). - """ + """ location_method = "col" if "-" == col[0]: col = col[1:] @@ -80,7 +80,7 @@ def find_by_col(self, browser, table_locator, col, content): locators = self._parse_table_locator(table_locator, location_method) locators = [locator % str(col) for locator in locators] return self._search_in_locators(browser, locators, content) - + TableElementFinder.find_by_col = find_by_col def get_table_cell(self, table_locator, row, column, loglevel='INFO'): @@ -88,12 +88,12 @@ def get_table_cell(self, table_locator, row, column, loglevel='INFO'): Row and column number start from 1. Header and footer rows are included in the count. A negative row or column number can be used - to get rows counting from the end (end: -1) This means that also - cell content from header or footer rows can be obtained with this + to get rows counting from the end (end: -1) This means that also + cell content from header or footer rows can be obtained with this keyword. To understand how tables are identified, please take a look at the `introduction`. - - Monkey patch: added support for negative indexes (QAR-48165). + + Monkey patch: added support for negative indexes (QAR-48165). get_table_cell is used by the built-in keyword 'Table Cell Should Contain'. """ row = int(row) @@ -105,13 +105,13 @@ def get_table_cell(self, table_locator, row, column, loglevel='INFO'): table = self._table_element_finder.find(self._current_browser(), table_locator) if table is not None: rows = table.find_elements_by_xpath("./thead/tr") - if row_index >= len(rows) or row_index < 0: + if row_index >= len(rows) or row_index < 0: rows.extend(table.find_elements_by_xpath("./tbody/tr")) - if row_index >= len(rows) or row_index < 0: + if row_index >= len(rows) or row_index < 0: rows.extend(table.find_elements_by_xpath("./tfoot/tr")) if row_index < len(rows): columns = rows[row_index].find_elements_by_tag_name('th') - if column_index >= len(columns) or column_index < 0: + if column_index >= len(columns) or column_index < 0: columns.extend(rows[row_index].find_elements_by_tag_name('td')) if column_index < len(columns): return columns[column_index].text diff --git a/robotpageobjects/page.py b/robotpageobjects/page.py index fb0e51b..ed7ee3f 100755 --- a/robotpageobjects/page.py +++ b/robotpageobjects/page.py @@ -241,7 +241,7 @@ def get_keyword_names(self): def _attempt_screenshot(self): try: self.capture_page_screenshot() - except Exception, e: + except Exception as e: if e.message.find("No browser is open") != -1: pass diff --git a/robotpageobjects/tests/basetestcase.py b/robotpageobjects/tests/basetestcase.py index 18746e8..62ab8ec 100755 --- a/robotpageobjects/tests/basetestcase.py +++ b/robotpageobjects/tests/basetestcase.py @@ -287,7 +287,7 @@ def write_var_file(self, *args, **kwargs): for i in kwargs: line = "%s = '%s'\n" % (i, kwargs[i]) f.write(line) - except Exception, e: + except Exception as e: raise Exception("Problem creating vars file: %s" % e) finally: if f: diff --git a/robotpageobjects/tests/scenarios/test_wait_until_not_visible.py b/robotpageobjects/tests/scenarios/test_wait_until_not_visible.py index 1fd0f4c..6d7f447 100755 --- a/robotpageobjects/tests/scenarios/test_wait_until_not_visible.py +++ b/robotpageobjects/tests/scenarios/test_wait_until_not_visible.py @@ -21,7 +21,7 @@ def test_wait_until_element_not_visible_throws_exception(self): try: self.p.click_element("delayed-content-button") self.p.wait_until_element_is_not_visible("para-to-be-hidden", 8) - except Exception, e: + except Exception as e: self.assertTrue(isinstance(e, AssertionError)) self.assertIn("still matched after", e.message) @@ -29,7 +29,7 @@ def test_wait_for_element_not_visible_throws_exception(self): try: self.p.click_element("delayed-content-button") self.p.wait_for(lambda: not self.p.is_visible("para-to-be-hidden"), 8, 'Element did not disappear') - except Exception, e: + except Exception as e: self.assertIn("Element did not disappear", e.msg) def tearDown(self): diff --git a/robotpageobjects/tests/test_unit.py b/robotpageobjects/tests/test_unit.py index 1b6d524..f518af5 100755 --- a/robotpageobjects/tests/test_unit.py +++ b/robotpageobjects/tests/test_unit.py @@ -91,7 +91,7 @@ def test_robot_can_get_vars_from_env(self, mock_get_variables): try: handler = OptionHandler(MockPage()) self.assertEquals(handler.get("browser"), "opera") - except Exception, e: + except Exception as e: raise e finally: del os.environ["PO_BROWSER"] @@ -103,7 +103,7 @@ def test_robot_env_overrides_var_file(self, mock_get_variables): try: handler = OptionHandler(MockPage()) self.assertEquals(handler.get("author"), "Twain") - except Exception, e: + except Exception as e: raise e finally: del os.environ["PO_AUTHOR"] @@ -116,7 +116,7 @@ def test_robot_cmd_line_var_overrides_env_var(self, mock_get_variables): try: handler = OptionHandler(MockPage()) self.assertEquals(handler.get("browser"), "chrome") - except Exception, e: + except Exception as e: raise e finally: del os.environ["PO_BROWSER"] @@ -128,11 +128,11 @@ def test_robot_cmd_line_var_overrides_var_file(self, mock_get_variables): try: handler = OptionHandler(MockPage()) self.assertEquals(handler.get("author"), "Twain") - except Exception, e: + except Exception as e: raise e finally: del os.environ["PO_VAR_FILE"] - + def test_get_options_from_page_object(self): p = MockPage() p.options = {'author': 'Twain'} @@ -609,7 +609,7 @@ class P(Page):pass self.assertTrue(isinstance(service_args, list), "Service args is a list") self.assertEquals(len(service_args), 1, "Service args property has 1 member") self.assertEquals( - service_args[0], - "--cookies-file=foo.txt", + service_args[0], + "--cookies-file=foo.txt", "Service args is what we set it to be" ) From 9015ce1e52ed46aeb7d99e0f3ebf3dce14a6edd7 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Thu, 23 Jun 2016 10:42:33 +0200 Subject: [PATCH 06/28] Install py3 compatible version of selenium2library for py3. --- .travis.yml | 8 +++++--- requirements.txt | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index afc0a68..01ba5d5 100755 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ -env: - global: +env: + global: secure: aStjr7/mZJDdPqJ210HPRZygxXA36SzXyBraK9x6eqaDR+yqZpGJBIYMlRzqV1Fwlh1BUFbOYNczmLEQs+Sf3uPxyEWhFc5L0qKlvUE98fsf6IJuFJdwfwBG1/vrJTNm0JviBI/6lPlB2/EYtJJBWmYQGsrXXoP5Cc38T+z/a0s= language: python python: @@ -9,13 +9,15 @@ matrix: allow_failures: - python: 3.5 install: + # for Python 3 we need robotframework-selenium2library 1.8.x + - if [ $TRAVIS_PYTHON_VERSION == 3.5 ]; then pip install -U https://github.com/HelioGuilherme66/robotframework-selenium2library/archive/v1.8.0b3.tar.gz; fi - pip install . script: - nosetests -vs --with-xunit robotpageobjects/tests/test_unit.py robotpageobjects/tests/test_functional.py deploy: provider: pypi user: hellmanj - password: + password: secure: D5T3Wo8DGHxxU5+7kE+y6uVVrxoOhLfiCZl9q3BEE9OrbnGmzFngRfP1o37ulk78v7PQGNqtn+95nWOWthJcp4897eB6YhKsa1Q8+HSlNynsf/7WW2cgTEgSWppZNaMoUF+my1NW2baKbmcgwRt3Hsxz9HkOvoFfQAR0ZovUy1U= on: tags: true diff --git a/requirements.txt b/requirements.txt index fb94389..65bd205 100755 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ decorator mock==1.0.1 requests==2.1.0 -robotframework-selenium2library==1.7.2 +robotframework-selenium2library uritemplate==0.6 From ffbf3748766c0e71d31dd53e37bd0f44d7fda1ee Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Thu, 23 Jun 2016 10:48:47 +0200 Subject: [PATCH 07/28] Fix imports and exceptions for Python 3. --- robotpageobjects/__init__.py | 7 +++---- robotpageobjects/abstractedlogger.py | 4 ++-- robotpageobjects/base.py | 12 ++++++------ robotpageobjects/component.py | 2 +- robotpageobjects/context.py | 6 +++--- robotpageobjects/monkeypatches.py | 2 +- robotpageobjects/optionhandler.py | 6 +++--- robotpageobjects/page.py | 8 ++++---- 8 files changed, 23 insertions(+), 24 deletions(-) diff --git a/robotpageobjects/__init__.py b/robotpageobjects/__init__.py index 589b28c..b4c5c8c 100755 --- a/robotpageobjects/__init__.py +++ b/robotpageobjects/__init__.py @@ -1,4 +1,3 @@ -from .base import Override, robot_alias, not_keyword -from .page import Page -from .component import Component - +from robotpageobjects.base import Override, robot_alias, not_keyword +from robotpageobjects.page import Page +from robotpageobjects.component import Component diff --git a/robotpageobjects/abstractedlogger.py b/robotpageobjects/abstractedlogger.py index 0cac87a..d057537 100755 --- a/robotpageobjects/abstractedlogger.py +++ b/robotpageobjects/abstractedlogger.py @@ -3,8 +3,8 @@ import robot.api.logger import robot.output.pyloggingconf as robot_logging_conf -from optionhandler import OptionHandler -from context import Context +from robotpageobjects.optionhandler import OptionHandler +from robotpageobjects.context import Context class Logger(object): diff --git a/robotpageobjects/base.py b/robotpageobjects/base.py index ba4b11b..3351082 100755 --- a/robotpageobjects/base.py +++ b/robotpageobjects/base.py @@ -11,10 +11,10 @@ from Selenium2Library import Selenium2Library from Selenium2Library.keywords.keywordgroup import KeywordGroupMetaClass -from . import abstractedlogger -from . import exceptions -from .context import Context -from .optionhandler import OptionHandler +from robotpageobjects.abstractedlogger import Logger +from robotpageobjects import exceptions +from robotpageobjects.context import Context +from robotpageobjects.optionhandler import OptionHandler class _Keywords(object): @@ -537,7 +537,7 @@ class _BaseActions(_S2LWrapper): Helper class that defines actions for PageObjectLibrary. """ - _abstracted_logger = abstractedlogger.Logger() + _abstracted_logger = Logger() def __init__(self, *args, **kwargs): """ @@ -718,7 +718,7 @@ def _element_find(self, locator, *args, **kwargs): self.driver.implicitly_wait(our_wait) - + if locator in self.selectors: locator = self.resolve_selector(locator) diff --git a/robotpageobjects/component.py b/robotpageobjects/component.py index b599ea0..e12ee74 100755 --- a/robotpageobjects/component.py +++ b/robotpageobjects/component.py @@ -1,4 +1,4 @@ -from .base import _BaseActions, _SelectorsManager, _ComponentsManager, not_keyword +from robotpageobjects.base import _BaseActions, _SelectorsManager, _ComponentsManager, not_keyword from Selenium2Library.locators.elementfinder import ElementFinder diff --git a/robotpageobjects/context.py b/robotpageobjects/context.py index ef20c1a..db81b35 100755 --- a/robotpageobjects/context.py +++ b/robotpageobjects/context.py @@ -1,6 +1,6 @@ from robot.libraries.BuiltIn import BuiltIn from robot.running.context import EXECUTION_CONTEXTS -from monkeypatches import do_monkeypatches +from robotpageobjects.monkeypatches import do_monkeypatches do_monkeypatches() @@ -39,11 +39,11 @@ def in_robot(): @classmethod def set_keywords_exposed(cls): cls._keywords_exposed = True - + @classmethod def set_cache(cls, cache): cls._cache = cache - + @classmethod def get_cache(cls): return cls._cache diff --git a/robotpageobjects/monkeypatches.py b/robotpageobjects/monkeypatches.py index 0b964f8..07f234e 100755 --- a/robotpageobjects/monkeypatches.py +++ b/robotpageobjects/monkeypatches.py @@ -18,7 +18,7 @@ def _make_phantomjs(self , remote , desired_capabilities , profile_dir): browser = self._generic_make_browser(webdriver.PhantomJS, webdriver.DesiredCapabilities.PHANTOMJS, remote, desired_capabilities) except WebDriverException as e: - print "Couldn't connect to webdriver. WebDriverException was: " + str(e) + print("Couldn't connect to webdriver. WebDriverException was: " + str(e)) browser = None tries += 1 if browser: diff --git a/robotpageobjects/optionhandler.py b/robotpageobjects/optionhandler.py index a56b0fb..cc91c0d 100755 --- a/robotpageobjects/optionhandler.py +++ b/robotpageobjects/optionhandler.py @@ -2,8 +2,8 @@ import os import imp -from context import Context -import exceptions +from robotpageobjects.context import Context +from robotpageobjects import exceptions from robot.libraries.BuiltIn import BuiltIn @@ -61,7 +61,7 @@ def _get_opts_from_var_file(self): try: vars_mod = imp.load_source("vars", abs_var_file_path) - except (ImportError, IOError), e: + except (ImportError, IOError) as e: raise exceptions.VarFileImportErrorError( "Couldn't import variable file: %s. Ensure it exists and is importable." % var_file_path) diff --git a/robotpageobjects/page.py b/robotpageobjects/page.py index ed7ee3f..e0058a3 100755 --- a/robotpageobjects/page.py +++ b/robotpageobjects/page.py @@ -29,10 +29,10 @@ from selenium.common.exceptions import WebDriverException import uritemplate -from .base import _ComponentsManagerMeta, not_keyword, robot_alias, _BaseActions, _Keywords, Override, _SelectorsManager, _ComponentsManager -from . import exceptions -from .context import Context -from .sig import get_method_sig +from robotpageobjects.base import _ComponentsManagerMeta, not_keyword, robot_alias, _BaseActions, _Keywords, Override, _SelectorsManager, _ComponentsManager +from robotpageobjects import exceptions +from robotpageobjects.context import Context +from robotpageobjects.sig import get_method_sig # determine if libdoc is running to avoid generating docs for automatically generated aliases From ab513be9e95c563c8032d73f85b0ada95aa3c360 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Thu, 23 Jun 2016 10:53:26 +0200 Subject: [PATCH 08/28] Attempt to fix monkey patch of __old_tef_init for py3. --- robotpageobjects/monkeypatches.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/robotpageobjects/monkeypatches.py b/robotpageobjects/monkeypatches.py index 07f234e..c90220a 100755 --- a/robotpageobjects/monkeypatches.py +++ b/robotpageobjects/monkeypatches.py @@ -31,7 +31,7 @@ def _make_phantomjs(self , remote , desired_capabilities , profile_dir): ### BEGIN QAR-48165 monkey patch ### This adds consistent support for negative indexes in Robot keywords. - __old_tef_init = TableElementFinder.__init__.__func__ + __old_tef_init = TableElementFinder.__init__ def __new_tef_init(self, *args, **kwargs): """ The _locator_suffixes data attribute is used at the end of built-in From 2f926b6afff29d91ef80e8bb64cef2853d6502ba Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Thu, 23 Jun 2016 11:17:57 +0200 Subject: [PATCH 09/28] Fix str check; urllib2 import and exceptions for Python 3. --- robotpageobjects/base.py | 1 + robotpageobjects/optionhandler.py | 5 +++-- robotpageobjects/page.py | 11 ++++++++--- robotpageobjects/tests/scenarios/test_bad_selector.py | 4 ++-- robotpageobjects/tests/scenarios/test_no_selector.py | 4 ++-- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/robotpageobjects/base.py b/robotpageobjects/base.py index 3351082..1ed3903 100755 --- a/robotpageobjects/base.py +++ b/robotpageobjects/base.py @@ -2,6 +2,7 @@ import re import importlib import inspect +import six import warnings from robot.utils import asserts diff --git a/robotpageobjects/optionhandler.py b/robotpageobjects/optionhandler.py index cc91c0d..bc9f6eb 100755 --- a/robotpageobjects/optionhandler.py +++ b/robotpageobjects/optionhandler.py @@ -24,7 +24,8 @@ def __new__(cls, *args, **kwargs): # Singleton pattern... if cls._instance is None: - cls._instance = super(OptionHandler, cls).__new__(cls, *args, **kwargs) + # PY27ONLY: cls._instance = super(OptionHandler, cls).__new__(cls, *args, **kwargs) + cls._instance = super().__new__(cls) cls._new_called += 1 return cls._instance @@ -85,7 +86,7 @@ def _normalize(self, opts): Convert an option keyname to lower-cased robot format, or convert all the keys in a dictionary to robot format. """ - if isinstance(opts, basestring): + if isinstance(opts, str): name = opts.lower() rmatch = re.search("\$\{(.+)\}", name) return rmatch.group(1) if rmatch else name diff --git a/robotpageobjects/page.py b/robotpageobjects/page.py index e0058a3..62b3bad 100755 --- a/robotpageobjects/page.py +++ b/robotpageobjects/page.py @@ -21,7 +21,7 @@ from __future__ import print_function import inspect import re -import urllib2 +import six import decorator from Selenium2Library import Selenium2Library @@ -34,6 +34,11 @@ from robotpageobjects.context import Context from robotpageobjects.sig import get_method_sig +try: + import urllib.request as urllib2 +except ImportError: + import urllib2 + # determine if libdoc is running to avoid generating docs for automatically generated aliases ld = 'libdoc' @@ -435,7 +440,7 @@ def _resolve_url(self, *args): first_arg = args[0] if not self._is_robot: - if isinstance(first_arg, basestring): + if isinstance(first_arg, str): # In Python, if the first argument is a string and not a dict, it's a url or path. arg_type = "url" else: @@ -574,7 +579,7 @@ class MyPageObject(PageObject): try: self.open_browser(resolved_url, self.browser, remote_url=remote_url, desired_capabilities=caps) - except (urllib2.HTTPError, WebDriverException, ValueError), e: + except (urllib2.HTTPError, WebDriverException, ValueError) as e: raise exceptions.SauceConnectionError("Unable to run Sauce job.\n%s\n" "Sauce variables were:\n" "sauce_platform: %s\n" diff --git a/robotpageobjects/tests/scenarios/test_bad_selector.py b/robotpageobjects/tests/scenarios/test_bad_selector.py index dd5948e..d644ad4 100755 --- a/robotpageobjects/tests/scenarios/test_bad_selector.py +++ b/robotpageobjects/tests/scenarios/test_bad_selector.py @@ -11,7 +11,7 @@ def test_bad_selector(self): found = False try: self.page.find_element("foobar") - except exceptions.SelectorError, e: + except exceptions.SelectorError as e: msg_found = e.message.find("not a valid locator") != -1 self.assertTrue(msg_found, "ValueError should detect that the locator looks like a selector.") @@ -20,4 +20,4 @@ def tearDown(self): self.page.close() if __name__ == "__main__": - unittest.main() \ No newline at end of file + unittest.main() diff --git a/robotpageobjects/tests/scenarios/test_no_selector.py b/robotpageobjects/tests/scenarios/test_no_selector.py index 3db1ca7..90e2501 100755 --- a/robotpageobjects/tests/scenarios/test_no_selector.py +++ b/robotpageobjects/tests/scenarios/test_no_selector.py @@ -10,7 +10,7 @@ def test_no_selector(self): msg_found = False try: self.page.find_element("xpath=asdf") - except ValueError, e: + except ValueError as e: msg_found = e.message.find("did not match any elements") != -1 self.assertTrue(msg_found, "ValueError should detect that the locator looks like a locator.") @@ -18,4 +18,4 @@ def tearDown(self): self.page.close() if __name__ == "__main__": - unittest.main() \ No newline at end of file + unittest.main() From fdaf2c36ee3b91d41d1866cb851199cefe03e4f2 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Thu, 23 Jun 2016 11:20:38 +0200 Subject: [PATCH 10/28] Add six to requirements.txt. --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 65bd205..a5dfc43 100755 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,5 @@ decorator mock==1.0.1 requests==2.1.0 robotframework-selenium2library +six uritemplate==0.6 From 4b59b4cb6f5e4b9e17d73d7277ac5b41d423f9fd Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Thu, 23 Jun 2016 11:24:24 +0200 Subject: [PATCH 11/28] Fix super call for python2. --- robotpageobjects/optionhandler.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/robotpageobjects/optionhandler.py b/robotpageobjects/optionhandler.py index bc9f6eb..0627edd 100755 --- a/robotpageobjects/optionhandler.py +++ b/robotpageobjects/optionhandler.py @@ -1,6 +1,7 @@ import re import os import imp +import six from robotpageobjects.context import Context from robotpageobjects import exceptions @@ -24,8 +25,10 @@ def __new__(cls, *args, **kwargs): # Singleton pattern... if cls._instance is None: - # PY27ONLY: cls._instance = super(OptionHandler, cls).__new__(cls, *args, **kwargs) - cls._instance = super().__new__(cls) + if six.PY2: + cls._instance = super(OptionHandler, cls).__new__(cls, *args, **kwargs) # noqa + else: + cls._instance = super().__new__(cls) cls._new_called += 1 return cls._instance From bc6916eaf5b4353924846a3c2afcbb7ab07acf2d Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Thu, 23 Jun 2016 11:29:04 +0200 Subject: [PATCH 12/28] Revert "Fix super call for python2." This reverts commit 4b59b4cb6f5e4b9e17d73d7277ac5b41d423f9fd. --- robotpageobjects/optionhandler.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/robotpageobjects/optionhandler.py b/robotpageobjects/optionhandler.py index 0627edd..bc9f6eb 100755 --- a/robotpageobjects/optionhandler.py +++ b/robotpageobjects/optionhandler.py @@ -1,7 +1,6 @@ import re import os import imp -import six from robotpageobjects.context import Context from robotpageobjects import exceptions @@ -25,10 +24,8 @@ def __new__(cls, *args, **kwargs): # Singleton pattern... if cls._instance is None: - if six.PY2: - cls._instance = super(OptionHandler, cls).__new__(cls, *args, **kwargs) # noqa - else: - cls._instance = super().__new__(cls) + # PY27ONLY: cls._instance = super(OptionHandler, cls).__new__(cls, *args, **kwargs) + cls._instance = super().__new__(cls) cls._new_called += 1 return cls._instance From e89f8a207c8d2de1cf8722dcd2eba14a03c49fdc Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Thu, 23 Jun 2016 11:29:14 +0200 Subject: [PATCH 13/28] Revert "Add six to requirements.txt." This reverts commit fdaf2c36ee3b91d41d1866cb851199cefe03e4f2. --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a5dfc43..65bd205 100755 --- a/requirements.txt +++ b/requirements.txt @@ -2,5 +2,4 @@ decorator mock==1.0.1 requests==2.1.0 robotframework-selenium2library -six uritemplate==0.6 From 466f7d335fd8a592774ca6c0f90b50dbb04a75c4 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Thu, 23 Jun 2016 11:29:25 +0200 Subject: [PATCH 14/28] Revert "Fix str check; urllib2 import and exceptions for Python 3." This reverts commit 2f926b6afff29d91ef80e8bb64cef2853d6502ba. --- robotpageobjects/base.py | 1 - robotpageobjects/optionhandler.py | 5 ++--- robotpageobjects/page.py | 11 +++-------- robotpageobjects/tests/scenarios/test_bad_selector.py | 4 ++-- robotpageobjects/tests/scenarios/test_no_selector.py | 4 ++-- 5 files changed, 9 insertions(+), 16 deletions(-) diff --git a/robotpageobjects/base.py b/robotpageobjects/base.py index 1ed3903..3351082 100755 --- a/robotpageobjects/base.py +++ b/robotpageobjects/base.py @@ -2,7 +2,6 @@ import re import importlib import inspect -import six import warnings from robot.utils import asserts diff --git a/robotpageobjects/optionhandler.py b/robotpageobjects/optionhandler.py index bc9f6eb..cc91c0d 100755 --- a/robotpageobjects/optionhandler.py +++ b/robotpageobjects/optionhandler.py @@ -24,8 +24,7 @@ def __new__(cls, *args, **kwargs): # Singleton pattern... if cls._instance is None: - # PY27ONLY: cls._instance = super(OptionHandler, cls).__new__(cls, *args, **kwargs) - cls._instance = super().__new__(cls) + cls._instance = super(OptionHandler, cls).__new__(cls, *args, **kwargs) cls._new_called += 1 return cls._instance @@ -86,7 +85,7 @@ def _normalize(self, opts): Convert an option keyname to lower-cased robot format, or convert all the keys in a dictionary to robot format. """ - if isinstance(opts, str): + if isinstance(opts, basestring): name = opts.lower() rmatch = re.search("\$\{(.+)\}", name) return rmatch.group(1) if rmatch else name diff --git a/robotpageobjects/page.py b/robotpageobjects/page.py index 62b3bad..e0058a3 100755 --- a/robotpageobjects/page.py +++ b/robotpageobjects/page.py @@ -21,7 +21,7 @@ from __future__ import print_function import inspect import re -import six +import urllib2 import decorator from Selenium2Library import Selenium2Library @@ -34,11 +34,6 @@ from robotpageobjects.context import Context from robotpageobjects.sig import get_method_sig -try: - import urllib.request as urllib2 -except ImportError: - import urllib2 - # determine if libdoc is running to avoid generating docs for automatically generated aliases ld = 'libdoc' @@ -440,7 +435,7 @@ def _resolve_url(self, *args): first_arg = args[0] if not self._is_robot: - if isinstance(first_arg, str): + if isinstance(first_arg, basestring): # In Python, if the first argument is a string and not a dict, it's a url or path. arg_type = "url" else: @@ -579,7 +574,7 @@ class MyPageObject(PageObject): try: self.open_browser(resolved_url, self.browser, remote_url=remote_url, desired_capabilities=caps) - except (urllib2.HTTPError, WebDriverException, ValueError) as e: + except (urllib2.HTTPError, WebDriverException, ValueError), e: raise exceptions.SauceConnectionError("Unable to run Sauce job.\n%s\n" "Sauce variables were:\n" "sauce_platform: %s\n" diff --git a/robotpageobjects/tests/scenarios/test_bad_selector.py b/robotpageobjects/tests/scenarios/test_bad_selector.py index d644ad4..dd5948e 100755 --- a/robotpageobjects/tests/scenarios/test_bad_selector.py +++ b/robotpageobjects/tests/scenarios/test_bad_selector.py @@ -11,7 +11,7 @@ def test_bad_selector(self): found = False try: self.page.find_element("foobar") - except exceptions.SelectorError as e: + except exceptions.SelectorError, e: msg_found = e.message.find("not a valid locator") != -1 self.assertTrue(msg_found, "ValueError should detect that the locator looks like a selector.") @@ -20,4 +20,4 @@ def tearDown(self): self.page.close() if __name__ == "__main__": - unittest.main() + unittest.main() \ No newline at end of file diff --git a/robotpageobjects/tests/scenarios/test_no_selector.py b/robotpageobjects/tests/scenarios/test_no_selector.py index 90e2501..3db1ca7 100755 --- a/robotpageobjects/tests/scenarios/test_no_selector.py +++ b/robotpageobjects/tests/scenarios/test_no_selector.py @@ -10,7 +10,7 @@ def test_no_selector(self): msg_found = False try: self.page.find_element("xpath=asdf") - except ValueError as e: + except ValueError, e: msg_found = e.message.find("did not match any elements") != -1 self.assertTrue(msg_found, "ValueError should detect that the locator looks like a locator.") @@ -18,4 +18,4 @@ def tearDown(self): self.page.close() if __name__ == "__main__": - unittest.main() + unittest.main() \ No newline at end of file From e6fbde3de83a25d2939156592bd92f3b426fd6a8 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Thu, 23 Jun 2016 11:55:01 +0200 Subject: [PATCH 15/28] Add six to requirements.txt. --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 65bd205..a5dfc43 100755 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,5 @@ decorator mock==1.0.1 requests==2.1.0 robotframework-selenium2library +six uritemplate==0.6 From b222227339c95cb27c54a6bfc8ae5e1b2ca86332 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Thu, 23 Jun 2016 11:56:58 +0200 Subject: [PATCH 16/28] Use six.string_types for py2/3 compatibility. --- robotpageobjects/optionhandler.py | 3 ++- robotpageobjects/page.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/robotpageobjects/optionhandler.py b/robotpageobjects/optionhandler.py index cc91c0d..6b47f36 100755 --- a/robotpageobjects/optionhandler.py +++ b/robotpageobjects/optionhandler.py @@ -1,6 +1,7 @@ import re import os import imp +import six from robotpageobjects.context import Context from robotpageobjects import exceptions @@ -85,7 +86,7 @@ def _normalize(self, opts): Convert an option keyname to lower-cased robot format, or convert all the keys in a dictionary to robot format. """ - if isinstance(opts, basestring): + if isinstance(opts, six.string_types): name = opts.lower() rmatch = re.search("\$\{(.+)\}", name) return rmatch.group(1) if rmatch else name diff --git a/robotpageobjects/page.py b/robotpageobjects/page.py index e0058a3..3a4f4de 100755 --- a/robotpageobjects/page.py +++ b/robotpageobjects/page.py @@ -22,6 +22,7 @@ import inspect import re import urllib2 +import six import decorator from Selenium2Library import Selenium2Library @@ -435,7 +436,7 @@ def _resolve_url(self, *args): first_arg = args[0] if not self._is_robot: - if isinstance(first_arg, basestring): + if isinstance(first_arg, six.string_types): # In Python, if the first argument is a string and not a dict, it's a url or path. arg_type = "url" else: From 704271b8299f75f5e24142fa97c9ea5185f329cd Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Thu, 23 Jun 2016 13:42:57 +0200 Subject: [PATCH 17/28] Fix urllib import for py3; Fix super call in OptionHandler for py3; Fix except in page.py for py3. --- robotpageobjects/optionhandler.py | 5 ++++- robotpageobjects/page.py | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/robotpageobjects/optionhandler.py b/robotpageobjects/optionhandler.py index 6b47f36..918d80c 100755 --- a/robotpageobjects/optionhandler.py +++ b/robotpageobjects/optionhandler.py @@ -25,7 +25,10 @@ def __new__(cls, *args, **kwargs): # Singleton pattern... if cls._instance is None: - cls._instance = super(OptionHandler, cls).__new__(cls, *args, **kwargs) + if six.PY2: + cls._instance = super(OptionHandler, cls).__new__(cls, *args, **kwargs) + else: + cls._instance = super().__new__(cls) cls._new_called += 1 return cls._instance diff --git a/robotpageobjects/page.py b/robotpageobjects/page.py index 3a4f4de..1c79fa2 100755 --- a/robotpageobjects/page.py +++ b/robotpageobjects/page.py @@ -21,7 +21,10 @@ from __future__ import print_function import inspect import re -import urllib2 +try: + import urllib.request as urllib2 +except ImportError: + import urllib2 import six import decorator @@ -575,7 +578,7 @@ class MyPageObject(PageObject): try: self.open_browser(resolved_url, self.browser, remote_url=remote_url, desired_capabilities=caps) - except (urllib2.HTTPError, WebDriverException, ValueError), e: + except (urllib2.HTTPError, WebDriverException, ValueError) as e: raise exceptions.SauceConnectionError("Unable to run Sauce job.\n%s\n" "Sauce variables were:\n" "sauce_platform: %s\n" From 98aea34d731968b9cae5e0592c9651ba96cfce84 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Thu, 23 Jun 2016 14:04:55 +0200 Subject: [PATCH 18/28] Fix a few relative imports. --- .../tests/scenarios/po/basepageobjects/__init__.py | 4 ++-- .../tests/scenarios/po/mydbpageobjects/__init__.py | 4 ++-- robotpageobjects/tests/test_functional.py | 7 +++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/robotpageobjects/tests/scenarios/po/basepageobjects/__init__.py b/robotpageobjects/tests/scenarios/po/basepageobjects/__init__.py index 0e931af..5f5f443 100755 --- a/robotpageobjects/tests/scenarios/po/basepageobjects/__init__.py +++ b/robotpageobjects/tests/scenarios/po/basepageobjects/__init__.py @@ -1,2 +1,2 @@ -from homepage import BaseHomePage -from resultspage import BaseResultsPage \ No newline at end of file +from robotpageobjects.tests.scenarios.po.basepageobjects.homepage import BaseHomePage +from robotpageobjects.tests.scenarios.po.basepageobjects.resultspage import BaseResultsPage diff --git a/robotpageobjects/tests/scenarios/po/mydbpageobjects/__init__.py b/robotpageobjects/tests/scenarios/po/mydbpageobjects/__init__.py index 3760d35..2d4165b 100755 --- a/robotpageobjects/tests/scenarios/po/mydbpageobjects/__init__.py +++ b/robotpageobjects/tests/scenarios/po/mydbpageobjects/__init__.py @@ -1,2 +1,2 @@ -from homepage import MyDBHomePage -from resultspage import MyDBResultsPage \ No newline at end of file +from robotpageobjects.tests.scenarios.po.basepageobjects.homepage import MyDBHomePage +from robotpageobjects.tests.scenarios.po.basepageobjects.resultspage import MyDBResultsPage diff --git a/robotpageobjects/tests/test_functional.py b/robotpageobjects/tests/test_functional.py index b1d5305..d5121ad 100755 --- a/robotpageobjects/tests/test_functional.py +++ b/robotpageobjects/tests/test_functional.py @@ -7,10 +7,9 @@ from nose.tools import raises from robotpageobjects import Page, exceptions -from scenarios.po.result_component import ResultPage, ResultPageWithDOMStrategyLocator, HomePage, \ - HomePageWithDOMAdvancedToggler, TwoComponentsPage, ParaComponent, TwoComponentsSubPage -from scenarios.po.loggingpage import LoggingPage -from basetestcase import BaseTestCase +from robotpageobjects.tests.scenarios.po.result_component import ResultPage, ResultPageWithDOMStrategyLocator, HomePage, HomePageWithDOMAdvancedToggler, TwoComponentsPage, ParaComponent, TwoComponentsSubPage +from robotpageobjects.tests.scenarios.po.loggingpage import LoggingPage +from robotpageobjects.tests.basetestcase import BaseTestCase class SmokeTestCase(BaseTestCase): From cee1423a43f32dd704ca32275b45da472c823f20 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Thu, 23 Jun 2016 14:41:35 +0200 Subject: [PATCH 19/28] Fix tests module. --- robotpageobjects/tests/{__init.__.py => __init__.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename robotpageobjects/tests/{__init.__.py => __init__.py} (100%) diff --git a/robotpageobjects/tests/__init.__.py b/robotpageobjects/tests/__init__.py similarity index 100% rename from robotpageobjects/tests/__init.__.py rename to robotpageobjects/tests/__init__.py From 68868a6350b8ed0a2c38206373f47770dd404120 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Thu, 23 Jun 2016 15:03:04 +0200 Subject: [PATCH 20/28] Revert "Fix tests module." This reverts commit cee1423a43f32dd704ca32275b45da472c823f20. --- robotpageobjects/tests/{__init__.py => __init.__.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename robotpageobjects/tests/{__init__.py => __init.__.py} (100%) diff --git a/robotpageobjects/tests/__init__.py b/robotpageobjects/tests/__init.__.py similarity index 100% rename from robotpageobjects/tests/__init__.py rename to robotpageobjects/tests/__init.__.py From 83f26d764fedef9f6f4337a7d825dd4cab9c4e19 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Thu, 23 Jun 2016 15:03:14 +0200 Subject: [PATCH 21/28] Revert "Fix a few relative imports." This reverts commit 98aea34d731968b9cae5e0592c9651ba96cfce84. --- .../tests/scenarios/po/basepageobjects/__init__.py | 4 ++-- .../tests/scenarios/po/mydbpageobjects/__init__.py | 4 ++-- robotpageobjects/tests/test_functional.py | 7 ++++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/robotpageobjects/tests/scenarios/po/basepageobjects/__init__.py b/robotpageobjects/tests/scenarios/po/basepageobjects/__init__.py index 5f5f443..0e931af 100755 --- a/robotpageobjects/tests/scenarios/po/basepageobjects/__init__.py +++ b/robotpageobjects/tests/scenarios/po/basepageobjects/__init__.py @@ -1,2 +1,2 @@ -from robotpageobjects.tests.scenarios.po.basepageobjects.homepage import BaseHomePage -from robotpageobjects.tests.scenarios.po.basepageobjects.resultspage import BaseResultsPage +from homepage import BaseHomePage +from resultspage import BaseResultsPage \ No newline at end of file diff --git a/robotpageobjects/tests/scenarios/po/mydbpageobjects/__init__.py b/robotpageobjects/tests/scenarios/po/mydbpageobjects/__init__.py index 2d4165b..3760d35 100755 --- a/robotpageobjects/tests/scenarios/po/mydbpageobjects/__init__.py +++ b/robotpageobjects/tests/scenarios/po/mydbpageobjects/__init__.py @@ -1,2 +1,2 @@ -from robotpageobjects.tests.scenarios.po.basepageobjects.homepage import MyDBHomePage -from robotpageobjects.tests.scenarios.po.basepageobjects.resultspage import MyDBResultsPage +from homepage import MyDBHomePage +from resultspage import MyDBResultsPage \ No newline at end of file diff --git a/robotpageobjects/tests/test_functional.py b/robotpageobjects/tests/test_functional.py index d5121ad..b1d5305 100755 --- a/robotpageobjects/tests/test_functional.py +++ b/robotpageobjects/tests/test_functional.py @@ -7,9 +7,10 @@ from nose.tools import raises from robotpageobjects import Page, exceptions -from robotpageobjects.tests.scenarios.po.result_component import ResultPage, ResultPageWithDOMStrategyLocator, HomePage, HomePageWithDOMAdvancedToggler, TwoComponentsPage, ParaComponent, TwoComponentsSubPage -from robotpageobjects.tests.scenarios.po.loggingpage import LoggingPage -from robotpageobjects.tests.basetestcase import BaseTestCase +from scenarios.po.result_component import ResultPage, ResultPageWithDOMStrategyLocator, HomePage, \ + HomePageWithDOMAdvancedToggler, TwoComponentsPage, ParaComponent, TwoComponentsSubPage +from scenarios.po.loggingpage import LoggingPage +from basetestcase import BaseTestCase class SmokeTestCase(BaseTestCase): From e8301713277bc094e2e858a0b0eb0f775a1f888e Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Fri, 24 Jun 2016 11:59:30 +0200 Subject: [PATCH 22/28] Fix tests init file. --- robotpageobjects/tests/{__init.__.py => __init__.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename robotpageobjects/tests/{__init.__.py => __init__.py} (100%) diff --git a/robotpageobjects/tests/__init.__.py b/robotpageobjects/tests/__init__.py similarity index 100% rename from robotpageobjects/tests/__init.__.py rename to robotpageobjects/tests/__init__.py From 4355a1c146000c26a755c3c25cc1fe6776d3d56c Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Fri, 24 Jun 2016 13:10:11 +0200 Subject: [PATCH 23/28] Fix relative imports in scenarios.po. --- .../tests/scenarios/po/basepageobjects/__init__.py | 4 ++-- .../tests/scenarios/po/mydbpageobjects/__init__.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/robotpageobjects/tests/scenarios/po/basepageobjects/__init__.py b/robotpageobjects/tests/scenarios/po/basepageobjects/__init__.py index 0e931af..5f5f443 100755 --- a/robotpageobjects/tests/scenarios/po/basepageobjects/__init__.py +++ b/robotpageobjects/tests/scenarios/po/basepageobjects/__init__.py @@ -1,2 +1,2 @@ -from homepage import BaseHomePage -from resultspage import BaseResultsPage \ No newline at end of file +from robotpageobjects.tests.scenarios.po.basepageobjects.homepage import BaseHomePage +from robotpageobjects.tests.scenarios.po.basepageobjects.resultspage import BaseResultsPage diff --git a/robotpageobjects/tests/scenarios/po/mydbpageobjects/__init__.py b/robotpageobjects/tests/scenarios/po/mydbpageobjects/__init__.py index 3760d35..22f4396 100755 --- a/robotpageobjects/tests/scenarios/po/mydbpageobjects/__init__.py +++ b/robotpageobjects/tests/scenarios/po/mydbpageobjects/__init__.py @@ -1,2 +1,2 @@ -from homepage import MyDBHomePage -from resultspage import MyDBResultsPage \ No newline at end of file +from robotpageobjects.tests.scenarios.po.mydbpageobjects.homepage import MyDBHomePage +from robotpageobjects.tests.scenarios.po.mydbpageobjects.resultspage import MyDBResultsPage From bb448aa4a773edf228bc9d432e9e12d490dbb53b Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Fri, 24 Jun 2016 13:14:09 +0200 Subject: [PATCH 24/28] Fix relative imports in test_functional.py and test_unit.py. --- robotpageobjects/tests/test_functional.py | 6 +++--- robotpageobjects/tests/test_unit.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/robotpageobjects/tests/test_functional.py b/robotpageobjects/tests/test_functional.py index b1d5305..86bf577 100755 --- a/robotpageobjects/tests/test_functional.py +++ b/robotpageobjects/tests/test_functional.py @@ -7,10 +7,10 @@ from nose.tools import raises from robotpageobjects import Page, exceptions -from scenarios.po.result_component import ResultPage, ResultPageWithDOMStrategyLocator, HomePage, \ +from robotpageobjects.tests.scenarios.po.result_component import ResultPage, ResultPageWithDOMStrategyLocator, HomePage, \ HomePageWithDOMAdvancedToggler, TwoComponentsPage, ParaComponent, TwoComponentsSubPage -from scenarios.po.loggingpage import LoggingPage -from basetestcase import BaseTestCase +from robotpageobjects.tests.scenarios.po.loggingpage import LoggingPage +from robotpageobjects.tests.basetestcase import BaseTestCase class SmokeTestCase(BaseTestCase): diff --git a/robotpageobjects/tests/test_unit.py b/robotpageobjects/tests/test_unit.py index f518af5..2d17b57 100755 --- a/robotpageobjects/tests/test_unit.py +++ b/robotpageobjects/tests/test_unit.py @@ -8,7 +8,7 @@ import selenium from selenium import webdriver -from basetestcase import BaseTestCase +from robotpageobjects.tests.basetestcase import BaseTestCase from robotpageobjects import exceptions from robotpageobjects.page import Page, _Keywords, Override, not_keyword from robotpageobjects.optionhandler import OptionHandler From 3a267c626ee549c3bc3a7590b287771a2ef9e65e Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Fri, 24 Jun 2016 13:29:24 +0200 Subject: [PATCH 25/28] Fix relative imports in test_unit.py, resultspage.py, and homepage.py. --- .../tests/scenarios/po/mydbpageobjects/homepage.py | 5 +++-- .../tests/scenarios/po/mydbpageobjects/resultspage.py | 2 +- robotpageobjects/tests/test_unit.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/robotpageobjects/tests/scenarios/po/mydbpageobjects/homepage.py b/robotpageobjects/tests/scenarios/po/mydbpageobjects/homepage.py index b175b42..f7efe3e 100755 --- a/robotpageobjects/tests/scenarios/po/mydbpageobjects/homepage.py +++ b/robotpageobjects/tests/scenarios/po/mydbpageobjects/homepage.py @@ -1,4 +1,5 @@ -from basepageobjects import BaseHomePage +from robotpageobjects.tests.scenarios.po.mydbpageobjects.basepageobjects import BaseHomePage + class MyDBHomePage(BaseHomePage): - pass \ No newline at end of file + pass diff --git a/robotpageobjects/tests/scenarios/po/mydbpageobjects/resultspage.py b/robotpageobjects/tests/scenarios/po/mydbpageobjects/resultspage.py index 7d1721b..49366e5 100755 --- a/robotpageobjects/tests/scenarios/po/mydbpageobjects/resultspage.py +++ b/robotpageobjects/tests/scenarios/po/mydbpageobjects/resultspage.py @@ -1,4 +1,4 @@ -from basepageobjects import BaseResultsPage +from robotpageobjects.tests.scenarios.po.basepageobjects import BaseResultsPage class MyDBResultsPage(BaseResultsPage): uri = "http://www.ncbi.nlm.nih.gov/mydb/?term={term}" diff --git a/robotpageobjects/tests/test_unit.py b/robotpageobjects/tests/test_unit.py index 2d17b57..2977df4 100755 --- a/robotpageobjects/tests/test_unit.py +++ b/robotpageobjects/tests/test_unit.py @@ -18,7 +18,7 @@ po_dir = os.path.join(scenario_dir, "po") sys.path.append(po_dir) -from basepageobjects import BaseHomePage, BaseResultsPage +from robotpageobjects.tests.scenarios.po.basepageobjects import BaseHomePage, BaseResultsPage class InheritFromSe2LibTestCase(BaseTestCase): From 16f58fa32d45e46b1ff4a4a99efc9900c8523a4d Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Fri, 24 Jun 2016 13:34:31 +0200 Subject: [PATCH 26/28] Revert "Fix relative imports in test_unit.py, resultspage.py, and homepage.py." This reverts commit 3a267c626ee549c3bc3a7590b287771a2ef9e65e. --- .../tests/scenarios/po/mydbpageobjects/homepage.py | 5 ++--- .../tests/scenarios/po/mydbpageobjects/resultspage.py | 2 +- robotpageobjects/tests/test_unit.py | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/robotpageobjects/tests/scenarios/po/mydbpageobjects/homepage.py b/robotpageobjects/tests/scenarios/po/mydbpageobjects/homepage.py index f7efe3e..b175b42 100755 --- a/robotpageobjects/tests/scenarios/po/mydbpageobjects/homepage.py +++ b/robotpageobjects/tests/scenarios/po/mydbpageobjects/homepage.py @@ -1,5 +1,4 @@ -from robotpageobjects.tests.scenarios.po.mydbpageobjects.basepageobjects import BaseHomePage - +from basepageobjects import BaseHomePage class MyDBHomePage(BaseHomePage): - pass + pass \ No newline at end of file diff --git a/robotpageobjects/tests/scenarios/po/mydbpageobjects/resultspage.py b/robotpageobjects/tests/scenarios/po/mydbpageobjects/resultspage.py index 49366e5..7d1721b 100755 --- a/robotpageobjects/tests/scenarios/po/mydbpageobjects/resultspage.py +++ b/robotpageobjects/tests/scenarios/po/mydbpageobjects/resultspage.py @@ -1,4 +1,4 @@ -from robotpageobjects.tests.scenarios.po.basepageobjects import BaseResultsPage +from basepageobjects import BaseResultsPage class MyDBResultsPage(BaseResultsPage): uri = "http://www.ncbi.nlm.nih.gov/mydb/?term={term}" diff --git a/robotpageobjects/tests/test_unit.py b/robotpageobjects/tests/test_unit.py index 2977df4..2d17b57 100755 --- a/robotpageobjects/tests/test_unit.py +++ b/robotpageobjects/tests/test_unit.py @@ -18,7 +18,7 @@ po_dir = os.path.join(scenario_dir, "po") sys.path.append(po_dir) -from robotpageobjects.tests.scenarios.po.basepageobjects import BaseHomePage, BaseResultsPage +from basepageobjects import BaseHomePage, BaseResultsPage class InheritFromSe2LibTestCase(BaseTestCase): From 963702ca566a8aaf08fbbe7a9fedebefde7223c9 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Fri, 24 Jun 2016 13:35:03 +0200 Subject: [PATCH 27/28] Add Makefile. --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9dad33d --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +SHELL := /bin/bash +CURRENT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) + +all: test + +test: + @echo "Run Tests" + nosetests -vs --with-xunit robotpageobjects/tests/test_unit.py robotpageobjects/tests/test_functional.py From e36e1de2ce89b1eadac1f7a19199a77031ed0190 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Fri, 24 Jun 2016 15:15:43 +0200 Subject: [PATCH 28/28] Fix relative imports in test_unit.py. --- robotpageobjects/tests/test_unit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/robotpageobjects/tests/test_unit.py b/robotpageobjects/tests/test_unit.py index 2d17b57..2977df4 100755 --- a/robotpageobjects/tests/test_unit.py +++ b/robotpageobjects/tests/test_unit.py @@ -18,7 +18,7 @@ po_dir = os.path.join(scenario_dir, "po") sys.path.append(po_dir) -from basepageobjects import BaseHomePage, BaseResultsPage +from robotpageobjects.tests.scenarios.po.basepageobjects import BaseHomePage, BaseResultsPage class InheritFromSe2LibTestCase(BaseTestCase):