socialseed-e2e 0.1.0__py3-none-any.whl → 0.1.2__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.
Files changed (29) hide show
  1. socialseed_e2e/__init__.py +184 -20
  2. socialseed_e2e/__version__.py +2 -2
  3. socialseed_e2e/cli.py +353 -190
  4. socialseed_e2e/core/base_page.py +368 -49
  5. socialseed_e2e/core/config_loader.py +15 -3
  6. socialseed_e2e/core/headers.py +11 -4
  7. socialseed_e2e/core/loaders.py +6 -4
  8. socialseed_e2e/core/test_orchestrator.py +2 -0
  9. socialseed_e2e/core/test_runner.py +487 -0
  10. socialseed_e2e/templates/agent_docs/AGENT_GUIDE.md.template +412 -0
  11. socialseed_e2e/templates/agent_docs/EXAMPLE_TEST.md.template +152 -0
  12. socialseed_e2e/templates/agent_docs/FRAMEWORK_CONTEXT.md.template +55 -0
  13. socialseed_e2e/templates/agent_docs/WORKFLOW_GENERATION.md.template +182 -0
  14. socialseed_e2e/templates/data_schema.py.template +111 -70
  15. socialseed_e2e/templates/e2e.conf.template +19 -0
  16. socialseed_e2e/templates/service_page.py.template +82 -27
  17. socialseed_e2e/templates/test_module.py.template +21 -7
  18. socialseed_e2e/templates/verify_installation.py +192 -0
  19. socialseed_e2e/utils/__init__.py +29 -0
  20. socialseed_e2e/utils/ai_generator.py +463 -0
  21. socialseed_e2e/utils/pydantic_helpers.py +392 -0
  22. socialseed_e2e/utils/state_management.py +312 -0
  23. {socialseed_e2e-0.1.0.dist-info → socialseed_e2e-0.1.2.dist-info}/METADATA +64 -27
  24. socialseed_e2e-0.1.2.dist-info/RECORD +38 -0
  25. socialseed_e2e-0.1.0.dist-info/RECORD +0 -29
  26. {socialseed_e2e-0.1.0.dist-info → socialseed_e2e-0.1.2.dist-info}/WHEEL +0 -0
  27. {socialseed_e2e-0.1.0.dist-info → socialseed_e2e-0.1.2.dist-info}/entry_points.txt +0 -0
  28. {socialseed_e2e-0.1.0.dist-info → socialseed_e2e-0.1.2.dist-info}/licenses/LICENSE +0 -0
  29. {socialseed_e2e-0.1.0.dist-info → socialseed_e2e-0.1.2.dist-info}/top_level.txt +0 -0
@@ -1,51 +1,215 @@
1
1
  """
2
- socialseed-e2e: Framework E2E para testing de APIs REST con Playwright.
2
+ socialseed-e2e: Universal Framework E2E para testing de APIs REST con Playwright.
3
3
 
4
- Este paquete proporciona un framework completo para testing end-to-end
5
- de APIs REST, extraído y generalizado desde el proyecto SocialSeed.
4
+ Este framework proporciona una solución completa para testing end-to-end
5
+ de APIs REST escritas en CUALQUIER lenguaje: Java, C#, Python, Node.js, Go, C++, etc.
6
6
 
7
7
  Características principales:
8
+ - Soporte multi-lenguaje (Java, C#, Python, Node.js, Go, C++, etc.)
9
+ - Detección automática de naming conventions (camelCase, PascalCase, snake_case)
10
+ - Modelos Pydantic universales (APIModel) con serialización automática
8
11
  - Arquitectura hexagonal (core agnóstico)
9
12
  - Configuración centralizada via YAML
10
13
  - Carga dinámica de módulos de test
11
14
  - Soporte para API Gateway o conexiones directas
12
15
  - CLI completo con Rich y Click
16
+ - Validación de esquemas JSON y Pydantic
17
+ - Health checks y service waiting
18
+ - Interceptores de request/response
19
+ - Prevención automática de errores comunes
20
+ - Manejo de estado entre tests (DynamicStateMixin)
13
21
 
14
22
  Uso básico:
15
- >>> from socialseed_e2e import BasePage, ApiConfigLoader
16
- >>> config = ApiConfigLoader.load()
17
- >>> page = BasePage(config.base_url)
18
- >>> response = page.get("/endpoint")
23
+ >>> from socialseed_e2e import BasePage, APIModel, api_field
24
+ >>>
25
+ >>> # Crear modelo para API Java (camelCase)
26
+ >>> class LoginRequest(APIModel):
27
+ ... refresh_token: str = api_field("refreshToken")
28
+ ... user_name: str = api_field("userName")
29
+ >>>
30
+ >>> page = BasePage("https://api.example.com")
31
+ >>> page.setup()
32
+ >>>
33
+ >>> request = LoginRequest(refresh_token="abc", user_name="john")
34
+ >>> data = request.to_dict() # {'refreshToken': 'abc', 'userName': 'john'}
35
+ >>> response = page.post("/login", data=data)
36
+ >>>
37
+ >>> page.assert_ok(response)
38
+ >>> page.teardown()
19
39
 
20
- Para más información, visita: https://github.com/daironpf/socialseed-e2e
40
+ Para más información: https://github.com/daironpf/socialseed-e2e
21
41
  """
