cucu 1.3.19__py3-none-any.whl → 1.3.20__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.
- cucu/browser/core.py +3 -0
- cucu/browser/selenium.py +7 -0
- cucu/environment.py +1 -1
- cucu/steps/filesystem_steps.py +16 -0
- {cucu-1.3.19.dist-info → cucu-1.3.20.dist-info}/METADATA +1 -1
- {cucu-1.3.19.dist-info → cucu-1.3.20.dist-info}/RECORD +8 -8
- {cucu-1.3.19.dist-info → cucu-1.3.20.dist-info}/WHEEL +0 -0
- {cucu-1.3.19.dist-info → cucu-1.3.20.dist-info}/entry_points.txt +0 -0
cucu/browser/core.py
CHANGED
cucu/browser/selenium.py
CHANGED
|
@@ -195,6 +195,13 @@ class Selenium(Browser):
|
|
|
195
195
|
raise Exception(f"unknown browser {browser}")
|
|
196
196
|
|
|
197
197
|
self.driver.set_window_size(width, height)
|
|
198
|
+
session_id = self.get_session_id()
|
|
199
|
+
logger.debug(f"cucu started Selenium session with ID: {session_id}")
|
|
200
|
+
|
|
201
|
+
def get_session_id(self):
|
|
202
|
+
if self.driver:
|
|
203
|
+
return getattr(self.driver, "session_id", None)
|
|
204
|
+
return None
|
|
198
205
|
|
|
199
206
|
def get_log(self):
|
|
200
207
|
if config.CONFIG["CUCU_BROWSER"] == "firefox":
|
cucu/environment.py
CHANGED
|
@@ -174,10 +174,10 @@ def after_scenario(ctx, scenario):
|
|
|
174
174
|
"current_tab_index": tab_info["index"],
|
|
175
175
|
"all_tabs": all_tabs,
|
|
176
176
|
"browser_type": ctx.browser.driver.name,
|
|
177
|
+
"session_id": ctx.browser.get_session_id(),
|
|
177
178
|
}
|
|
178
179
|
except Exception as e:
|
|
179
180
|
logger.error(f"Error getting browser info: {e}")
|
|
180
|
-
|
|
181
181
|
scenario.browser_info = browser_info
|
|
182
182
|
|
|
183
183
|
run_after_scenario_hook(ctx, scenario, download_mht_data)
|
cucu/steps/filesystem_steps.py
CHANGED
|
@@ -106,6 +106,22 @@ def should_see_file_contains_the_following(ctx, filepath):
|
|
|
106
106
|
)
|
|
107
107
|
|
|
108
108
|
|
|
109
|
+
@step('I should see the file at "{filepath}" contains the following pattern')
|
|
110
|
+
def should_see_file_contains_pattern(ctx, filepath):
|
|
111
|
+
"""Checks if the file contains text matching the given regex pattern."""
|
|
112
|
+
with open(filepath, "rb") as input_file:
|
|
113
|
+
file_contents = input_file.read().decode("utf-8")
|
|
114
|
+
pattern = ctx.text.strip()
|
|
115
|
+
anchored_pattern = rf"^\s*{pattern}\s*$"
|
|
116
|
+
|
|
117
|
+
if not re.search(
|
|
118
|
+
anchored_pattern, file_contents, re.MULTILINE | re.IGNORECASE
|
|
119
|
+
):
|
|
120
|
+
raise RuntimeError(
|
|
121
|
+
f"\n{file_contents}\ndoes not match regex pattern:\n{pattern}\n"
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
|
|
109
125
|
@step('I should see the file at "{filepath}" matches the following')
|
|
110
126
|
def should_see_file_matches_the_following(ctx, filepath):
|
|
111
127
|
with open(filepath, "rb") as input:
|
|
@@ -2,9 +2,9 @@ cucu/__init__.py,sha256=YtuajsJBj3_DgNoygHen9gKojeQF523Oc27kyCUzoG0,1013
|
|
|
2
2
|
cucu/ansi_parser.py,sha256=gjAWBShqsm0GFdJWv8ptsN8he4HgaT18E7GNl3Po46o,2280
|
|
3
3
|
cucu/behave_tweaks.py,sha256=MqIL9BDHMvmyXyzkVGbD3wd8IP38_8pgp3NPGDWudm8,6873
|
|
4
4
|
cucu/browser/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
-
cucu/browser/core.py,sha256=
|
|
5
|
+
cucu/browser/core.py,sha256=48N5oI83kouiqOzpySo5Xg4d7LexCBY1zrfOpxEwSKU,2766
|
|
6
6
|
cucu/browser/frames.py,sha256=IW7kzRJn5PkbMaovIelAeCWO-T-2sOTwqaYBw-0-LKU,3545
|
|
7
|
-
cucu/browser/selenium.py,sha256=
|
|
7
|
+
cucu/browser/selenium.py,sha256=xFt2H92VPTwDw7xK94PW8EJ5eU7M5yiKeKmex3xEka4,13554
|
|
8
8
|
cucu/browser/selenium_tweaks.py,sha256=oUIhWVhBZbc9qsmQUJMpIr9uUWKxtgZBcnySWU6Yttk,879
|
|
9
9
|
cucu/cli/__init__.py,sha256=uXX5yVG1konJ_INdlrcfMg-Tt_5_cSx29Ed8R8v908A,62
|
|
10
10
|
cucu/cli/core.py,sha256=op77u8ccFTqwbnpvYBFOhHy7gTyoqFBBti-Fw3BtbKM,26981
|
|
@@ -16,7 +16,7 @@ cucu/db.py,sha256=2d2oAcBSAb3wwDKM7kBEaooMYEv0VY_9Mlwb9VLjzuY,17876
|
|
|
16
16
|
cucu/edgedriver_autoinstaller/README.md,sha256=tDkAWIqgRdCjt-oX1nYqikIC_FfiOEM2-pc5S5VbRLo,84
|
|
17
17
|
cucu/edgedriver_autoinstaller/__init__.py,sha256=fo6xJJPvcc5Xvni8epXfxDoPxJH5_b6Vk2jD9JTwfRs,969
|
|
18
18
|
cucu/edgedriver_autoinstaller/utils.py,sha256=iRKTww77CGaTAntt_QDvxlKPxpMU4otx95OeD97khcM,6802
|
|
19
|
-
cucu/environment.py,sha256=
|
|
19
|
+
cucu/environment.py,sha256=Yj_KAM8Vbg4v2OZF830ZqrYuA1-cGf3mFUHwkLQO_Os,11655
|
|
20
20
|
cucu/external/jquery/jquery-3.5.1.min.js,sha256=9_aliU8dGd2tb6OSsuzixeV4y_faTqgFtohetphbbj0,89476
|
|
21
21
|
cucu/formatter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
22
|
cucu/formatter/cucu.py,sha256=NRLFsd6xl3uwUk45ihKN2OEioOeAqeTURrcQgscDGnU,9351
|
|
@@ -72,7 +72,7 @@ cucu/steps/command_steps.py,sha256=nVCc8-TEitetk-zhk4z1wa0owqLQyHeQVH5THioUw-k,5
|
|
|
72
72
|
cucu/steps/draggable_steps.py,sha256=lnQLicp0GZJaxD_Qm2P13ruUZAsl3mptwaI5-SQ6XJ0,4655
|
|
73
73
|
cucu/steps/dropdown_steps.py,sha256=abykG--m79kDQ4LU1tm73fNLFPmrKDavyFzJb2MYCu0,15601
|
|
74
74
|
cucu/steps/file_input_steps.py,sha256=LLMAozVpceLMD-kJOE-auKHAdWLbNprH8eCfVQuNoGg,5523
|
|
75
|
-
cucu/steps/filesystem_steps.py,sha256=
|
|
75
|
+
cucu/steps/filesystem_steps.py,sha256=YKJtO4e4Lq-mOr0OsluS666U_264a9W7LWrxjGWLEXA,5377
|
|
76
76
|
cucu/steps/flow_control_steps.py,sha256=UV-rWKOF1OqLaDKhMfSAqAm5TF81T5_j_e3eYGpE6QE,6401
|
|
77
77
|
cucu/steps/image_steps.py,sha256=4X6bdumsIybcJBuao83TURxWAIshZyCvKi1uTJEoy1k,941
|
|
78
78
|
cucu/steps/input_steps.py,sha256=TYQhkmke-W5dJt4EsU-JHjRwnbd7zvXnhEjw5PQ4Wxs,9679
|
|
@@ -89,7 +89,7 @@ cucu/steps/text_steps.py,sha256=Jj_GHoHeemNwVdUOdqcehArNp7WM-WMjljA4w0pLXuw,2576
|
|
|
89
89
|
cucu/steps/variable_steps.py,sha256=WSctH3_xcxjijGPYZlxp-foC_SIAAKtF__saNtgZJbk,2966
|
|
90
90
|
cucu/steps/webserver_steps.py,sha256=i11xOmSjhhrQ-2QrDfpjDhWroeJuuGKvbYEsHV1cioI,1406
|
|
91
91
|
cucu/utils.py,sha256=ixJS5wG8GFuZfHE-gRk0dG4lJXjyjQFbq3hJzLG0Uvw,11409
|
|
92
|
-
cucu-1.3.
|
|
93
|
-
cucu-1.3.
|
|
94
|
-
cucu-1.3.
|
|
95
|
-
cucu-1.3.
|
|
92
|
+
cucu-1.3.20.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
|
|
93
|
+
cucu-1.3.20.dist-info/entry_points.txt,sha256=11WRIhQM7LuUnQg1lAoZQoNvvBvYNN1maDgQS4djwJo,40
|
|
94
|
+
cucu-1.3.20.dist-info/METADATA,sha256=knq1NXQ5gC22nr332tGn-li810ISuu1ER8be9WF7Hsc,16722
|
|
95
|
+
cucu-1.3.20.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|