robotframework-apex 0.0.0__py3-none-any.whl

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.
@@ -0,0 +1,25 @@
1
+ import typer
2
+ from typing import Annotated
3
+ import yaml
4
+ from rich import print
5
+ from pathlib import Path
6
+
7
+ #from BrowserApex.cli.utils import get_template
8
+ from BrowserApex.cli.main import app
9
+ from BrowserApex.cli.apex.grammar import parse_apex_file
10
+
11
+ @app.command(name='parse')
12
+ def project_parse(
13
+ pagefile: Annotated[str, typer.Argument(help="The filename of exported page (yaml, apx)")]
14
+ ):
15
+ """
16
+ Parse file and dump ast.
17
+
18
+ """
19
+ page = None
20
+
21
+ fn = Path(pagefile)
22
+ if fn.suffix == '.apx':
23
+ page = parse_apex_file(fn)
24
+
25
+ print(page)
@@ -0,0 +1,63 @@
1
+ import typer
2
+ from rich import print
3
+ from typing import Annotated
4
+ from rich.table import Table
5
+ from pathlib import Path
6
+
7
+ from BrowserApex.cli.main import app
8
+ from BrowserApex.cli.apex import parse_yaml_file, parse_apex_file
9
+
10
+ @app.command(name='show')
11
+ def project_show(
12
+ pagefile: Annotated[str, typer.Argument(help="The filename of exported page (yaml)")]
13
+ ):
14
+ """
15
+ Show project.
16
+
17
+ """
18
+ data = None
19
+ fn = Path(pagefile)
20
+ match fn.suffix:
21
+ case '.apx':
22
+ page = parse_apex_file(fn)
23
+ case '.yaml' | '.yml':
24
+ page = parse_yaml_file(fn)
25
+ case _:
26
+ raise RuntimeWarning("Unsupported file")
27
+
28
+ print("Page:")
29
+ print(f"id: {page.component_id}")
30
+ print(f"name: {page.name}")
31
+ print(f"alias: {page.alias}")
32
+
33
+
34
+ table = Table(title='Regions')
35
+ table.add_column("Component ID")
36
+ table.add_column("Name")
37
+ table.add_column("Type")
38
+ table.add_column("Template")
39
+ table.add_column("Parent")
40
+
41
+ for region in page.regions:
42
+ table.add_row(str(region.component_id), region.name, region.type, region.appearance['template'],region.layout['parentRegion'])
43
+
44
+ print(table)
45
+
46
+ table = Table(title='Page items')
47
+ table.add_column("Seq.")
48
+ table.add_column("Name")
49
+ table.add_column("Type")
50
+ table.add_column("Label")
51
+ table.add_column("Region")
52
+ for pageitem in page.page_items:
53
+ table.add_row( str(pageitem.layout['sequence']), pageitem.name, pageitem.type, pageitem.label.get('label', '[red]?[/red]'), pageitem.layout['region'] )
54
+ print(table)
55
+
56
+ table = Table(title='Buttons')
57
+ table.add_column("Seq.")
58
+ table.add_column("Name")
59
+ table.add_column("Label")
60
+ table.add_column("Region")
61
+ for button in page.buttons:
62
+ table.add_row(str(button.layout['sequence']), button['buttonName'], button['label'], button.layout['region'])
63
+ print(table)
@@ -0,0 +1,24 @@
1
+ import typer
2
+ from dotenv import load_dotenv
3
+ from BrowserApex import __VERSION__
4
+
5
+ load_dotenv()
6
+
7
+ app = typer.Typer(
8
+ help=f"""CLI for supporting development of Page Object Models.
9
+
10
+ Page exported as readable format (yaml) is used as source for generating POM resources for RobotFramework.
11
+
12
+ Version: {__VERSION__}
13
+ """,
14
+ add_completion=True)
15
+
16
+ from BrowserApex.cli import commands
17
+
18
+
19
+ def main(): # pragma: no cover
20
+ app()
21
+
22
+
23
+ if __name__ == '__main__': # pragma: no cover
24
+ main()
@@ -0,0 +1 @@
1
+ Resource ../master.resource
@@ -0,0 +1 @@
1
+ # TODO: KEYWORDS
@@ -0,0 +1,12 @@
1
+ *** Settings ***
2
+ ### PAGEGEN:BEGIN:SETTINGS ------------------------------------------
3
+ ### PAGEGEN:END:SETTINGS --------------------------------------------
4
+ {% include "custom-settings.template" %}
5
+
6
+ *** Variables ***
7
+ ### PAGEGEN:BEGIN:VARIABLES -----------------------------------------
8
+ ### PAGEGEN:END:VARIABLES -------------------------------------------
9
+
10
+ *** Keywords ***
11
+ ### PAGEGEN:BEGIN:KEYWORDS ------------------------------------------
12
+ ### PAGEGEN:END:KEYWORDS --------------------------------------------
@@ -0,0 +1,3 @@
1
+ *** Settings ***
2
+ ### PAGEGEN:BEGIN:RESOURCES -----------------------------------------
3
+ ### PAGEGEN:END:RESOURCES -------------------------------------------
@@ -0,0 +1,3 @@
1
+ [output]
2
+ folder = "pageobjects"
3
+ mainresource = "pageobjects.resource"
@@ -0,0 +1,2 @@
1
+ # TODO: SETTINGS
2
+ # BLA
@@ -0,0 +1,9 @@
1
+ {% for block in blocks.values() %}
2
+ {%- if block.fields %}
3
+ &{{ '{' }}{{page.component_id}}_{{ block.name | upper | replace(" ","_") }}_FIELDS{{ '}' }}
4
+ {%- for label, name, type in block.fields %}
5
+ ... {{ label }}={{ name }}:{{ type | replace(" ","") }}
6
+ {%- endfor -%}
7
+ {%- endif -%}
8
+
9
+ {% endfor %}
@@ -0,0 +1,41 @@
1
+ from pathlib import Path
2
+ import tomllib
3
+ from jinja2 import FileSystemLoader, Environment, ChoiceLoader, PackageLoader, TemplateNotFound, TemplateSyntaxError
4
+
5
+ def get_config_path():
6
+ path = Path().cwd()
7
+ root = path.drive + path.root
8
+ while str(path) != str(root):
9
+ if (path / "rfapex.toml").exists():
10
+ return path
11
+ path = path.parent
12
+
13
+ return None
14
+
15
+ def get_config(path=None):
16
+ if path is None:
17
+ path = get_config_path()
18
+
19
+ with open(path / "rfapex.toml", "rb") as f:
20
+ cnf = tomllib.load(f)
21
+ return cnf
22
+
23
+
24
+ def get_template(template_name, template_path: Path):
25
+ default_loader = ChoiceLoader(
26
+ [FileSystemLoader(template_path / "templates"), PackageLoader(__package__, "templates")]
27
+ )
28
+ env = Environment(loader=default_loader)
29
+ if not template_name.endswith(".template") and not template_name.endswith(".sample"):
30
+ template_name += ".template"
31
+ try:
32
+ template = env.get_template(template_name)
33
+ return template
34
+ except TemplateNotFound:
35
+ print("Template not found")
36
+ return None
37
+
38
+ except TemplateSyntaxError:
39
+ print("Template has syntax error")
40
+ return None
41
+
File without changes
File without changes
BrowserApex/version.py ADDED
@@ -0,0 +1 @@
1
+ __VERSION__ = "0.0.0"
@@ -0,0 +1,36 @@
1
+ Metadata-Version: 2.4
2
+ Name: robotframework-apex
3
+ Version: 0.0.0
4
+ Summary: Robot Framework Browser extension library supporting Oracle APEX application using Page Object Model.
5
+ Author: Maurice Koster
6
+ Author-email: Maurice Koster <maurice@mauricekoster.com>
7
+ License-Expression: MIT
8
+ License-File: LICENSE
9
+ Classifier: Development Status :: 5 - Production/Stable
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Topic :: Software Development :: Testing
13
+ Classifier: Framework :: Robot Framework
14
+ Classifier: Framework :: Robot Framework :: Library
15
+ Requires-Dist: robotframework>=7.1.1,<9.0.0
16
+ Requires-Dist: robotframework-browser>=20.0.0,<21.0.0
17
+ Requires-Dist: pyyaml>=6.0.3
18
+ Requires-Dist: rich>=15.0.0
19
+ Requires-Dist: typer>=0.26.8
20
+ Requires-Dist: jinja2>=3.1.6
21
+ Requires-Dist: python-dotenv
22
+ Requires-Dist: parsimonious>=0.11.0
23
+ Requires-Python: >=3.10
24
+ Description-Content-Type: text/markdown
25
+
26
+ # robotframework-apex
27
+ Supporting library to control Oracle APEX applications usin Page Object Model
28
+
29
+
30
+ ## Apex library
31
+
32
+ Depends on Browser library `robotframework-browser`
33
+
34
+
35
+ ## rfapex command line tool
36
+
@@ -0,0 +1,32 @@
1
+ BrowserApex/__init__.py,sha256=ms01r5JoP5KWfz-06h54xB8S93OWSVcdlPVo8MUFN-U,66
2
+ BrowserApex/browser.py,sha256=2xtLPj7hlDu47mtCP-pMNqhY3IStchR0np_qD4gTdYk,23374
3
+ BrowserApex/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ BrowserApex/cli/apex/__init__.py,sha256=7qiVg8824UUgxnxU8AGeu90rXD1AgMBs6QkEpjA34jY,96
5
+ BrowserApex/cli/apex/apexlang-26.1.peg,sha256=MkaV5oPG6q5nHnbgH61Q4MQhResTTqtAexi7UaK9CBA,26825
6
+ BrowserApex/cli/apex/ebnf/apexlang-26.1.ebnf,sha256=EvQGd6cohMQR8xFXpOFsb-N3deOkBVR-r5B3IciYjpk,1140535
7
+ BrowserApex/cli/apex/grammar.py,sha256=fwM99X0kQ0AANXxOsTscdqjLVK904jw-2Y_iNXQYXvw,31320
8
+ BrowserApex/cli/apex/objects.py,sha256=Lj1g7GnlYt6Upz5q4uoGaKRFyMJeqPHfioKpIUn0cAI,7224
9
+ BrowserApex/cli/apex/reader.py,sha256=Hpr2tsEdq0DpZTESGpw7ZcVc1acfHSOwOdImizh7BBI,4667
10
+ BrowserApex/cli/commands/__init__.py,sha256=XMQnuYkSGP06V-5DrJhsb_ENh4FHIAkLV7axJPl-kOI,101
11
+ BrowserApex/cli/commands/config.py,sha256=7FAOdc91Ahv0jF8sCY8a-rPD0IT7ztgmykPo34nNei8,359
12
+ BrowserApex/cli/commands/dump.py,sha256=XzqlM73kxTSX8CXFt8Y1hvrzUh51mUmcfdrP-W-222E,474
13
+ BrowserApex/cli/commands/generate.py,sha256=n-6yxHqiK8xle35w3q8OSlNjuz7X5IzPoIBFuPEuxKg,5412
14
+ BrowserApex/cli/commands/parse.py,sha256=he_wkNSRCqDC2kvHQlBP9DKIoy588AICPgzNWVaoNK0,560
15
+ BrowserApex/cli/commands/show.py,sha256=36rDmm0V0Dofe17dMdr1Wvso-_KgUxAE35RyRVLkwjE,1893
16
+ BrowserApex/cli/main.py,sha256=GWeI_xABHHuSmo8HL8UeesdTg6NDYWtFaV0GzDIbR84,504
17
+ BrowserApex/cli/templates/custom-settings.template,sha256=9y6iQSmTZob4JR5hjJyufBtLTWY25t6UQWD_Q3dJGXY,29
18
+ BrowserApex/cli/templates/keywords.template,sha256=-aJX1C42yk-SlweL_WJriK0X5ypMWczTowxbcAoW8Ts,16
19
+ BrowserApex/cli/templates/pageobject.template,sha256=b8Sf0Hv6P1Ny24_5xCZEHKk_SznLtT-DWkI9q8AOolg,514
20
+ BrowserApex/cli/templates/pageobjects-resource.template,sha256=DjNaeF329R5fJqnJp49qHQGCriKegFLTtIWtfvKwvf0,156
21
+ BrowserApex/cli/templates/rfapex.toml.template,sha256=qR1c0CQERPCbc2-0lCvd2HUiYBXkoA_BSdqgvSHsgnY,69
22
+ BrowserApex/cli/templates/settings.template,sha256=IirGAjTlX5U-ETmZJM8D8C18Lug2nSIUN4709Rk-TtE,22
23
+ BrowserApex/cli/templates/variables.template,sha256=raSvBqKz2KEzvRn0_P1W5CskK62HOf7Ya1xLIU8ees0,296
24
+ BrowserApex/cli/utils.py,sha256=fKoj8ballm8b1EU2EHshh5fUaR3OFg3UaHf9xzPCdcQ,1196
25
+ BrowserApex/keywords/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
+ BrowserApex/keywords/commands.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
+ BrowserApex/version.py,sha256=CLZHscZt3iUUkjyvg0pLZr6X8pfFpnXM7naghJiVoKA,21
28
+ robotframework_apex-0.0.0.dist-info/licenses/LICENSE,sha256=QnzXbUcFpJo0hQP9aj6LLOqS9DYefOZiLzzqxfswT44,1071
29
+ robotframework_apex-0.0.0.dist-info/WHEEL,sha256=ZFFp7t7R4RYQ5KYZkmiFWoQvHay7SrTmn-6ZYfoFZ3U,80
30
+ robotframework_apex-0.0.0.dist-info/entry_points.txt,sha256=n-EIvIpt-3cuBPp3Jv_0iLWaFVqQseEBYHeDZ-dpMWk,55
31
+ robotframework_apex-0.0.0.dist-info/METADATA,sha256=Q-RvWl0elE9Ji2GI3O7xA1uWr69Vzl5pcoJ0DIQYqWY,1142
32
+ robotframework_apex-0.0.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: uv 0.12.7
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ apexcli = BrowserApex.cli.main:main
3
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Maurice Koster
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.