22
42
 
23
- __version__ = "0.1.0"
24
- __version_info__ = (0, 1, 0)
25
- __author__ = "Dairon Pérez Frías"
26
- __email__ = "dairon.perezfrias@gmail.com"
27
- __license__ = "MIT"
28
- __copyright__ = "Copyright 2026 Dairon Pérez Frías"
29
- __url__ = "https://github.com/daironpf/socialseed-e2e"
43
+ from socialseed_e2e.__version__ import (
44
+ __author__,
45
+ __copyright__,
46
+ __email__,
47
+ __license__,
48
+ __url__,
49
+ __version__,
50
+ __version_info__,
51
+ )
30
52
 
53
+ # CLI
31
54
  from socialseed_e2e.cli import main
32
55
 
33
- # Hacer disponibles las clases principales
34
- from socialseed_e2e.core.base_page import BasePage
35
- from socialseed_e2e.core.config_loader import ApiConfigLoader, get_config, get_service_config
56
+ # Core - BasePage and configuration
57
+ from socialseed_e2e.core.base_page import (
58
+ BasePage,
59
+ BasePageError,
60
+ RateLimitConfig,
61
+ RequestLog,
62
+ RetryConfig,
63
+ ServiceHealth,
64
+ )
65
+ from socialseed_e2e.core.config_loader import (
66
+ ApiConfigLoader,
67
+ ApiGatewayConfig,
68
+ AppConfig,
69
+ DatabaseConfig,
70
+ ReportingConfig,
71
+ SecurityConfig,
72
+ )
73
+ from socialseed_e2e.core.config_loader import ServiceConfig as ConfigServiceConfig
74
+ from socialseed_e2e.core.config_loader import (
75
+ TestDataConfig,
76
+ get_config,
77
+ get_service_config,
78
+ get_service_url,
79
+ )
36
80
  from socialseed_e2e.core.loaders import ModuleLoader
37
81
  from socialseed_e2e.core.models import ServiceConfig, TestContext
38
82
  from socialseed_e2e.core.test_orchestrator import TestOrchestrator
