├── test ├── acceptance │ ├── keywords │ │ ├── __init__.txt │ │ ├── IFrames.txt │ │ └── Drag And Drop.txt │ ├── __init__.txt │ └── resource.txt ├── run_tests.sh └── resources │ └── html │ └── frames │ ├── bar.html │ ├── foo.html │ ├── right.html │ ├── iframeset.html │ └── left.html ├── .gitignore ├── src └── Selenium2LibraryExtensions │ ├── keywords │ ├── __init__.py │ ├── _draganddrop.py │ ├── _pagetests.py │ └── _actionchains.py │ └── __init__.py ├── README.markdown └── LICENSE.txt /test/acceptance/keywords/__init__.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/run_tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | script_dir=`dirname $0` 3 | cd $script_dir/acceptance 4 | pybot --exclude not_ready . 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | target 3 | bin 4 | .*.swp 5 | *.swp 6 | *.kate-swp 7 | .*.swo 8 | *.pyc 9 | *.log 10 | *.png 11 | .ropeproject 12 | -------------------------------------------------------------------------------- /test/resources/html/frames/bar.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

You're looking at bar.

4 | 5 | -------------------------------------------------------------------------------- /test/resources/html/frames/foo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

You're looking at foo.

4 | 5 | -------------------------------------------------------------------------------- /test/resources/html/frames/right.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

You're looking at right.

4 | 5 | -------------------------------------------------------------------------------- /test/acceptance/__init__.txt: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library ${CURDIR}/../../src/Selenium2LibraryExtensions WITH NAME Selenium2LibraryExtensions 3 | 4 | -------------------------------------------------------------------------------- /test/acceptance/resource.txt: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library Selenium2Library 3 | Library Selenium2LibraryExtensions 4 | 5 | *** Variables *** 6 | ${BROWSER} firefox 7 | 8 | -------------------------------------------------------------------------------- /test/resources/html/frames/iframeset.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /test/resources/html/frames/left.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Links:

