toolium 3.8.4__tar.gz → 3.9.0.dev0__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.
Files changed (75) hide show
  1. {toolium-3.8.4 → toolium-3.9.0.dev0}/CHANGELOG.rst +9 -0
  2. {toolium-3.8.4/toolium.egg-info → toolium-3.9.0.dev0}/PKG-INFO +4 -4
  3. {toolium-3.8.4 → toolium-3.9.0.dev0}/README.rst +1 -1
  4. toolium-3.9.0.dev0/VERSION +1 -0
  5. {toolium-3.8.4 → toolium-3.9.0.dev0}/pyproject.toml +3 -3
  6. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/behave/env_utils.py +47 -6
  7. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/test_cases.py +2 -13
  8. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/utils/dataset.py +5 -5
  9. {toolium-3.8.4 → toolium-3.9.0.dev0/toolium.egg-info}/PKG-INFO +4 -4
  10. toolium-3.8.4/VERSION +0 -1
  11. {toolium-3.8.4 → toolium-3.9.0.dev0}/LICENSE +0 -0
  12. {toolium-3.8.4 → toolium-3.9.0.dev0}/MANIFEST.in +0 -0
  13. {toolium-3.8.4 → toolium-3.9.0.dev0}/requirements.txt +0 -0
  14. {toolium-3.8.4 → toolium-3.9.0.dev0}/requirements_ai.txt +0 -0
  15. {toolium-3.8.4 → toolium-3.9.0.dev0}/requirements_dev.txt +0 -0
  16. {toolium-3.8.4 → toolium-3.9.0.dev0}/requirements_playwright.txt +0 -0
  17. {toolium-3.8.4 → toolium-3.9.0.dev0}/setup.cfg +0 -0
  18. {toolium-3.8.4 → toolium-3.9.0.dev0}/setup.py +0 -0
  19. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/__init__.py +0 -0
  20. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/behave/__init__.py +0 -0
  21. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/behave/environment.py +0 -0
  22. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/config_driver.py +0 -0
  23. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/config_driver_playwright.py +0 -0
  24. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/config_files.py +0 -0
  25. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/config_parser.py +0 -0
  26. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/driver_wrapper.py +0 -0
  27. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/driver_wrappers_pool.py +0 -0
  28. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/jira.py +0 -0
  29. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/pageelements/__init__.py +0 -0
  30. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/pageelements/button_page_element.py +0 -0
  31. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/pageelements/checkbox_page_element.py +0 -0
  32. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/pageelements/group_page_element.py +0 -0
  33. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/pageelements/input_radio_page_element.py +0 -0
  34. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/pageelements/input_text_page_element.py +0 -0
  35. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/pageelements/link_page_element.py +0 -0
  36. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/pageelements/page_element.py +0 -0
  37. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/pageelements/page_elements.py +0 -0
  38. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/pageelements/playwright/__init__.py +0 -0
  39. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/pageelements/playwright/button_page_element.py +0 -0
  40. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/pageelements/playwright/input_text_page_element.py +0 -0
  41. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/pageelements/playwright/page_element.py +0 -0
  42. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/pageelements/playwright/text_page_element.py +0 -0
  43. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/pageelements/select_page_element.py +0 -0
  44. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/pageelements/text_page_element.py +0 -0
  45. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/pageobjects/__init__.py +0 -0
  46. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/pageobjects/common_object.py +0 -0
  47. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/pageobjects/mobile_page_object.py +0 -0
  48. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/pageobjects/page_object.py +0 -0
  49. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/pytest_fixtures.py +0 -0
  50. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/resources/VisualTests.css +0 -0
  51. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/resources/VisualTests.js +0 -0
  52. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/resources/VisualTestsTemplate.html +0 -0
  53. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/selenoid.py +0 -0
  54. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/utils/__init__.py +0 -0
  55. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/utils/ai_utils/__init__.py +0 -0
  56. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/utils/ai_utils/accuracy.py +0 -0
  57. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/utils/ai_utils/ai_agent.py +0 -0
  58. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/utils/ai_utils/evaluate_answer.py +0 -0
  59. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/utils/ai_utils/openai.py +0 -0
  60. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/utils/ai_utils/prompt_injection.py +0 -0
  61. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/utils/ai_utils/spacy.py +0 -0
  62. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/utils/ai_utils/text_analysis.py +0 -0
  63. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/utils/ai_utils/text_readability.py +0 -0
  64. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/utils/ai_utils/text_similarity.py +0 -0
  65. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/utils/data_generator.py +0 -0
  66. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/utils/download_files.py +0 -0
  67. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/utils/driver_utils.py +0 -0
  68. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/utils/driver_wait_utils.py +0 -0
  69. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/utils/path_utils.py +0 -0
  70. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/utils/poeditor.py +0 -0
  71. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium/visual_test.py +0 -0
  72. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium.egg-info/SOURCES.txt +0 -0
  73. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium.egg-info/dependency_links.txt +0 -0
  74. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium.egg-info/requires.txt +0 -0
  75. {toolium-3.8.4 → toolium-3.9.0.dev0}/toolium.egg-info/top_level.txt +0 -0