83
+ from socialseed_e2e.core.test_runner import (
84
+ TestDiscoveryError,
85
+ TestExecutionError,
86
+ TestResult,
87
+ TestSuiteResult,
88
+ run_all_tests,
89
+ run_service_tests,
90
+ )
91
+
92
+ # Utils - Pydantic helpers (universal for all languages)
93
+ from socialseed_e2e.utils.pydantic_helpers import ( # New universal model; Field creators for different conventions; Naming conversion utilities; Serialization utilities; Convenience field aliases; Backwards compatibility
94
+ APIModel,
95
+ JavaCompatibleModel,
96
+ NamingConvention,
97
+ access_token_field,
98
+ api_field,
99
+ camel_field,
100
+ created_at_field,
101
+ current_password_field,
102
+ detect_naming_convention,
103
+ new_password_field,
104
+ pascal_field,
105
+ refresh_token_field,
106
+ snake_field,
107
+ to_api_dict,
108
+ to_camel_case,
109
+ to_camel_dict,
110
+ to_kebab_case,
111
+ to_pascal_case,
112
+ to_snake_case,
113
+ updated_at_field,
114
+ user_id_field,
115
+ user_name_field,
116
+ validate_api_model,
117
+ validate_camelcase_model,
118
+ )
119
+
120
+ # Utils - State management
121
+ from socialseed_e2e.utils.state_management import AuthStateMixin, DynamicStateMixin
122
+
123
+ # Utils - Template engine
124
+ from socialseed_e2e.utils.template_engine import TemplateEngine
125
+ from socialseed_e2e.utils.template_engine import to_camel_case as template_to_camel_case
126
+ from socialseed_e2e.utils.template_engine import to_class_name
127
+ from socialseed_e2e.utils.template_engine import to_snake_case as template_to_snake_case
128
+
129
+ # Utils - Validators
130
+ from socialseed_e2e.utils.validators import (
131
+ ValidationError,
132
+ validate_base_url,
133
+ validate_email,
134
+ validate_url,
135
+ validate_uuid,
136
+ )
39
137
 
40
138
  __all__ = [
139
+ # Version
140
+ "__version__",
141
+ "__version_info__",
142
+ # CLI
143
+ "main",
144
+ # Core - BasePage
41
145
  "BasePage",
146
+ "BasePageError",
147
+ "RetryConfig",
148
+ "RateLimitConfig",
149
+ "RequestLog",
150
+ "ServiceHealth",
151
+ # Core - Configuration
42
152
  "ApiConfigLoader",
43
153
  "get_config",
44
154
  "get_service_config",
155
+ "get_service_url",
156
+ # Core - Loaders and Orchestration
45
157
  "ModuleLoader",
46
158
  "TestOrchestrator",
159
+ # Core - Test Runner
160
+ "run_all_tests",
161
+ "run_service_tests",
162
+ "TestResult",
163
+ "TestSuiteResult",
164
+ "TestDiscoveryError",
165
+ "TestExecutionError",
166
+ # Core - Models
47
167
  "ServiceConfig",
48
168
  "TestContext",
49
- "main",
50
- "__version__",
169
+ "AppConfig",
170
+ "ApiGatewayConfig",
171
+ "DatabaseConfig",
172
+ "TestDataConfig",
173
+ "SecurityConfig",
174
+ "ReportingConfig",
175
+ # Utils - State Management
176
+ "DynamicStateMixin",
177
+ "AuthStateMixin",
178
+ # Utils - Pydantic (Universal)
179
+ "APIModel",
180
+ "api_field",
181
+ "NamingConvention",
182
+ "detect_naming_convention",
183
+ "camel_field",
184
+ "pascal_field",
185
+ "snake_field",
186
+ "to_camel_case",
187
+ "to_pascal_case",
188
+ "to_snake_case",
189
+ "to_kebab_case",
190
+ "to_api_dict",
191
+ "validate_api_model",
192
+ "refresh_token_field",
193
+ "access_token_field",
194
+ "user_name_field",
195
+ "user_id_field",
196
+ "created_at_field",
197
+ "updated_at_field",
198
+ "new_password_field",
199
+ "current_password_field",
200
+ # Utils - Pydantic (Backwards compatibility)
201
+ "JavaCompatibleModel",
202
+ "to_camel_dict",
203
+ "validate_camelcase_model",
204
+ # Utils - Validators
205
+ "ValidationError",
206
+ "validate_url",
207
+ "validate_base_url",
208
+ "validate_email",
209
+ "validate_uuid",
210
+ # Utils - Templates
211
+ "TemplateEngine",
212
+ "to_class_name",
213
+ "template_to_snake_case",
214
+ "template_to_camel_case",
51
215
  ]
@@ -4,8 +4,8 @@ Version information for socialseed-e2e.
4
4
  This module contains version information and metadata about the package.
5
5
  """
6
6
 
7
- __version__ = "0.1.0"
8
- __version_info__ = (0, 1, 0)
7
+ __version__ = "0.1.2"
8
+ __version_info__ = (0, 1, 2)
9
9
  __author__ = "Dairon Pérez Frías"
10
10
  __email__ = "dairon.perezfrias@gmail.com"
11
11
  __license__ = "MIT"