4 | 8 | 9 | -------------------------------------------------------------------------------- /src/Selenium2LibraryExtensions/keywords/__init__.py: -------------------------------------------------------------------------------- 1 | from _pagetests import _PageTestsKeywords 2 | from _draganddrop import _DragAndDropKeywords 3 | from _actionchains import _ActionChainsKeywords 4 | 5 | __all__ = [ 6 | "_PageTestsKeywords", 7 | "_DragAndDropKeywords", 8 | "_ActionChainsKeywords" 9 | ] 10 | -------------------------------------------------------------------------------- /test/acceptance/keywords/IFrames.txt: -------------------------------------------------------------------------------- 1 | *** Setting *** 2 | Test Setup 3 | Test Teardown 4 | Force Tags 5 | Resource ../resource.txt 6 | 7 | *** Test Cases *** 8 | IFrame Should Contain 9 | [Tags] 10 | [Setup] Open Browser file:///${CURDIR}/../../resources/html/frames/iframeset.html 11 | Frame Should contain right You're looking at right. 12 | Frame Should Contain left Links 13 | [Teardown] Close Browser 14 | 15 | Select And Unselect Frame 16 | [Documentation] LOG 2 Selecting frame 'left'. 17 | [Tags] 18 | [Setup] Open Browser file:///${CURDIR}/../../resources/html/frames/iframeset.html 19 | Select IFrame left 20 | Click Link foo 21 | Unselect Frame 22 | Select IFrame right 23 | Current Frame Contains You're looking at foo. 24 | [Teardown] Close Browser 25 | 26 | -------------------------------------------------------------------------------- /src/Selenium2LibraryExtensions/__init__.py: -------------------------------------------------------------------------------- 1 | from keywords import * 2 | 3 | class Selenium2LibraryExtensions( 4 | _PageTestsKeywords, 5 | _DragAndDropKeywords, 6 | _ActionChainsKeywords 7 | ): 8 | """Selenium2LibraryExtensions adds a number of keywords to the Selenium2Library. 9 | 10 | Note that in fact it does not extend the Selenium2Library. 11 | Internally it accesses the Selenium2Library instance and uses the underlying 12 | selenium browser. 13 | 14 | In the process of adding keywords 15 | Some Useful links: 16 | http://goldb.org/sst/selenium2_api_docs/html/selenium.selenium%27.selenium-class.html 17 | http://goldb.org/sst/selenium2_api_docs/html/selenium.webdriver.remote.webdriver.WebDriver-class.html 18 | """ 19 | ROBOT_LIBRARY_SCOPE = 'GLOBAL' 20 | ROBOT_LIBRARY_VERSION = '0.0.1' 21 | 22 | def __init__(self, timeout=5.0, implicit_wait=0.0, run_on_failure='Capture Page Screenshot'): 23 | for base in Selenium2LibraryExtensions.__bases__: 24 | if hasattr(base,'__init__'): 25 | base.__init__(self) 26 | 27 | -------------------------------------------------------------------------------- /src/Selenium2LibraryExtensions/keywords/_draganddrop.py: -------------------------------------------------------------------------------- 1 | from robot.libraries.BuiltIn import BuiltIn 2 | from selenium.webdriver.common.action_chains import ActionChains 3 | 4 | class _DragAndDropKeywords: 5 | @property 6 | def s2l(self): 7 | return BuiltIn().get_library_instance('Selenium2Library') 8 | 9 | def drag_and_drop(self, source, target): 10 | """Drags element identified with locator 'source' onto the element 11 | identified by the locator 'target' 12 | """ 13 | element = self.s2l._element_find(source,True,True) 14 | target_elem = self.s2l._element_find(target,True,True) 15 | ActionChains(self.s2l._current_browser()).drag_and_drop(element, target_elem).perform() 16 | 17 | def drag_and_drop_with_offset(self, source, target, xoffset, yoffset): 18 | """Drags element identified with 'source' locator onto the 19 | target element identified by the target locator. 20 | Before dropping, move to the offset specified 21 | """ 22 | element = self.s2l._element_find(source,True,True) 23 | target_elem = self.s2l._element_find(target,True,True) 24 | ActionChains(self.s2l._current_browser()).click_and_hold( 25 | element).move_to_element_with_offset( 26 | target_elem, xoffset, yoffset).perform() 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/Selenium2LibraryExtensions/keywords/_pagetests.py: -------------------------------------------------------------------------------- 1 | #from selenium.webdriver.common.keys import Keys 2 | #from Selenium2Library import utils 3 | #from Selenium2Library.locators import ElementFinder 4 | #from Selenium2Library.keywords.keywordgroup import KeywordGroup 5 | #from Selenium2Library.keywords import _ElementKeywords 6 | 7 | from robot.libraries.BuiltIn import BuiltIn 8 | 9 | class _PageTestsKeywords(): 10 | """ Runs assertions against the content of the page. 11 | Returns booleans instead of throwing errors 12 | """ 13 | 14 | def is_visible(self, locator): 15 | """Same than Element Should Be Visible but returns a boolean """ 16 | selenium2lib = BuiltIn().get_library_instance('Selenium2Library') 17 | try: 18 | return selenium2lib.element_should_be_visible(locator) 19 | except AssertionError: 20 | return False 21 | 22 | def is_element_present(self, locator): 23 | """Same than Page Should Contain Element but returns a boolean """ 24 | selenium2lib = BuiltIn().get_library_instance('Selenium2Library') 25 | try: 26 | return selenium2lib.page_should_contain_element(locator) 27 | except AssertionError: 28 | return False 29 | 30 | def select_iframe(self, locator): 31 | """Sets iframe identified by `locator` as current frame. 32 | 33 | Key attributes for frames are `id` and `name.` See `introduction` for 34 | details about locating elements. 35 | """ 36 | selenium2lib = BuiltIn().get_library_instance('Selenium2Library') 37 | selenium2lib._info("Selecting iframe '%s'." % locator) 38 | element = selenium2lib._element_find(locator, True, True, tag='iframe') 39 | selenium2lib._current_browser().switch_to_frame(element) 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /test/acceptance/keywords/Drag And Drop.txt: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource ../resource.txt 3 | 4 | *** Test Cases *** 5 | TestDandD_jquery 6 | [Tags] 7 | [Setup] Open Browser http://jqueryui.com/demos/droppable/ ${BROWSER} 8 | Drag And Drop draggable droppable 9 | Element Text Should Be xpath=//div[@id='droppable']/p Dropped! 10 | [Teardown] Close Browser 11 | 12 | TestActionChains_jquery 13 | [Tags] 14 | [Setup] Open Browser http://jqueryui.com/demos/droppable/ ${BROWSER} 15 | Chain Click And Hold draggable 16 | Chain Release droppable 17 | Chains Perform Now 18 | Element Text Should Be xpath=//div[@id='droppable']/p Dropped! 19 | [Teardown] Close Browser 20 | 21 | TestActionChains_html5 22 | [Documentation] This does not work.... here is the bug in selenium: http://code.google.com/p/selenium/issues/detail?id=3604 23 | [Tags] fails not_ready 24 | [Setup] Open Browser http://html5demos.com/drag ${BROWSER} 25 | Mouse Over one 26 | Chain Click And Hold one 27 | Chain Move To Element bin 28 | Chain Release bin 29 | Chains Perform Now 30 | Page Should Contain Element xpath=//div[@id='bin']/p 31 | [Teardown] Close Browser 32 | 33 | TestDandD_html5 34 | [Documentation] This does not work.... here is the bug in selenium 35 | [Tags] fails not_ready 36 | [Setup] Open Browser http://html5demos.com/drag ${BROWSER} 37 | Drag And Drop one bin 38 | Page Should Contain Element xpath=//div[@id='bin']/p 39 | [Teardown] Close Browser 40 | 41 | TestActionChainsSleep 42 | [Tags] 43 | [Setup] Open Browser file:/// 44 | ${secs_before}= Get Time epoch 45 | Chain Sleep 4 46 | Chains Perform Now 47 | ${secs_after}= Get Time epoch 48 | Should Be True ${secs_after}-${secs_before}>=4 49 | [Teardown] Close Browser 50 | 51 | -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | robotframework-selenium2library-extensions 2 | ========================================== 3 | Extends the [robotframework-selenium2library](https://github.com/rtomac/robotframework-selenium2library/ "robotframework-selenium2library"). 4 | 5 | Extra keywords 6 | ============== 7 | 8 | [Action Chains](http://selenium.googlecode.com/svn/trunk/docs/api/py/webdriver/selenium.webdriver.common.action_chains.html) 9 | Lazily initiates an action chains. 10 | 11 | Chain Sleep 12 | Chain Click 13 | Chain Click And Hold 14 | Chain Drag And Drop 15 | Chain Key Up 16 | Chain Key Down 17 | Chain Move By Offset 18 | Chain Move To Element 19 | Chain Move To Element With Offset 20 | Chain Release 21 | Chain Send Keys 22 | Chain Send Keys To Element 23 | 24 | Execute the created action chains: 25 | 26 | Chains Perform Now 27 | 28 | Drag and drop shortcuts: immediately performed. 29 | 30 | Drag And Drop 31 | Drag And Drop With Offset 32 | 33 | Page Tests: 34 | 35 | Select IFrame 36 | Is Element Present 37 | Is Visible 38 | 39 | Note: some limitations regarding drag and drop 40 | ============================================== 41 | Note that action chains are not well supported by some dirvers. 42 | In particular, HTML5 Drag and Drop have not worked so far for firefox and chrome 43 | on my linux machine. 44 | It is working with jquery's drag and drop. 45 | 46 | Here are some notable webkit and chrome-driver bugs to follow: 47 | * keyup can't be simulated: (https://bugs.webkit.org/show_bug.cgi?id=16735) 48 | * html5's drag and drop with chrome-driver not supported: (http://code.google.com/p/selenium/issues/detail?id=3604) 49 | 50 | Requirements 51 | ============ 52 | * Robotframework 53 | * robotframework-selenium2library 54 | 55 | Installation 56 | ============ 57 | 58 | git clone https://github.com/hmalphettes/robotframework-selenium2library-extensions.git 59 | 60 | And in your robotframework test, import the library. For example: 61 | 62 | *** Settings 63 | Library ${CURDIR}/../../src/Selenium2LibraryExtensions WITH NAME Selenium2LibraryExtensions 64 | 65 | 66 | Run the tests 67 | ============= 68 | 69 | ./test/run_tests.sh 70 | 71 | Extending robotframework-selenium2library without forking it 72 | ============================================================ 73 | Use any of the techniques documented to write a python plugin for robotframework. 74 | In your keyword's method here how to access the active selenium's browser: 75 | 76 | selenium2lib = BuiltIn().get_library_instance('Selenium2Library') 77 | selenium_browser = selenium2lib._current_browser() 78 | 79 | Now refer to selenium driver's python API and go wild. 80 | 81 | 82 | License 83 | ======= 84 | ASL-2.0 just like robotframework-selenium2library. 85 | -------------------------------------------------------------------------------- /src/Selenium2LibraryExtensions/keywords/_actionchains.py: -------------------------------------------------------------------------------- 1 | from robot.libraries.BuiltIn import BuiltIn 2 | from selenium.webdriver.common.action_chains import ActionChains 3 | 4 | class _ActionChainsKeywords: 5 | 6 | def __init__(self): 7 | self.action_chains = None 8 | 9 | @property 10 | def s2l(self): 11 | return BuiltIn().get_library_instance('Selenium2Library') 12 | 13 | def __lazy_init_action_chains(self): 14 | if self.action_chains == None: 15 | self.action_chains = ActionChains(self.s2l._current_browser()) 16 | return self.action_chains 17 | 18 | 19 | def chain_click(self, on_element=None): 20 | """ Click on the element identified by the on_element locator. 21 | When no such thing, click where the mouse currently is. 22 | """ 23 | if on_element != None: 24 | element = self.s2l._element_find(on_element,True,True) 25 | else: 26 | element = None 27 | self.__lazy_init_action_chains().click(element) 28 | 29 | def chain_double_click(self, on_element=None): 30 | """ Click on the element identified by the on_element locator. 31 | When no such thing, click where the mouse currently is. 32 | """ 33 | if on_element != None: 34 | element = self.s2l._element_find(on_element,True,True) 35 | else: 36 | element = None 37 | self.__lazy_init_action_chains().double_click(element) 38 | 39 | def chain_context_click(self, on_element=None): 40 | """ Click on the element identified by the on_element locator. 41 | When no such thing, click where the mouse currently is. 42 | """ 43 | if on_element != None: 44 | element = self.s2l._element_find(on_element,True,True) 45 | else: 46 | element = None 47 | self.__lazy_init_action_chains().context_click(element) 48 | 49 | def chain_drag_and_drop(self, source, target): 50 | """Drags element identified with locator by movement 51 | 52 | `movement is a string in format "+70 -300" interpreted as pixels in 53 | relation to elements current position. 54 | """ 55 | element = self.s2l._element_find(source,True,True) 56 | target = self.s2l._element_find(target,True,True) 57 | self.__lazy_init_action_chains().drag_and_drop(element, target) 58 | 59 | def chain_drag_and_drop_with_offset(self, source, target, xoffset, yoffset): 60 | """Drags element identified with locator by movement 61 | 62 | `movement is a string in format "+70 -300" interpreted as pixels in 63 | relation to elements current position. 64 | """ 65 | element = self.s2l._element_find(source,True,True) 66 | target = self.s2l._element_find(target,True,True) 67 | self.__lazy_init_action_chains().click_and_hold(element).move_to_element_with_offset( 68 | target, xoffset, yoffset).release() 69 | 70 | def chain_click_and_hold(self, source): 71 | """ Click and hold the element identified by the 'source' locator 72 | """ 73 | element = self.s2l._element_find(source,True,True) 74 | self.__lazy_init_action_chains().click_and_hold(element) 75 | 76 | def chain_release(self, target): 77 | """ Move the mouse to the element identified by the 'target' locator 78 | Release the mouse. 79 | """ 80 | element = self.s2l._element_find(target,True,True) 81 | self.__lazy_init_action_chains().release(element) 82 | 83 | def move_by_offset(self, xoffset, yoffset): 84 | """Moving the mouse to an offset from current mouse position. 85 | Args: 86 | xoffset: X offset to move to. 87 | yoffset: Y offset to move to. 88 | """ 89 | self.__lazy_init_action_chains().move_by_offset(xoffset, yoffset) 90 | 91 | def chain_move_to_element(self, target): 92 | element = self.s2l._element_find(target,True,True) 93 | self.__lazy_init_action_chains().move_to_element(element) 94 | 95 | def chain_move_to_element_with_offset(self, target, xoffset, yoffset): 96 | element = self.s2l._element_find(target,True,True) 97 | self.__lazy_init_action_chains().move_to_element_with_offset(element, 98 | xoffset, yoffset) 99 | 100 | def chain_send_keys(self, *keys_to_send): 101 | """Sends keys to current focused element. 102 | Args: 103 | keys_to_send: The keys to send. 104 | """ 105 | self.__lazy_init_action_chains().send_keys(*keys_to_send) 106 | 107 | def chain_send_keys_to_element(self, element, *keys_to_send): 108 | """Sends keys to an element identifed by the 'eleemnt' locator. 109 | Args: 110 | element: The element to send keys. 111 | keys_to_send: The keys to send. 112 | """ 113 | element_el = self.s2l._element_find(element,True,True) 114 | self.__lazy_init_action_chains().send_keys(element_el, *keys_to_send) 115 | 116 | def chain_sleep(self, time_, reason=None): 117 | """ Add a sleep to the action chains 118 | """ 119 | self.__lazy_init_action_chains()._actions.append(lambda: 120 | BuiltIn().sleep(time_,reason)) 121 | 122 | def chains_perform_now(self): 123 | if self.action_chains != None: 124 | self.action_chains.perform() 125 | self.action_chains = None 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. --------------------------------------------------------------------------------