@@ -1,6 +1,15 @@
1
1
  Toolium Changelog
2
2
  =================
3
3
 
4
+ v3.9.0
5
+ ------
6
+
7
+ *Release date: In development*
8
+
9
+ - Add support for Python 3.14
10
+ - Remove Python 3.10 support (Python 3.10 reaches end of life in October 2026)
11
+ - Fix scenario status in Allure report when an action before the feature fails: scenarios are now reported as failed instead of skipped.
12
+
4
13
  v3.8.4
5
14
  ------
6
15
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: toolium
3
- Version: 3.8.4
3
+ Version: 3.9.0.dev0
4
4
  Summary: Wrapper tool of Selenium and Appium libraries to test web and mobile applications in a single project
5
5
  Author-email: Rubén González Alonso <ruben.gonzalezalonso@telefonica.com>
6
6
  License-Expression: Apache-2.0
@@ -15,10 +15,10 @@ Classifier: Intended Audience :: Developers
15
15
  Classifier: Intended Audience :: Other Audience
16
16
  Classifier: Natural Language :: English
17
17
  Classifier: Operating System :: OS Independent
18
- Classifier: Programming Language :: Python :: 3.10
19
18
  Classifier: Programming Language :: Python :: 3.11
20
19
  Classifier: Programming Language :: Python :: 3.12
21
20
  Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
22
22
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
23
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
24
  Classifier: Topic :: Software Development :: Quality Assurance
@@ -26,7 +26,7 @@ Classifier: Topic :: Software Development :: Testing
26
26
  Classifier: Topic :: Software Development :: Testing :: Acceptance
27
27
  Classifier: Topic :: Software Development :: Testing :: BDD
28
28
  Classifier: Topic :: Text Processing :: Linguistic
29
- Requires-Python: >=3.10
29
+ Requires-Python: >=3.11
30
30
  Description-Content-Type: text/x-rst
31
31
  License-File: LICENSE
32
32
  Requires-Dist: requests~=2.27
@@ -82,7 +82,7 @@ Getting Started
82
82
  ---------------
83
83
 
84
84
  Run ``pip install toolium`` to install the latest version from `PyPi <https://pypi.org/project/toolium>`_. It's
85
- highly recommended to use a virtualenv.
85
+ highly recommended to use a virtualenv. Toolium requires Python 3.11 or later.
86
86
 
87
87
  The main dependencies are:
88
88
 
@@ -20,7 +20,7 @@ Getting Started
20
20
  ---------------
21
21
 
22
22
  Run ``pip install toolium`` to install the latest version from `PyPi <https://pypi.org/project/toolium>`_. It's
23
- highly recommended to use a virtualenv.
23
+ highly recommended to use a virtualenv. Toolium requires Python 3.11 or later.
24
24
 
25
25
  The main dependencies are:
26
26
 
