Repository navigation
Update travis conf #678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update travis conf #678
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,24 +2,51 @@ addons: | |
| firefox: latest-esr | ||
| language: python | ||
| sudo: false | ||
| python: | ||
| - "2.7" | ||
| install: | ||
| #- pip install pep8 --use-mirrors | ||
| #- pip install pyflakes --use-mirrors | ||
| - pip install robotframework | ||
| - pip install selenium==2.53.6 | ||
| - pip install decorator | ||
| - pip install mockito | ||
| #- "if [[ ${BROWSER} == 'ie' ]]; then pip install ie_only_pkg; fi" | ||
| - pip install . | ||
| - pip install -r requirements.txt | ||
| - pip install -r requirements-dev.txt | ||
| before_script: | ||
| - "export DISPLAY=:99.0" | ||
| - "sh -e /etc/init.d/xvfb start" | ||
| script: | ||
| - "firefox --version" | ||
| - "python test/run_tests.py python $BROWSER --noncritical known_issue_-_travisci" | ||
| - "if [[ -n ${SELENIUM_VERSION+x} ]]; then pip install -U selenium==${SELENIUM_VERSION}; fi" | ||
| - "python test/run_tests.py python \"$BROWSER\"" | ||
| env: | ||
| matrix: | ||
| - BROWSER=firefox | ||
| #- BROWSER=ie # will be added when we have completed SauceLabs CI | ||
| #- BROWSER=safari # will be added after #247 merged | ||
| global: | ||
| - secure: "QyY0j8C+hVhsGLv4YU0UMvLm5wBDg6xT5J0Ee77C/JAQ6vcdCMpTfWI8oDxTZb7pBhpDkYuNe747yCYF5PrdBYQbO08FilxctReuJfMXcH44rZC5q49mUmPamkvg1LkzIWuC1s9uKnjlvyDT5ojuPXZl2Vn0gIhSIg+yOyBkM1U=" | ||
| - secure: "HJaJTYauaBZODMDkbnRVsiCk+t2uVtztkkJ5V4dXSnE1uIBms2PVbufQwb+YNvzHkGheLtpnt/hLM1HhmSFgUtOCf+eumQ6kaLR2KRVEysXwWJzgZoLBidNBOy5rvAIsc9JJbDaIgYVGzyaJGTP9AMb8CyvIPE//lH10sf+GB7g=" | ||
| matrix: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add some run with Python 3 too. Example have to runs with Chrome one with Python 2.7 and another one with Python 3.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can add it, but does s2l compatible with py3?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No it is not yet compatible. But the aim for the 2.0 release, which hopefully is the next release, is to make it compatible with Python 3. |
||
| include: | ||
| - os: linux | ||
| env: | ||
| - BROWSER=firefox | ||
| - SELENIUM_VERSION=2.53.6 | ||
| addons: | ||
| firefox: "47.0.1" | ||
| python: "2.7" | ||
| - os: linux | ||
| env: | ||
| - BROWSER=chrome | ||
| addons: | ||
| sauce_connect: true | ||
| python: "2.7" | ||
| - os: linux | ||
| env: | ||
| - BROWSER=firefox | ||
| - SELENIUM_VERSION=2.53.6 | ||
| addons: | ||
| sauce_connect: true | ||
| python: "3.4" | ||
| - os: linux | ||
| env: | ||
| - BROWSER="internet explorer" | ||
| addons: | ||
| sauce_connect: true | ||
| python: "2.7" | ||
| - os: linux | ||
| env: | ||
| - BROWSER=safari | ||
| addons: | ||
| sauce_connect: true | ||
| python: "2.7" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| decorator >= 3.3.2 | ||
| selenium >= 2.32.0 | ||
| selenium | ||
| robotframework >= 2.6.0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,6 @@ | ||
| #!/usr/bin/env python | ||
|
|
||
| from os.path import abspath, dirname, join | ||
|
|
||
| from setuptools import setup | ||
|
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,8 +5,16 @@ | |
| from Selenium2Library import utils | ||
| from Selenium2Library.locators import ElementFinder | ||
| from Selenium2Library.locators import CustomLocator | ||
| from Selenium2Library.keywords.keywordgroup import KeywordGroup | ||
|
|
||
| from .keywordgroup import KeywordGroup | ||
| try: | ||
| basestring # attempt to evaluate basestring | ||
|
|
||
| def isstr(s): | ||
| return isinstance(s, basestring) | ||
| except NameError: | ||
| def isstr(s): | ||
| return isinstance(s, str) | ||
|
|
||
|
|
||
| class _ElementKeywords(KeywordGroup): | ||
|
|
@@ -358,9 +366,11 @@ def click_element_at_coordinates(self, locator, xoffset, yoffset): | |
| """ | ||
| self._info("Click clicking element '%s' in coordinates '%s', '%s'." % (locator, xoffset, yoffset)) | ||
| element = self._element_find(locator, True, True) | ||
| #self._element_find(locator, True, True).click() | ||
| #ActionChains(self._current_browser()).move_to_element_with_offset(element, xoffset, yoffset).click().perform() | ||
| ActionChains(self._current_browser()).move_to_element(element).move_by_offset(xoffset, yoffset).click().perform() | ||
| action = ActionChains(self._current_browser()) | ||
| action.move_to_element(element) | ||
| action.move_by_offset(xoffset, yoffset) | ||
| action.click() | ||
| action.perform() | ||
|
|
||
| def double_click_element(self, locator): | ||
| """Double click element identified by `locator`. | ||
|
|
@@ -389,11 +399,10 @@ def drag_and_drop(self, source, target): | |
| Examples: | ||
| | Drag And Drop | elem1 | elem2 | # Move elem1 over elem2. | | ||
| """ | ||
| src_elem = self._element_find(source,True,True) | ||
| trg_elem = self._element_find(target,True,True) | ||
| src_elem = self._element_find(source, True, True) | ||
| trg_elem = self._element_find(target, True, True) | ||
| ActionChains(self._current_browser()).drag_and_drop(src_elem, trg_elem).perform() | ||
|
|
||
|
|
||
| def drag_and_drop_by_offset(self, source, xoffset, yoffset): | ||
| """Drags element identified with `source` which is a locator. | ||
|
|
||
|
|
@@ -404,7 +413,9 @@ def drag_and_drop_by_offset(self, source, xoffset, yoffset): | |
| | Drag And Drop By Offset | myElem | 50 | -35 | # Move myElem 50px right and 35px down. | | ||
| """ | ||
| src_elem = self._element_find(source, True, True) | ||
| ActionChains(self._current_browser()).drag_and_drop_by_offset(src_elem, xoffset, yoffset).perform() | ||
| action = ActionChains(self._current_browser()) | ||
| action.drag_and_drop_by_offset(src_elem, xoffset, yoffset) | ||
| action.perform() | ||
|
|
||
| def mouse_down(self, locator): | ||
| """Simulates pressing the left mouse button on the element specified by `locator`. | ||
|
|
@@ -582,7 +593,6 @@ def mouse_down_on_image(self, locator): | |
|
|
||
| def page_should_contain_image(self, locator, message='', loglevel='INFO'): | ||
| """Verifies image identified by `locator` is found from current page. | ||
|
|
||
| See `Page Should Contain Element` for explanation about `message` and | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think empty line should have not been removed. |
||
| `loglevel` arguments. | ||
|
|
||
|
|
@@ -723,7 +733,7 @@ def _is_enabled(self, locator): | |
| return True | ||
|
|
||
| def _is_text_present(self, text): | ||
| locator = "xpath=//*[contains(., %s)]" % utils.escape_xpath_value(text); | ||
| locator = "xpath=//*[contains(., %s)]" % utils.escape_xpath_value(text) | ||
| return self._is_element_present(locator) | ||
|
|
||
| def _is_visible(self, locator): | ||
|
|
@@ -759,22 +769,22 @@ def _map_ascii_key_code_to_key(self, key_code): | |
|
|
||
| def _map_named_key_code_to_special_key(self, key_name): | ||
| try: | ||
| return getattr(Keys, key_name) | ||
| return getattr(Keys, key_name) | ||
| except AttributeError: | ||
| message = "Unknown key named '%s'." % (key_name) | ||
| self._debug(message) | ||
| raise ValueError(message) | ||
| message = "Unknown key named '%s'." % (key_name) | ||
| self._debug(message) | ||
| raise ValueError(message) | ||
|
|
||
| def _parse_attribute_locator(self, attribute_locator): | ||
| parts = attribute_locator.rpartition('@') | ||
| if len(parts[0]) == 0: | ||
| raise ValueError("Attribute locator '%s' does not contain an element locator." % (attribute_locator)) | ||
| if len(parts[2]) == 0: | ||
| raise ValueError("Attribute locator '%s' does not contain an attribute name." % (attribute_locator)) | ||
| return (parts[0], parts[2]) | ||
| return parts[0], parts[2] | ||
|
|
||
| def _is_element_present(self, locator, tag=None): | ||
| return (self._element_find(locator, True, False, tag=tag) is not None) | ||
| return self._element_find(locator, True, False, tag=tag) is not None | ||
|
|
||
| def _page_contains(self, text): | ||
| browser = self._current_browser() | ||
|
|
@@ -791,7 +801,6 @@ def _page_contains(self, text): | |
| browser.switch_to_default_content() | ||
| if found_text: | ||
| return True | ||
|
|
||
| return False | ||
|
|
||
| def _page_should_contain_element(self, locator, tag, message, loglevel): | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,10 +7,11 @@ Library Collections | |
| Create Webdriver Creates Functioning WebDriver | ||
| [Documentation] LOG 2:1 INFO REGEXP: Creating an instance of the \\w+ WebDriver | ||
| ... LOG 2:4 DEBUG REGEXP: Created \\w+ WebDriver instance with session id (\\w|-)+ | ||
| [Tags] Known Issue Chrome Known Issue Internet Explorer Known Issue Safari | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we document the tags we use, so that people contributing could also use them right? |
||
| [Setup] Set Driver Variables | ||
| Create Webdriver ${DRIVER_NAME} kwargs=${KWARGS} | ||
| Go To ${FRONT PAGE} | ||
| Page Should Contain needle | ||
| Go To ${FRONT_PAGE} | ||
| Wait Until Page Contains needle 5s | ||
| [Teardown] Close Browser | ||
|
|
||
| Create Webdriver With Bad Driver Name | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the Sauce Labs hash keys to access the account. You have the clear passwords saved in somewhere? Perhaps we should distribute the password with wider audience but not put the passwords in git repo.
Is there reason why the are two secure lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, these are encoded login and password for sauce labs. They can be securely stored in repo because they can be decoded only in travis env.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, this is good to go then.