robotframework-browser-tray 1.4.0__tar.gz → 1.5.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: robotframework-browser-tray
3
- Version: 1.4.0
3
+ Version: 1.5.0
4
4
  Summary: Tray icon and REPL for trying out Browser Library keywords using Chromium or Edge
5
5
  Author-email: Marduk Bolaños <marduk.bolanos@imbus.de>
6
6
  Requires-Python: >=3.8.2
@@ -64,26 +64,16 @@ To start it execute:
64
64
  ibrowser
65
65
  ```
66
66
 
67
- On start up it checks whether the Chromium installed by `rfbrowser init chromium` is present. It can also be used with Microsoft Edge. See the section below for instructions.
68
-
69
- In addition to the selectors supported by Browser Library, `ibrowser` adds the selector `role` for selecting elements using their ARIA role.
70
-
71
- The role of an element can be easily obtained from the Accessibility Tree. To open the tree follow these steps:
72
-
73
- 1. Press F12 to open the DevTools
74
- 2. Select the Elements tab
75
- 3. In the right panel click on the Accessibility tab
76
- 4. In the section "Accessibility Tree" check "Enable full-page accessibility tree"
77
- 5. Click the button "Reload DevTools"
78
- 6. In the left panel click on the person icon to toggle the Accessibility Tree view
67
+ On start up it connects to a running Chromium (started using the tray icon) or Microsoft Edge (see below for instructions).
79
68
 
69
+ If you start a new browser while ibrowser is running, call the keyword "Connect" to connect ibrowser to it.
80
70
 
81
71
  ### Usage in a Robot Framework Test Suite
82
72
 
83
73
  Add these lines to the Settings section of the .robot file:
84
74
 
85
75
  ```robotframework
86
- Library Browser playwright_process_port=55555
76
+ Library Browser playwright_process_port=4711
87
77
  Test Setup Connect To Browser http://localhost:1234 chromium use_cdp=True
88
78
  ```
89
79
 
@@ -113,7 +103,7 @@ If Microsoft Edge is installed on your machine:
113
103
 
114
104
  On start up `browser-tray` checks whether `rfbrowser init` has been executed.
115
105
 
116
- If this requirement is met the Playwright wrapper is started with `node site-packages/Browser/wrapper/index.js 55555`.
106
+ If this requirement is met the Playwright wrapper is started with `node site-packages/Browser/wrapper/index.js 4711`.
117
107
 
118
108
  Selecting "Open Chromium" in the tray icon executes `site-packages/Browser/wrapper/node_modules/playwright-core/.local-browsers/chromium-XX/chrome-win/chrome.exe --remote-debugging-port=1234 --test-type`.
119
109
 
@@ -52,26 +52,16 @@ To start it execute:
52
52
  ibrowser
53
53
  ```
54
54
 
55
- On start up it checks whether the Chromium installed by `rfbrowser init chromium` is present. It can also be used with Microsoft Edge. See the section below for instructions.
56
-
57
- In addition to the selectors supported by Browser Library, `ibrowser` adds the selector `role` for selecting elements using their ARIA role.
58
-
59
- The role of an element can be easily obtained from the Accessibility Tree. To open the tree follow these steps:
60
-
61
- 1. Press F12 to open the DevTools
62
- 2. Select the Elements tab
63
- 3. In the right panel click on the Accessibility tab
64
- 4. In the section "Accessibility Tree" check "Enable full-page accessibility tree"
65
- 5. Click the button "Reload DevTools"
66
- 6. In the left panel click on the person icon to toggle the Accessibility Tree view
55
+ On start up it connects to a running Chromium (started using the tray icon) or Microsoft Edge (see below for instructions).
67
56
 
57
+ If you start a new browser while ibrowser is running, call the keyword "Connect" to connect ibrowser to it.
68
58
 
69
59
  ### Usage in a Robot Framework Test Suite
70
60
 
71
61
  Add these lines to the Settings section of the .robot file:
72
62
 