@@ -0,0 +1 @@
1
+ 3.9.0.dev0
@@ -30,10 +30,10 @@ classifiers = [
30
30
  "Intended Audience :: Other Audience",
31
31
  "Natural Language :: English",
32
32
  "Operating System :: OS Independent",
33
- "Programming Language :: Python :: 3.10",
34
33
  "Programming Language :: Python :: 3.11",
35
34
  "Programming Language :: Python :: 3.12",
36
35
  "Programming Language :: Python :: 3.13",
36
+ "Programming Language :: Python :: 3.14",
37
37
  "Topic :: Scientific/Engineering :: Artificial Intelligence",
38
38
  "Topic :: Software Development :: Libraries :: Python Modules",
39
39
  "Topic :: Software Development :: Quality Assurance",
@@ -42,7 +42,7 @@ classifiers = [
42
42
  "Topic :: Software Development :: Testing :: BDD",
43
43
  "Topic :: Text Processing :: Linguistic",
44
44
  ]
45
- requires-python = ">=3.10"
45
+ requires-python = ">=3.11"
46
46
 
47
47
  [project.urls]
48
48
  Homepage = "https://github.com/telefonica/toolium"
@@ -104,7 +104,7 @@ exclude_lines = [
104
104
 
105
105
  [tool.ruff]
106
106
  line-length = 120
107
- target-version = "py310"
107
+ target-version = "py311"
108
108
 
109
109
  [tool.ruff.lint]
110
110
  # Rules to enforce
@@ -120,6 +120,8 @@ class DynamicEnvironment:
120
120
  before_scenario and after_scenario are not executed
121
121
  after_feature is executed
122
122
  each scenario is marked as failed
123
+ scenarios are marked as failed in before_feature too, to be reported properly by Allure,
124
+ which closes the scenario result before after_feature is executed
123
125
  * Error in before_scenario:
124
126
  after_scenario is executed
125
127
  the scenario is marked as failed
@@ -127,6 +129,10 @@ class DynamicEnvironment:
127
129
  the scenario status is not changed
128
130
  * Error in after_feature:
129
131
  the scenarios status are not changed
132
+
133
+ Note that when an action before the feature fails and behave is executed with the `--no-skipped` option,
134
+ scenarios are not included in the Allure report, because the scenario status is still skipped. This cannot
135
+ be avoided without executing the scenarios.
130
136
  """
131
137
 
132
138
  def __init__(self, **kwargs):
@@ -247,10 +253,18 @@ class DynamicEnvironment:
247
253
  self.__execute_steps_by_action(context, ACTIONS_BEFORE_FEATURE)
248
254
 
249
255
  if self.feature_error:
256
+ # Get the scenarios to fail before marking the feature as skipped, because mark_skipped makes
257
+ # should_run return False for all the scenarios
258
+ scenarios = self.get_feature_scenarios_to_fail(context)
259
+
250
260
  # Mark this Feature as skipped to do not execute any Scenario
251
- # Status will be changed to failed in after_feature method
252
261
  context.feature.mark_skipped()
253
262
 
263
+ # Mark first step of each scenario as failed now, because Allure closes the scenario result before
264
+ # after_feature is executed and would report it as skipped otherwise. It must be done after
265
+ # mark_skipped, since it requires the steps to be in a not-executed status.
266
+ self.fail_scenarios_first_step(context, scenarios, self.before_error_message)
267
+
254
268
  def execute_before_scenario_steps(self, context):
255
269
  """
256
270
  actions before each scenario
@@ -295,13 +309,40 @@ class DynamicEnvironment:
295
309
  self.feature_error = False
296
310
  self.before_error_message = None
297
311
  context.feature.reset()
298
- for scenario in context.feature.walk_scenarios():
299
- if scenario.should_run(context.config):
300
- self.fail_first_step_precondition_exception(scenario, error_message)
301
- if len(scenario.background_steps) > 0:
302
- context.logger.warning('Background from scenario status udpated to fail')
312
+ self.fail_scenarios_first_step(context, self.get_feature_scenarios_to_fail(context), error_message)
303
313
  raise Exception(f'Before feature steps have failed: {error_message}')
304
314
 
315
+ def get_feature_scenarios_to_fail(self, context):
316
+ """
317
+ Get the scenarios of the feature that should run and must be marked as failed.
318
+ It must be called before the feature is marked as skipped, because then should_run returns False for
319
+ all the scenarios.
320
+
321
+ :param context: It's a clever place where you and behave can store information to share around,
322
+ automatically managed by behave.
323
+ :return: List of scenarios to fail
324
+ """
325
+ return [scenario for scenario in context.feature.walk_scenarios() if scenario.should_run(context.config)]
326
+
327
+ def fail_scenarios_first_step(self, context, scenarios, error_message):
328
+ """
329
+ Fail first step in the given scenarios and add exception message for the output.
330
+ This is needed because xUnit exporter in Behave fails if there are not failed steps and because Allure
331
+ reports a skipped scenario when the feature has been marked as skipped.
332
+
333
+ Note that after a feature error, steps are marked as skipped, but their exception is kept. Allure reads
334
+ the exception before the status, so setting the exception is enough to report the scenario as failed.
335
+
336
+ :param context: It's a clever place where you and behave can store information to share around,
337
+ automatically managed by behave.
338
+ :param scenarios: List of scenarios to fail
339
+ :param error_message: Exception message
340
+ """
341
+ for scenario in scenarios:
342
+ self.fail_first_step_precondition_exception(scenario, error_message)
343
+ if len(scenario.background_steps) > 0:
344
+ context.logger.warning('Background from scenario status udpated to fail')
345
+
305
346
  def fail_first_step_precondition_exception(self, scenario, error_message):
306
347
  """
307
348
  Fail first step in the given Scenario and add exception message for the output.
@@ -18,7 +18,7 @@ limitations under the License.
18
18
  import logging
19
19
  import unittest
20
20
 
21
- from toolium.config_driver import get_error_message_from_exception, get_error_message_from_traceback
21
+ from toolium.config_driver import get_error_message_from_traceback
22
22
  from toolium.config_files import ConfigFiles
23
23
  from toolium.driver_wrappers_pool import DriverWrappersPool
24
24
  from toolium.jira import change_all_jira_status
@@ -65,18 +65,7 @@ class BasicTestCase(unittest.TestCase):
65
65
  def tearDown(self):
66
66
  # Get error message from unittest errors
67
67
  error_message = ''
68
- if hasattr(self._outcome, 'errors') and len(self._outcome.errors) > 0:
69
- # Python <3.11
70
- exception_info = self._outcome.errors[-1][1]
71
- if exception_info:
72
- exception = exception_info[1]
73
- error_message = get_error_message_from_exception(exception)
74
- elif (
75
- not hasattr(self._outcome, 'errors')
76
- and hasattr(self._outcome.result, 'failures')
77
- and len(self._outcome.result.failures) > 0
78
- ):
79
- # Python >=3.11
68
+ if hasattr(self._outcome.result, 'failures') and len(self._outcome.result.failures) > 0:
80
69
  traceback = self._outcome.result.failures[0][1]
81
70
  error_message = get_error_message_from_traceback(traceback)
82
71
 
@@ -203,10 +203,10 @@ def _replace_param_replacement(param, language):
203
203
  # make sure random is not made up of digits only, by forcing the first char to be a letter
204
204
  '[RANDOM]': ''.join([r.choice(string.ascii_lowercase), *(r.choice(alphanums) for i in range(7))]),
205
205
  '[RANDOM_PHONE_NUMBER]': _get_random_phone_number,
206
- '[TIMESTAMP]': str(int(datetime.datetime.timestamp(datetime.datetime.now(datetime.timezone.utc)))),
207
- '[DATETIME]': str(datetime.datetime.now(datetime.timezone.utc).strftime(datetime_format)),
208
- '[NOW]': str(datetime.datetime.now(datetime.timezone.utc).strftime(date_format)),
209
- '[TODAY]': str(datetime.datetime.now(datetime.timezone.utc).strftime(date_day_format)),
206
+ '[TIMESTAMP]': str(int(datetime.datetime.timestamp(datetime.datetime.now(datetime.UTC)))),
207
+ '[DATETIME]': str(datetime.datetime.now(datetime.UTC).strftime(datetime_format)),
208
+ '[NOW]': str(datetime.datetime.now(datetime.UTC).strftime(date_format)),
209
+ '[TODAY]': str(datetime.datetime.now(datetime.UTC).strftime(date_day_format)),
210
210
  r'\[ROUND:(.*?)::(\d*)\]': _get_rounded_float_number,
211
211
  '[SHARP]': '#',
212
212
  }
@@ -348,7 +348,7 @@ def _replace_param_date(param, language):
348
348
  return re.match(r'\[(NOW(?:\((?:.*)\)|)|TODAY)(?:\s*([\+|-]\s*\d+)\s*(\w+)\s*)?\]', param)
349
349
 
350
350
  def _offset_datetime(amount, units):
351
- now = datetime.datetime.now(datetime.timezone.utc)
351
+ now = datetime.datetime.now(datetime.UTC)
352
352
  if not amount or not units:
353
353
  return now
354
354
  the_amount = int(amount.replace(' ', ''))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: toolium
3
- Version: 3.8.4
3
+ Version: 3.9.0.dev0
4
4
  Summary: Wrapper tool of Selenium and Appium libraries to test web and mobile applications in a single project
5
5
  Author-email: Rubén González Alonso <ruben.gonzalezalonso@telefonica.com>
6
6
  License-Expression: Apache-2.0
@@ -15,10 +15,10 @@ Classifier: Intended Audience :: Developers
15
15
  Classifier: Intended Audience :: Other Audience
16
16
  Classifier: Natural Language :: English
17
17
  Classifier: Operating System :: OS Independent
18
- Classifier: Programming Language :: Python :: 3.10
19
18
  Classifier: Programming Language :: Python :: 3.11
20
19
  Classifier: Programming Language :: Python :: 3.12
21
20
  Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
22
22
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
23
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
24
  Classifier: Topic :: Software Development :: Quality Assurance
@@ -26,7 +26,7 @@ Classifier: Topic :: Software Development :: Testing
26
26
  Classifier: Topic :: Software Development :: Testing :: Acceptance
27
27
  Classifier: Topic :: Software Development :: Testing :: BDD
28
28
  Classifier: Topic :: Text Processing :: Linguistic
29
- Requires-Python: >=3.10
29
+ Requires-Python: >=3.11
30
30
  Description-Content-Type: text/x-rst
31
31
  License-File: LICENSE
32
32
  Requires-Dist: requests~=2.27
@@ -82,7 +82,7 @@ Getting Started
82
82
  ---------------
83
83
 
84
84
  Run ``pip install toolium`` to install the latest version from `PyPi <https://pypi.org/project/toolium>`_. It's
85
- highly recommended to use a virtualenv.
85
+ highly recommended to use a virtualenv. Toolium requires Python 3.11 or later.
86
86
 
87
87
  The main dependencies are:
88
88
 
toolium-3.8.4/VERSION DELETED
@@ -1 +0,0 @@
1
- 3.8.4
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes