simplex 1.1.0__py3-none-any.whl → 1.2.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.
Potentially problematic release.
This version of simplex might be problematic. Click here for more details.
- simplex/simplex.py +6 -6
- {simplex-1.1.0.dist-info → simplex-1.2.0.dist-info}/METADATA +1 -1
- simplex-1.2.0.dist-info/RECORD +10 -0
- simplex-1.1.0.dist-info/RECORD +0 -10
- {simplex-1.1.0.dist-info → simplex-1.2.0.dist-info}/LICENSE +0 -0
- {simplex-1.1.0.dist-info → simplex-1.2.0.dist-info}/WHEEL +0 -0
- {simplex-1.1.0.dist-info → simplex-1.2.0.dist-info}/entry_points.txt +0 -0
- {simplex-1.1.0.dist-info → simplex-1.2.0.dist-info}/top_level.txt +0 -0
simplex/simplex.py
CHANGED
|
@@ -29,7 +29,7 @@ class Simplex:
|
|
|
29
29
|
|
|
30
30
|
self.driver = self.browser.new_page(viewport={"width": 1280, "height": 720})
|
|
31
31
|
|
|
32
|
-
def find_element(self, element_description: str, state: Image.Image | None = None, annotate: bool =
|
|
32
|
+
def find_element(self, element_description: str, state: Image.Image | None = None, annotate: bool = True) -> List[int]:
|
|
33
33
|
"""
|
|
34
34
|
Find an element in the screenshot using the element description
|
|
35
35
|
|
|
@@ -153,7 +153,7 @@ class Simplex:
|
|
|
153
153
|
"""
|
|
154
154
|
self.driver.goto(url)
|
|
155
155
|
|
|
156
|
-
def execute_action(self, action: List[List[str]], state: Image.Image | None = None, annotate: bool =
|
|
156
|
+
def execute_action(self, action: List[List[str]], state: Image.Image | None = None, annotate: bool = True) -> None:
|
|
157
157
|
"""
|
|
158
158
|
Execute an action with playwright driver
|
|
159
159
|
|
|
@@ -166,12 +166,12 @@ class Simplex:
|
|
|
166
166
|
|
|
167
167
|
try:
|
|
168
168
|
if action_type == "CLICK":
|
|
169
|
-
bbox = self.find_element(description, state, annotate)
|
|
169
|
+
bbox = self.find_element(description, state, annotate=annotate)
|
|
170
170
|
center_x, center_y = center_bbox(bbox)
|
|
171
171
|
self.driver.mouse.click(center_x, center_y)
|
|
172
172
|
|
|
173
173
|
elif action_type == "HOVER":
|
|
174
|
-
bbox = self.find_element(description, state, annotate)
|
|
174
|
+
bbox = self.find_element(description, state, annotate=annotate)
|
|
175
175
|
center_x, center_y = center_bbox(bbox)
|
|
176
176
|
self.driver.mouse.move(center_x, center_y)
|
|
177
177
|
|
|
@@ -188,14 +188,14 @@ class Simplex:
|
|
|
188
188
|
print(f"Error executing action: {e}")
|
|
189
189
|
return None
|
|
190
190
|
|
|
191
|
-
def do(self, step_description: str, annotate: bool =
|
|
191
|
+
def do(self, step_description: str, annotate: bool = True) -> None:
|
|
192
192
|
"""
|
|
193
193
|
Execute a step description
|
|
194
194
|
"""
|
|
195
195
|
state = self.take_stable_screenshot()
|
|
196
196
|
actions = self.step_to_action(step_description, state)
|
|
197
197
|
for action in actions:
|
|
198
|
-
self.execute_action(action, annotate)
|
|
198
|
+
self.execute_action(action, annotate=annotate)
|
|
199
199
|
|
|
200
200
|
def take_stable_screenshot(self) -> Image.Image:
|
|
201
201
|
"""
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
simplex/__init__.py,sha256=1mbM4XUk0FNW161WOkM4ayC1s_QSsaBEls6PZ0iBScY,74
|
|
2
|
+
simplex/constants.py,sha256=nIXF2oVNNNknXweXAlmE-KBM9QjJtYw9osXVYjvloN0,59
|
|
3
|
+
simplex/simplex.py,sha256=ZdsdhapVsj9CfsjXO2_etKQOK7KYP1qSREf9A4xQ4fc,7575
|
|
4
|
+
simplex/utils.py,sha256=UrD4Ena3yk0POmxxyiqMszzPbTscTCJpMP4xZFDAuOc,339
|
|
5
|
+
simplex-1.2.0.dist-info/LICENSE,sha256=Xh0SJjYZfNI71pCNMB40aKlBLLuOB0blx5xkTtufFNQ,1075
|
|
6
|
+
simplex-1.2.0.dist-info/METADATA,sha256=ZvRVsPpmWNnb1UAb5TED4Rs3S512lyKDXzapjQ6OyyI,1114
|
|
7
|
+
simplex-1.2.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
8
|
+
simplex-1.2.0.dist-info/entry_points.txt,sha256=3veL2w3c5vxb3dm8I_M8Fs-370n1ZnvD8uu1nSsL7z8,45
|
|
9
|
+
simplex-1.2.0.dist-info/top_level.txt,sha256=cbMH1bYpN0A3gP-ecibPRHasHoqB-01T_2BUFS8p0CE,8
|
|
10
|
+
simplex-1.2.0.dist-info/RECORD,,
|
simplex-1.1.0.dist-info/RECORD
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
simplex/__init__.py,sha256=1mbM4XUk0FNW161WOkM4ayC1s_QSsaBEls6PZ0iBScY,74
|
|
2
|
-
simplex/constants.py,sha256=nIXF2oVNNNknXweXAlmE-KBM9QjJtYw9osXVYjvloN0,59
|
|
3
|
-
simplex/simplex.py,sha256=27knVLuna8Aab_7km_40v6SDTLfMO8jl8d-qWR21amA,7551
|
|
4
|
-
simplex/utils.py,sha256=UrD4Ena3yk0POmxxyiqMszzPbTscTCJpMP4xZFDAuOc,339
|
|
5
|
-
simplex-1.1.0.dist-info/LICENSE,sha256=Xh0SJjYZfNI71pCNMB40aKlBLLuOB0blx5xkTtufFNQ,1075
|
|
6
|
-
simplex-1.1.0.dist-info/METADATA,sha256=BOck5V3dhKJbVd47mhX5BEwVVGieODpcQRxBbJuQy9o,1114
|
|
7
|
-
simplex-1.1.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
8
|
-
simplex-1.1.0.dist-info/entry_points.txt,sha256=3veL2w3c5vxb3dm8I_M8Fs-370n1ZnvD8uu1nSsL7z8,45
|
|
9
|
-
simplex-1.1.0.dist-info/top_level.txt,sha256=cbMH1bYpN0A3gP-ecibPRHasHoqB-01T_2BUFS8p0CE,8
|
|
10
|
-
simplex-1.1.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|