robotframework-browserpom 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- robotframework_browserpom-0.1.0/BrowserPOM/__init__.py +104 -0
- robotframework_browserpom-0.1.0/BrowserPOM/keywords.py +102 -0
- robotframework_browserpom-0.1.0/BrowserPOM/locatormap.py +42 -0
- robotframework_browserpom-0.1.0/BrowserPOM/pageobject.py +68 -0
- robotframework_browserpom-0.1.0/LICENSE +201 -0
- robotframework_browserpom-0.1.0/PKG-INFO +12 -0
- robotframework_browserpom-0.1.0/pyproject.toml +74 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
from __future__ import absolute_import, unicode_literals
|
|
2
|
+
|
|
3
|
+
from .keywords import BrowserPomKeywords
|
|
4
|
+
from .pageobject import PageObject
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class BrowserPOM(BrowserPomKeywords):
|
|
8
|
+
"""*PageObjectLibrary* is a lightweight library which supports using
|
|
9
|
+
the page object pattern with
|
|
10
|
+
[https://robotframework-browser.org/|BrowserLibrary].
|
|
11
|
+
This library does not replace BrowserLibrary; rather, it
|
|
12
|
+
provides a framework around which to use BrowserLibrary and the
|
|
13
|
+
lower-level [http://selenium-python.readthedocs.org/|Python
|
|
14
|
+
bindings to Playwright]
|
|
15
|
+
|
|
16
|
+
This library provides the following keywords:
|
|
17
|
+
|
|
18
|
+
| =Keyword Name= | =Synopsis= |
|
|
19
|
+
| Go to page | Goes to the given page in the browser |
|
|
20
|
+
| The current page should be | Assert that the given page is displayed in the browser |
|
|
21
|
+
|
|
22
|
+
PageObjectLibrary provides a PageObject class which should be used
|
|
23
|
+
as the base class for other page objects. By inheriting from this
|
|
24
|
+
class your keywords have access to the following pre-defined
|
|
25
|
+
attributes and methods:
|
|
26
|
+
|
|
27
|
+
| =Attribute/method= | =Description= |
|
|
28
|
+
| ``self.browser`` | A reference to the BrowserLibrary Reference |
|
|
29
|
+
| ``self.locator`` | A wrapper around the ``_locators`` dictionary |
|
|
30
|
+
| ``self.logger`` | A reference to the ``robot.api.logger`` instance |
|
|
31
|
+
|
|
32
|
+
= Using BrowserLibrary Keywords =
|
|
33
|
+
|
|
34
|
+
Within your keywords you have access to the full power of
|
|
35
|
+
BrowserLibrary. You can use ``self.browser`` to access the
|
|
36
|
+
library keywords. The following example shows how to call the
|
|
37
|
+
``Capture Page Screenshot`` keyword:
|
|
38
|
+
|
|
39
|
+
| self.browser.take_screenshot()
|
|
40
|
+
|
|
41
|
+
= Creating Page Object Classes =
|
|
42
|
+
|
|
43
|
+
Page objects should inherit from PageObjectLibrary.PageObject. At a minimum,
|
|
44
|
+
the class should define the following attributes:
|
|
45
|
+
|
|
46
|
+
| =Attribute= | =Description= |
|
|
47
|
+
| ``PAGE_URL`` | The path to the current page, without the \
|
|
48
|
+
hostname and port (eg: ``/dashboard.html``) |
|
|
49
|
+
| ``PAGE_TITLE`` | The web page title. This is used by the \
|
|
50
|
+
default implementation of ``_is_current_page``. |
|
|
51
|
+
|
|
52
|
+
When using the keywords `Go To Page` or `The Current Page Should Be`, the
|
|
53
|
+
PageObjectLibrary will call the method ``_is_current_page`` of the given page.
|
|
54
|
+
By default this will compare the current page title to the ``PAGE_TITLE`` attribute
|
|
55
|
+
of the page. If you are working on a site where the page titles are not unique,
|
|
56
|
+
you can override this method to do any type of logic you need.
|
|
57
|
+
|
|
58
|
+
= Page Objects are Normal Robot Libraries =
|
|
59
|
+
|
|
60
|
+
All rules that apply to keyword libraries applies to page objects. For
|
|
61
|
+
example, the libraries must be on ``PYTHONPATH``. You may also want to define
|
|
62
|
+
``ROBOT_LIBRARY_SCOPE``. Also, the filename and the classname must be identical (minus
|
|
63
|
+
the ``.py`` suffix on the file).
|
|
64
|
+
|
|
65
|
+
= Locators =
|
|
66
|
+
|
|
67
|
+
When writing multiple keywords for a page, you often use the same locators in
|
|
68
|
+
many places. PageObject allows you to define your locators in a dictionary,
|
|
69
|
+
but them use them with a more convenient dot notation.
|
|
70
|
+
|
|
71
|
+
To define locators, create a dictionary named ``_locators``. You can then access
|
|
72
|
+
the locators via dot notation within your keywords as ``self.locator.<name>``. The
|
|
73
|
+
``_locators`` dictionary may have nested dictionaries.
|
|
74
|
+
|
|
75
|
+
= Waiting for a Page to be Ready =
|
|
76
|
+
|
|
77
|
+
One difficulty with writing Selenium tests is knowing when a page has refreshed.
|
|
78
|
+
PageObject provides a context manager named ``_wait_for_page_refresh()`` which can
|
|
79
|
+
be used to wrap a command that should result in a page refresh. It will get a
|
|
80
|
+
reference to the DOM, run the body of the context manager, and then wait for the
|
|
81
|
+
DOM to change before returning.
|
|
82
|
+
|
|
83
|
+
= Example Page Object Definition =
|
|
84
|
+
|
|
85
|
+
| from PageObjectLibrary import PageObject
|
|
86
|
+
| from robot.libraries.BuiltIn import BuiltIn
|
|
87
|
+
|
|
|
88
|
+
| class LoginPage(PageObject):
|
|
89
|
+
| PAGE_TITLE = "Login - PageObjectLibrary Demo"
|
|
90
|
+
| PAGE_URL = "/"
|
|
91
|
+
|
|
|
92
|
+
| _locators = {
|
|
93
|
+
| "username": "id=id_username",
|
|
94
|
+
| "password": "id=id_password",
|
|
95
|
+
| "submit_button": "id=id_submit",
|
|
96
|
+
| }
|
|
97
|
+
|
|
|
98
|
+
| @keyword
|
|
99
|
+
| def enter_search(self, search):
|
|
100
|
+
| self.browser.type_text(self.locator.search_bar, search)
|
|
101
|
+
|
|
|
102
|
+
"""
|
|
103
|
+
|
|
104
|
+
ROBOT_LIBRARY_SCOPE = "TEST SUITE"
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
from urllib.parse import urlparse
|
|
2
|
+
|
|
3
|
+
import robot
|
|
4
|
+
from robot.libraries.BuiltIn import BuiltIn
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class BrowserPomKeywords:
|
|
8
|
+
"""
|
|
9
|
+
BrowserPOM Library's generic keywords
|
|
10
|
+
|
|
11
|
+
| =Keyword Name= |
|
|
12
|
+
| Go to page |
|
|
13
|
+
| The current page should be |
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
ROBOT_LIBRARY_SCOPE = "TEST SUITE"
|
|
17
|
+
|
|
18
|
+
def __init__(self):
|
|
19
|
+
self.builtin = BuiltIn()
|
|
20
|
+
self.logger = robot.api.logger
|
|
21
|
+
|
|
22
|
+
def the_current_page_should_be(self, page_name):
|
|
23
|
+
"""Fails if the name of the current page is not the given page name
|
|
24
|
+
|
|
25
|
+
``page_name`` is the name you would use to import the page.
|
|
26
|
+
|
|
27
|
+
This keyword will import the given page object, put it at the
|
|
28
|
+
front of the Robot library search order, then call the method
|
|
29
|
+
``_is_current_page`` on the library. The default
|
|
30
|
+
implementation of this method will compare the page title to
|
|
31
|
+
the ``PAGE_TITLE`` attribute of the page object, but this
|
|
32
|
+
implementation can be overridden by each page object.
|
|
33
|
+
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
page = self._get_page_object(page_name)
|
|
37
|
+
|
|
38
|
+
# This causes robot to automatically resolve keyword
|
|
39
|
+
# conflicts by looking in the current page first.
|
|
40
|
+
if page._is_current_page(): # pylint: disable=protected-access
|
|
41
|
+
# only way to get the current order is to set a
|
|
42
|
+
# new order. Once done, if there actually was an
|
|
43
|
+
# old order, preserve the old but make sure our
|
|
44
|
+
# page is at the front of the list
|
|
45
|
+
old_order = self.builtin.set_library_search_order()
|
|
46
|
+
new_order = ([str(page)],) + old_order
|
|
47
|
+
self.builtin.set_library_search_order(new_order)
|
|
48
|
+
return
|
|
49
|
+
|
|
50
|
+
# If we get here, we're not on the page we think we're on
|
|
51
|
+
raise AssertionError(f"Expected page to be {page_name} but it was not")
|
|
52
|
+
|
|
53
|
+
def go_to_page(self, page_name, page_root=None):
|
|
54
|
+
"""Go to the url for the given page object.
|
|
55
|
+
|
|
56
|
+
Unless explicitly provided, the URL root will be based on the
|
|
57
|
+
root of the current page. For example, if the current page is
|
|
58
|
+
http://www.example.com:8080 and the page object URL is
|
|
59
|
+
``/login``, the url will be http://www.example.com:8080/login
|
|
60
|
+
|
|
61
|
+
== Example ==
|
|
62
|
+
|
|
63
|
+
Given a page object named ``ExampleLoginPage`` with the URL
|
|
64
|
+
``/login``, and a browser open to ``http://www.example.com``, the
|
|
65
|
+
following statement will go to ``http://www.example.com/login``,
|
|
66
|
+
and place ``ExampleLoginPage`` at the front of Robot's library
|
|
67
|
+
search order.
|
|
68
|
+
|
|
69
|
+
| Go to Page ExampleLoginPage
|
|
70
|
+
|
|
71
|
+
The effect is the same as if you had called the following three
|
|
72
|
+
keywords:
|
|
73
|
+
|
|
74
|
+
| SeleniumLibrary.Go To http://www.example.com/login
|
|
75
|
+
| Import Library ExampleLoginPage
|
|
76
|
+
| Set Library Search Order ExampleLoginPage
|
|
77
|
+
|
|
78
|
+
Tags: selenium, page-object
|
|
79
|
+
|
|
80
|
+
"""
|
|
81
|
+
|
|
82
|
+
page = self._get_page_object(page_name)
|
|
83
|
+
|
|
84
|
+
url = page_root if page_root is not None else page.browser.get_url()
|
|
85
|
+
(scheme, netloc, _, _, _, _) = urlparse(url)
|
|
86
|
+
url = f"{scheme}://{netloc}{page.PAGE_URL}"
|
|
87
|
+
|
|
88
|
+
page.browser.go_to(url)
|
|
89
|
+
|
|
90
|
+
def _get_page_object(self, page_name):
|
|
91
|
+
"""Import the page object if necessary, then return the handle to the library
|
|
92
|
+
|
|
93
|
+
Note: If the page object has already been imported, it won't be imported again.
|
|
94
|
+
"""
|
|
95
|
+
|
|
96
|
+
try:
|
|
97
|
+
page = self.builtin.get_library_instance(page_name)
|
|
98
|
+
except RuntimeError:
|
|
99
|
+
self.builtin.import_library(page_name)
|
|
100
|
+
page = self.builtin.get_library_instance(page_name)
|
|
101
|
+
|
|
102
|
+
return page
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# type: ignore
|
|
2
|
+
from __future__ import absolute_import, unicode_literals
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class LocatorMap(dict):
|
|
6
|
+
"""LocatorMap - a dict-like object that supports dot notation
|
|
7
|
+
|
|
8
|
+
This is used to map self._locators to a self.locator attribute,
|
|
9
|
+
to make dealing with locators a bit more pleasant.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
def __init__(self, args):
|
|
13
|
+
super().__init__() # Call to the parent class' __init__ if applicable
|
|
14
|
+
|
|
15
|
+
if isinstance(args, dict):
|
|
16
|
+
for key, value in args.items():
|
|
17
|
+
# Validate key
|
|
18
|
+
if " " in key or "." in key:
|
|
19
|
+
raise KeyError("Keys cannot have spaces or periods in them")
|
|
20
|
+
|
|
21
|
+
# Assign value or recursively instantiate LocatorMap
|
|
22
|
+
if not isinstance(value, dict):
|
|
23
|
+
self[key] = value
|
|
24
|
+
else:
|
|
25
|
+
self.__setattr__(key, LocatorMap(value))
|
|
26
|
+
|
|
27
|
+
def __getattr__(self, attr):
|
|
28
|
+
return self.get(attr)
|
|
29
|
+
|
|
30
|
+
def __setattr__(self, key, value):
|
|
31
|
+
self.__setitem__(key, value)
|
|
32
|
+
|
|
33
|
+
def __setitem__(self, key, value):
|
|
34
|
+
super().__setitem__(key, value)
|
|
35
|
+
self.__dict__.update({key: value})
|
|
36
|
+
|
|
37
|
+
def __delattr__(self, item):
|
|
38
|
+
self.__delitem__(item)
|
|
39
|
+
|
|
40
|
+
def __delitem__(self, key):
|
|
41
|
+
super().__delitem__(key)
|
|
42
|
+
del self.__dict__[key]
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
from __future__ import absolute_import, unicode_literals
|
|
2
|
+
|
|
3
|
+
from abc import ABCMeta
|
|
4
|
+
|
|
5
|
+
import robot.api
|
|
6
|
+
from Browser import Browser
|
|
7
|
+
from robot.libraries.BuiltIn import BuiltIn
|
|
8
|
+
|
|
9
|
+
from .locatormap import LocatorMap # type: ignore[attr-defined]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class PageObject(metaclass=ABCMeta):
|
|
13
|
+
"""Base class for page objects
|
|
14
|
+
|
|
15
|
+
Classes that inherit from this class need to define the
|
|
16
|
+
following class variables:
|
|
17
|
+
|
|
18
|
+
PAGE_TITLE the title of the page; used by the default
|
|
19
|
+
implementation of _is_current_page
|
|
20
|
+
PAGE_URL this should be the URL of the page, minus
|
|
21
|
+
the hostname and port (eg: /loginpage.html)
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
PAGE_URL: str = ""
|
|
25
|
+
PAGE_TITLE: str = ""
|
|
26
|
+
|
|
27
|
+
def __init__(self):
|
|
28
|
+
self.logger = robot.api.logger
|
|
29
|
+
self.locator = LocatorMap(getattr(self, "_locators", {}))
|
|
30
|
+
self.builtin = BuiltIn()
|
|
31
|
+
|
|
32
|
+
@property
|
|
33
|
+
def browser(self) -> Browser:
|
|
34
|
+
"""
|
|
35
|
+
Returns the browser instance from robotframework-browser library
|
|
36
|
+
Browser library has to be imported in robot file to reference
|
|
37
|
+
"""
|
|
38
|
+
return self.builtin.get_library_instance("Browser")
|
|
39
|
+
|
|
40
|
+
def __str__(self):
|
|
41
|
+
return self.__class__.__name__
|
|
42
|
+
|
|
43
|
+
def get_page_name(self):
|
|
44
|
+
"""Return the name of the current page"""
|
|
45
|
+
return self.__class__.__name__
|
|
46
|
+
|
|
47
|
+
def _is_current_page(self):
|
|
48
|
+
"""Determine if this page object represents the current page.
|
|
49
|
+
|
|
50
|
+
This works by comparing the current page title to the class
|
|
51
|
+
variable PAGE_TITLE.
|
|
52
|
+
|
|
53
|
+
Unless their page titles are unique, page objects should
|
|
54
|
+
override this function. For example, a common solution is to
|
|
55
|
+
look at the url of the current page, or to look for a specific
|
|
56
|
+
heading or element on the page.
|
|
57
|
+
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
actual_title = self.browser.get_title()
|
|
61
|
+
expected_title = self.PAGE_TITLE
|
|
62
|
+
|
|
63
|
+
if actual_title.lower() == expected_title.lower():
|
|
64
|
+
return True
|
|
65
|
+
|
|
66
|
+
self.logger.info(f"expected title: '{expected_title}'")
|
|
67
|
+
self.logger.info(f" actual title: '{actual_title}'")
|
|
68
|
+
return False
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "{}"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright {yyyy} {name of copyright owner}
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: robotframework-browserpom
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: robotframework-browser library extension to create Page Objects
|
|
5
|
+
Author: Hasan Alp Zengin
|
|
6
|
+
Author-email: hasanalpzengin@gmail.com
|
|
7
|
+
Requires-Python: >=3.12,<4.0
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
11
|
+
Requires-Dist: robotframework (>=7.1.0,<8.0.0)
|
|
12
|
+
Requires-Dist: robotframework-browser (>=18.0.0,<19.0.0)
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
[tool.poetry]
|
|
2
|
+
name = "robotframework-browserpom"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "robotframework-browser library extension to create Page Objects"
|
|
5
|
+
authors = ["Hasan Alp Zengin <hasanalpzengin@gmail.com>"]
|
|
6
|
+
packages = [{ include = "BrowserPOM" }]
|
|
7
|
+
|
|
8
|
+
[tool.poetry.dependencies]
|
|
9
|
+
python = "^3.12"
|
|
10
|
+
robotframework = "^7.1.0"
|
|
11
|
+
robotframework-browser = "^18.0.0"
|
|
12
|
+
|
|
13
|
+
[tool.poetry.dev-dependencies]
|
|
14
|
+
pytest_robotframework = "^4.3.0"
|
|
15
|
+
black = "^24.0.0"
|
|
16
|
+
isort = "^5.13.0"
|
|
17
|
+
flake8 = "^7.0.0"
|
|
18
|
+
mypy = "^1.13.0"
|
|
19
|
+
pylint = "^3.3.0"
|
|
20
|
+
coverage = "^7.6.0"
|
|
21
|
+
flake8-pyproject = "1.2.3"
|
|
22
|
+
|
|
23
|
+
[build-system]
|
|
24
|
+
requires = ["poetry-core"]
|
|
25
|
+
build-backend = "poetry.core.masonry.api"
|
|
26
|
+
|
|
27
|
+
[tool.black]
|
|
28
|
+
line-length = 88
|
|
29
|
+
target-version = ['py312']
|
|
30
|
+
skip-string-normalization = false
|
|
31
|
+
|
|
32
|
+
[tool.isort]
|
|
33
|
+
profile = "black"
|
|
34
|
+
line_length = 100
|
|
35
|
+
include_trailing_comma = true
|
|
36
|
+
|
|
37
|
+
[tool.flake8]
|
|
38
|
+
max-line-length = 100
|
|
39
|
+
extend-ignore = ["E203", "W503", "F401"]
|
|
40
|
+
exclude = [
|
|
41
|
+
".git",
|
|
42
|
+
"__pycache__",
|
|
43
|
+
"build",
|
|
44
|
+
"dist",
|
|
45
|
+
".venv",
|
|
46
|
+
"env"
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
[tool.mypy]
|
|
50
|
+
python_version = 3.12
|
|
51
|
+
check_untyped_defs = false
|
|
52
|
+
ignore_missing_imports = true
|
|
53
|
+
|
|
54
|
+
[tool.pylint]
|
|
55
|
+
max-line-length = 100
|
|
56
|
+
disable = [
|
|
57
|
+
"C0103",
|
|
58
|
+
"C0114"
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
[tool.coverage.run]
|
|
62
|
+
branch = true
|
|
63
|
+
omit = [
|
|
64
|
+
"tests/*",
|
|
65
|
+
"setup.py",
|
|
66
|
+
"*/__init__.py"
|
|
67
|
+
]
|
|
68
|
+
|
|
69
|
+
[tool.coverage.report]
|
|
70
|
+
show_missing = true
|
|
71
|
+
skip_covered = true
|
|
72
|
+
|
|
73
|
+
[tool.pytest.ini_options]
|
|
74
|
+
pythonpath = "."
|