73
63
  ```robotframework
74
- Library Browser playwright_process_port=55555
64
+ Library Browser playwright_process_port=4711
75
65
  Test Setup Connect To Browser http://localhost:1234 chromium use_cdp=True
76
66
  ```
77
67
 
@@ -101,7 +91,7 @@ If Microsoft Edge is installed on your machine:
101
91
 
102
92
  On start up `browser-tray` checks whether `rfbrowser init` has been executed.
103
93
 
104
- If this requirement is met the Playwright wrapper is started with `node site-packages/Browser/wrapper/index.js 55555`.
94
+ If this requirement is met the Playwright wrapper is started with `node site-packages/Browser/wrapper/index.js 4711`.
105
95
 
106
96
  Selecting "Open Chromium" in the tray icon executes `site-packages/Browser/wrapper/node_modules/playwright-core/.local-browsers/chromium-XX/chrome-win/chrome.exe --remote-debugging-port=1234 --test-type`.
107
97
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "robotframework-browser-tray"
3
- version = "1.4.0"
3
+ version = "1.5.0"
4
4
  description = "Tray icon and REPL for trying out Browser Library keywords using Chromium or Edge"
5
5
  authors = [
6
6
  {name = "Marduk Bolaños", email = "marduk.bolanos@imbus.de"},
@@ -1,13 +1,13 @@
1
- import pathlib
2
-
3
1
  from RobotDebug.RobotDebug import RobotDebug
4
2
  from robot.libraries.BuiltIn import BuiltIn
5
3
 
6
4
 
7
5
  class Repl(RobotDebug):
8
- def __init__(self, jsextension=None, **kwargs):
6
+ def __init__(self, **kwargs):
9
7
  super().__init__(**kwargs)
10
8
 
11
- jsextension = str(pathlib.Path(__file__).parent.resolve() / jsextension).replace('\\', '\\\\')
12
- self.Library("Browser", "enable_presenter_mode=True", "playwright_process_port=55555", f"jsextension={jsextension}") #
9
+ self.Library("Browser", "enable_presenter_mode=True", "playwright_process_port=4711")
10
+ self.connect()
11
+
12
+ def connect(self):
13
13
  BuiltIn().run_keyword("Connect To Browser", "http://localhost:1234", "chromium", "use_cdp=True")
@@ -8,7 +8,7 @@ from robot import run_cli
8
8
 
9
9
  TEST_SUITE = b"""
10
10
  *** Settings ***
11
- Library BrowserTray.Repl jsextension=jsextension.js repl=${True}
11
+ Library BrowserTray.Repl repl=${True}
12
12
 
13
13
  *** Test Cases ***
14
14
  Robot Framework Debug REPL
@@ -113,7 +113,7 @@ def is_running(cmd: str) -> bool:
113
113
  def get_ports() -> tuple[int, int]:
114
114
  MAX_PORT = 2**16
115
115
  REMOTE_DEBUGGING_PORT = 1234
116
- PLAYWRIGHT_PROCESS_PORT= 55555
116
+ PLAYWRIGHT_PROCESS_PORT= 4711
117
117
 
118
118
  arg_parser = argparse.ArgumentParser(add_help=True)
119
119
  arg_parser.add_argument("--pw-port", default=PLAYWRIGHT_PROCESS_PORT, type=int, help=f"Playwright process port (default: {PLAYWRIGHT_PROCESS_PORT})")
@@ -1,18 +0,0 @@
1
- async function registerMySelector(playwright) {
2
- playwright.selectors.register("role", () => ({
3
- // Returns the first element matching given selector in the root's subtree.
4
- query(root, selector) {
5
- return root.querySelector([role="${selector}"]);
6
- },
7
-
8
- // Returns all elements matching given selector in the root's subtree.
9
- queryAll(root, selector) {
10
- return Array.from(root.querySelectorAll([role="${selector}"]));
11
- }
12
- }));
13
-
14
- return 1;
15
- }
16
-
17
- exports.__esModule = true;
18
- exports.registerMySelector = registerMySelector;