Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion robotpageobjects/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from robot.utils import asserts
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.common.exceptions import WebDriverException
from Selenium2Library import Selenium2Library
from Selenium2Library.keywords.keywordgroup import KeywordGroupMetaClass
from . import abstractedlogger
Expand Down Expand Up @@ -822,7 +823,7 @@ class MyPageObject(PageObject):

try:
self.open_browser(resolved_url, self.browser, remote_url=remote_url, desired_capabilities=caps)
except urllib2.HTTPError:
except (urllib2.HTTPError, WebDriverException):
raise exceptions.SauceConnectionError("Unable to connect to sauce labs. Check your username and "
"apikey")

Expand Down
1 change: 1 addition & 0 deletions robotpageobjects/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class Page(_BaseActions, _SelectorsManager, _ComponentsManager):
It is a robotframework library which implements the dynamic API.
"""
__metaclass__ = _PageMeta
ROBOT_LIBRARY_SCOPE = 'TEST SUITE'

def __init__(self):
"""
Expand Down
11 changes: 11 additions & 0 deletions tests/scenarios/test_s2l_imported_multiple_a.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*** Settings ***

Documentation Tests for Robot Framework Page Object package.
Library widget_template.WidgetItemPage

*** Test Cases ***

Test Widget Site
Open Widget Item Page category=home-and-garden id=123
Title Should Be Cool Widget
[Teardown] Close Widget Item Page
11 changes: 11 additions & 0 deletions tests/scenarios/test_s2l_imported_multiple_b.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*** Settings ***

Documentation Tests for Robot Framework Page Object package.
Library widget_template.WidgetItemPage

*** Test Cases ***

Test Widget Site
Open Widget Item Page category=home-and-garden id=123
Title Should Be Cool Widget
[Teardown] Close Widget Item Page
7 changes: 7 additions & 0 deletions tests/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,3 +615,10 @@ def test_gen_doc(self):
doc = kwentry.findall('./doc')[0]
if 'DEBUG' not in doc.text:
raise AssertionError('Expected to find "DEBUG" in docmentation for "Log" in %s' % outxml)

class MultipleSuiteLibraryImport(BaseTestCase):

def test_libraries_stay_imported(self):
self.set_baseurl_env()
run = self.run_scenario("test_s2l_imported_multiple_a.robot test_s2l_imported_multiple_b.robot")
self.assert_run(run, expected_returncode=0)