codemie-test-harness 0.1.205__py3-none-any.whl → 0.1.207__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 codemie-test-harness might be problematic. Click here for more details.
- codemie_test_harness/tests/assistant/datasource/test_code_datasource.py +2 -2
- codemie_test_harness/tests/assistant/tools/git/test_assistant_with_git_tools.py +14 -14
- codemie_test_harness/tests/conftest.py +34 -12
- codemie_test_harness/tests/e2e/test_e2e.py +2 -2
- codemie_test_harness/tests/ui/assistants/test_create_assistant.py +13 -13
- codemie_test_harness/tests/ui/assistants/test_edit_assistant.py +200 -0
- codemie_test_harness/tests/ui/datasource/test_create_datasource.py +2 -2
- codemie_test_harness/tests/ui/datasource/test_edit_datasource.py +2 -2
- codemie_test_harness/tests/ui/datasource/test_view_datasource.py +2 -2
- codemie_test_harness/tests/ui/pageobject/assistants/assistant_mcp_server.py +171 -0
- codemie_test_harness/tests/ui/pageobject/assistants/assistant_sidebar.py +140 -0
- codemie_test_harness/tests/ui/pageobject/assistants/assistant_view_page.py +256 -0
- codemie_test_harness/tests/ui/pageobject/assistants/assistants_page.py +63 -0
- codemie_test_harness/tests/ui/pageobject/assistants/{create_assistant_page.py → create_edit_assistant_page.py} +379 -95
- codemie_test_harness/tests/ui/test_data/assistant_test_data.py +347 -18
- codemie_test_harness/tests/utils/constants.py +1 -1
- codemie_test_harness/tests/utils/webhook_utils.py +10 -0
- codemie_test_harness/tests/webhook/__init__.py +0 -0
- codemie_test_harness/tests/webhook/test_webhook_service.py +225 -0
- codemie_test_harness/tests/workflow/assistant_tools/git/test_workflow_with_assistant_git_tools.py +14 -14
- codemie_test_harness/tests/workflow/virtual_assistant_tools/git/test_workflow_with_git_tools.py +14 -14
- {codemie_test_harness-0.1.205.dist-info → codemie_test_harness-0.1.207.dist-info}/METADATA +2 -2
- {codemie_test_harness-0.1.205.dist-info → codemie_test_harness-0.1.207.dist-info}/RECORD +25 -18
- {codemie_test_harness-0.1.205.dist-info → codemie_test_harness-0.1.207.dist-info}/WHEEL +0 -0
- {codemie_test_harness-0.1.205.dist-info → codemie_test_harness-0.1.207.dist-info}/entry_points.txt +0 -0
|
@@ -22,7 +22,7 @@ from codemie_test_harness.tests.utils.base_utils import (
|
|
|
22
22
|
ids=[f"{row[0][0]}" for row in index_test_data],
|
|
23
23
|
)
|
|
24
24
|
def test_create_index_application_with_embedding_model(
|
|
25
|
-
|
|
25
|
+
gitlab_integration,
|
|
26
26
|
datasource_utils,
|
|
27
27
|
assistant,
|
|
28
28
|
assistant_utils,
|
|
@@ -37,7 +37,7 @@ def test_create_index_application_with_embedding_model(
|
|
|
37
37
|
"""
|
|
38
38
|
|
|
39
39
|
datasource = datasource_utils.create_gitlab_datasource(
|
|
40
|
-
setting_id=
|
|
40
|
+
setting_id=gitlab_integration.id, embeddings_model=embedding_model
|
|
41
41
|
)
|
|
42
42
|
|
|
43
43
|
assistant = assistant(
|
|
@@ -31,7 +31,7 @@ def test_assistant_with_list_branch_set_active_branch_tools(
|
|
|
31
31
|
code_datasource,
|
|
32
32
|
code_context,
|
|
33
33
|
git_utils,
|
|
34
|
-
|
|
34
|
+
gitlab_integration,
|
|
35
35
|
similarity_check,
|
|
36
36
|
toolkit,
|
|
37
37
|
tool_name,
|
|
@@ -42,7 +42,7 @@ def test_assistant_with_list_branch_set_active_branch_tools(
|
|
|
42
42
|
toolkit,
|
|
43
43
|
tool_name,
|
|
44
44
|
context=code_context(code_datasource),
|
|
45
|
-
settings=
|
|
45
|
+
settings=gitlab_integration,
|
|
46
46
|
)
|
|
47
47
|
response, triggered_tools = assistant_utils.ask_assistant(
|
|
48
48
|
assistant, prompt, minimal_response=False
|
|
@@ -65,7 +65,7 @@ def test_assistant_with_create_branch_tool(
|
|
|
65
65
|
code_datasource,
|
|
66
66
|
code_context,
|
|
67
67
|
git_utils,
|
|
68
|
-
|
|
68
|
+
gitlab_integration,
|
|
69
69
|
similarity_check,
|
|
70
70
|
toolkit,
|
|
71
71
|
tool_name,
|
|
@@ -81,7 +81,7 @@ def test_assistant_with_create_branch_tool(
|
|
|
81
81
|
toolkit,
|
|
82
82
|
tool_name,
|
|
83
83
|
context=code_context(code_datasource),
|
|
84
|
-
settings=
|
|
84
|
+
settings=gitlab_integration,
|
|
85
85
|
)
|
|
86
86
|
response, triggered_tools = assistant_utils.ask_assistant(
|
|
87
87
|
assistant, prompt, minimal_response=False
|
|
@@ -114,7 +114,7 @@ def test_assistant_with_create_file_tool(
|
|
|
114
114
|
code_context,
|
|
115
115
|
code_datasource,
|
|
116
116
|
git_utils,
|
|
117
|
-
|
|
117
|
+
gitlab_integration,
|
|
118
118
|
similarity_check,
|
|
119
119
|
toolkit,
|
|
120
120
|
tool_name,
|
|
@@ -134,7 +134,7 @@ def test_assistant_with_create_file_tool(
|
|
|
134
134
|
toolkit,
|
|
135
135
|
tool_name,
|
|
136
136
|
context=code_context(code_datasource),
|
|
137
|
-
settings=
|
|
137
|
+
settings=gitlab_integration,
|
|
138
138
|
)
|
|
139
139
|
response, triggered_tools = assistant_utils.ask_assistant(
|
|
140
140
|
assistant, prompt, minimal_response=False
|
|
@@ -165,7 +165,7 @@ def test_assistant_with_create_merge_request_tool(
|
|
|
165
165
|
code_context,
|
|
166
166
|
code_datasource,
|
|
167
167
|
git_utils,
|
|
168
|
-
|
|
168
|
+
gitlab_integration,
|
|
169
169
|
similarity_check,
|
|
170
170
|
toolkit,
|
|
171
171
|
tool_name,
|
|
@@ -183,7 +183,7 @@ def test_assistant_with_create_merge_request_tool(
|
|
|
183
183
|
toolkit,
|
|
184
184
|
tool_name,
|
|
185
185
|
context=code_context(code_datasource),
|
|
186
|
-
settings=
|
|
186
|
+
settings=gitlab_integration,
|
|
187
187
|
)
|
|
188
188
|
response, triggered_tools = assistant_utils.ask_assistant(
|
|
189
189
|
assistant, prompt, minimal_response=False
|
|
@@ -211,7 +211,7 @@ def test_assistant_with_delete_file_tool(
|
|
|
211
211
|
code_context,
|
|
212
212
|
code_datasource,
|
|
213
213
|
git_utils,
|
|
214
|
-
|
|
214
|
+
gitlab_integration,
|
|
215
215
|
datasource_utils,
|
|
216
216
|
assistant_utils,
|
|
217
217
|
similarity_check,
|
|
@@ -245,7 +245,7 @@ def test_assistant_with_delete_file_tool(
|
|
|
245
245
|
toolkit,
|
|
246
246
|
tool_name,
|
|
247
247
|
context=code_context(code_datasource),
|
|
248
|
-
settings=
|
|
248
|
+
settings=gitlab_integration,
|
|
249
249
|
)
|
|
250
250
|
response, triggered_tools = assistant_utils.ask_assistant(
|
|
251
251
|
assistant, prompt, minimal_response=False
|
|
@@ -278,7 +278,7 @@ def test_assistant_with_get_merge_request_changes_tool(
|
|
|
278
278
|
code_context,
|
|
279
279
|
code_datasource,
|
|
280
280
|
git_utils,
|
|
281
|
-
|
|
281
|
+
gitlab_integration,
|
|
282
282
|
similarity_check,
|
|
283
283
|
toolkit,
|
|
284
284
|
tool_name,
|
|
@@ -296,7 +296,7 @@ def test_assistant_with_get_merge_request_changes_tool(
|
|
|
296
296
|
toolkit,
|
|
297
297
|
tool_name,
|
|
298
298
|
context=code_context(code_datasource),
|
|
299
|
-
settings=
|
|
299
|
+
settings=gitlab_integration,
|
|
300
300
|
)
|
|
301
301
|
|
|
302
302
|
create_mr_prompt = create_mr_prompt_template(source_branch, class_name, mr_name)
|
|
@@ -341,7 +341,7 @@ def test_assistant_with_update_file_tools(
|
|
|
341
341
|
code_context,
|
|
342
342
|
code_datasource,
|
|
343
343
|
git_utils,
|
|
344
|
-
|
|
344
|
+
gitlab_integration,
|
|
345
345
|
datasource_utils,
|
|
346
346
|
similarity_check,
|
|
347
347
|
toolkit,
|
|
@@ -361,7 +361,7 @@ def test_assistant_with_update_file_tools(
|
|
|
361
361
|
toolkit,
|
|
362
362
|
tool_name,
|
|
363
363
|
context=code_context(code_datasource),
|
|
364
|
-
settings=
|
|
364
|
+
settings=gitlab_integration,
|
|
365
365
|
)
|
|
366
366
|
|
|
367
367
|
create_prompt = create_prompt_template(class_name)
|
|
@@ -57,6 +57,7 @@ from codemie_test_harness.tests.utils.env_resolver import (
|
|
|
57
57
|
EnvironmentResolver,
|
|
58
58
|
get_environment,
|
|
59
59
|
)
|
|
60
|
+
from codemie_test_harness.tests.utils.webhook_utils import WebhookUtils
|
|
60
61
|
|
|
61
62
|
logger = setup_logger(__name__)
|
|
62
63
|
|
|
@@ -262,21 +263,15 @@ def conversation_utils(client):
|
|
|
262
263
|
|
|
263
264
|
|
|
264
265
|
@pytest.fixture(scope="session")
|
|
265
|
-
def
|
|
266
|
-
|
|
267
|
-
credential_type=CredentialTypes.GIT,
|
|
268
|
-
credential_values=CredentialsManager.gitlab_credentials(),
|
|
269
|
-
)
|
|
270
|
-
yield integration
|
|
271
|
-
if integration:
|
|
272
|
-
integration_utils.delete_integration(integration)
|
|
266
|
+
def webhook_utils(client):
|
|
267
|
+
return WebhookUtils(client)
|
|
273
268
|
|
|
274
269
|
|
|
275
270
|
@pytest.fixture(scope="session")
|
|
276
|
-
def
|
|
271
|
+
def gitlab_integration(integration_utils):
|
|
277
272
|
integration = integration_utils.create_integration(
|
|
278
273
|
credential_type=CredentialTypes.GIT,
|
|
279
|
-
credential_values=CredentialsManager.
|
|
274
|
+
credential_values=CredentialsManager.gitlab_credentials(),
|
|
280
275
|
)
|
|
281
276
|
yield integration
|
|
282
277
|
if integration:
|
|
@@ -284,10 +279,10 @@ def github_integration(integration_utils):
|
|
|
284
279
|
|
|
285
280
|
|
|
286
281
|
@pytest.fixture(scope="session")
|
|
287
|
-
def
|
|
282
|
+
def github_integration(integration_utils):
|
|
288
283
|
integration = integration_utils.create_integration(
|
|
289
284
|
credential_type=CredentialTypes.GIT,
|
|
290
|
-
credential_values=CredentialsManager.
|
|
285
|
+
credential_values=CredentialsManager.github_credentials(),
|
|
291
286
|
)
|
|
292
287
|
yield integration
|
|
293
288
|
if integration:
|
|
@@ -416,6 +411,33 @@ def report_portal_integration(integration_utils):
|
|
|
416
411
|
integration_utils.delete_integration(integration)
|
|
417
412
|
|
|
418
413
|
|
|
414
|
+
@pytest.fixture(scope="module")
|
|
415
|
+
def webhook_integration(integration_utils):
|
|
416
|
+
created_integrations = []
|
|
417
|
+
|
|
418
|
+
def _create(webhook_id, resource_type, resource_id, is_enabled: bool = True):
|
|
419
|
+
credential_values = [
|
|
420
|
+
CredentialValues(key="url", value=CredentialsManager.AUTO_GENERATED),
|
|
421
|
+
CredentialValues(key="webhook_id", value=webhook_id),
|
|
422
|
+
CredentialValues(key="is_enabled", value=is_enabled),
|
|
423
|
+
CredentialValues(key="resource_type", value=resource_type),
|
|
424
|
+
CredentialValues(key="resource_id", value=resource_id),
|
|
425
|
+
]
|
|
426
|
+
integration = integration_utils.create_integration(
|
|
427
|
+
CredentialTypes.WEBHOOK, credential_values
|
|
428
|
+
)
|
|
429
|
+
created_integrations.append(integration)
|
|
430
|
+
return integration
|
|
431
|
+
|
|
432
|
+
yield _create
|
|
433
|
+
|
|
434
|
+
for integration in created_integrations:
|
|
435
|
+
try:
|
|
436
|
+
integration_utils.delete_integration(integration)
|
|
437
|
+
except HTTPError:
|
|
438
|
+
pass
|
|
439
|
+
|
|
440
|
+
|
|
419
441
|
@pytest.fixture(scope="function")
|
|
420
442
|
def general_integration(integration_utils):
|
|
421
443
|
created_integration: Optional[Integration] = None
|
|
@@ -65,14 +65,14 @@ def test_assistant_with_code_kb(
|
|
|
65
65
|
reason="Test is skipped when GIT_ENV is set to github",
|
|
66
66
|
)
|
|
67
67
|
def test_assistant_with_vcs_gitlab_tool(
|
|
68
|
-
assistant_utils,
|
|
68
|
+
assistant_utils, git_integration, default_llm, similarity_check
|
|
69
69
|
):
|
|
70
70
|
assistant = assistant_utils.create_assistant(
|
|
71
71
|
llm_model_type=default_llm.base_name,
|
|
72
72
|
toolkits=[
|
|
73
73
|
ToolKitDetails(
|
|
74
74
|
toolkit=Toolkit.VCS,
|
|
75
|
-
tools=[ToolDetails(name=VcsTool.GITLAB, settings=
|
|
75
|
+
tools=[ToolDetails(name=VcsTool.GITLAB, settings=git_integration)],
|
|
76
76
|
)
|
|
77
77
|
],
|
|
78
78
|
)
|
|
@@ -29,8 +29,8 @@ import pytest
|
|
|
29
29
|
from codemie_test_harness.tests.ui.pageobject.assistants.assistants_page import (
|
|
30
30
|
AssistantsPage,
|
|
31
31
|
)
|
|
32
|
-
from codemie_test_harness.tests.ui.pageobject.assistants.
|
|
33
|
-
|
|
32
|
+
from codemie_test_harness.tests.ui.pageobject.assistants.create_edit_assistant_page import (
|
|
33
|
+
CreateEditAssistantPage,
|
|
34
34
|
)
|
|
35
35
|
from codemie_test_harness.tests.ui.test_data.assistant_test_data import (
|
|
36
36
|
get_minimal_assistant_data,
|
|
@@ -56,7 +56,7 @@ class TestCreateAssistantPageElements:
|
|
|
56
56
|
- Action buttons (create, cancel)
|
|
57
57
|
- Common page components (header, navigation)
|
|
58
58
|
"""
|
|
59
|
-
create_page =
|
|
59
|
+
create_page = CreateEditAssistantPage(page)
|
|
60
60
|
create_page.navigate_to()
|
|
61
61
|
|
|
62
62
|
# Verify we are on the correct page
|
|
@@ -95,7 +95,7 @@ class TestCreateAssistantPageElements:
|
|
|
95
95
|
assistants_page.click_create_assistant()
|
|
96
96
|
|
|
97
97
|
# Verify we're on the create assistant page
|
|
98
|
-
create_page =
|
|
98
|
+
create_page = CreateEditAssistantPage(page)
|
|
99
99
|
create_page.should_be_on_create_assistant_page()
|
|
100
100
|
|
|
101
101
|
@pytest.mark.assistant
|
|
@@ -113,7 +113,7 @@ class TestCreateAssistantPageElements:
|
|
|
113
113
|
3. Verify modal can be closed or handled appropriately
|
|
114
114
|
4. Ensure manual form is accessible after modal handling
|
|
115
115
|
"""
|
|
116
|
-
create_page =
|
|
116
|
+
create_page = CreateEditAssistantPage(page)
|
|
117
117
|
|
|
118
118
|
# Navigate to create assistant page - this will handle the modal automatically
|
|
119
119
|
create_page.navigate_to()
|
|
@@ -140,7 +140,7 @@ class TestCreateAssistantPageElements:
|
|
|
140
140
|
3. Verify modal closes and manual form is accessible
|
|
141
141
|
4. Proceed with manual assistant creation
|
|
142
142
|
"""
|
|
143
|
-
create_page =
|
|
143
|
+
create_page = CreateEditAssistantPage(page)
|
|
144
144
|
|
|
145
145
|
# Navigate without automatic modal handling
|
|
146
146
|
page.goto(create_page.page_url)
|
|
@@ -168,7 +168,7 @@ class TestCreateAssistantFormInteractions:
|
|
|
168
168
|
|
|
169
169
|
@pytest.mark.assistant
|
|
170
170
|
@pytest.mark.ui
|
|
171
|
-
def test_create_assistant_form_field_interactions(self, page):
|
|
171
|
+
def test_create_assistant_form_field_interactions(self, page, client):
|
|
172
172
|
"""
|
|
173
173
|
Test form field interactions and input handling.
|
|
174
174
|
|
|
@@ -182,7 +182,7 @@ class TestCreateAssistantFormInteractions:
|
|
|
182
182
|
- Icon URL input
|
|
183
183
|
- Shared toggle switch
|
|
184
184
|
"""
|
|
185
|
-
create_page =
|
|
185
|
+
create_page = CreateEditAssistantPage(page)
|
|
186
186
|
create_page.navigate_to()
|
|
187
187
|
|
|
188
188
|
# Test shared toggle interaction
|
|
@@ -232,7 +232,7 @@ class TestCreateAssistantFormInteractions:
|
|
|
232
232
|
- Unchecked shared toggle
|
|
233
233
|
- Default assistant type selection
|
|
234
234
|
"""
|
|
235
|
-
create_page =
|
|
235
|
+
create_page = CreateEditAssistantPage(page)
|
|
236
236
|
create_page.navigate_to()
|
|
237
237
|
|
|
238
238
|
# Verify default empty field values
|
|
@@ -273,7 +273,7 @@ class TestCreateAssistantCriticalHappyPath:
|
|
|
273
273
|
test_data = get_minimal_assistant_data()
|
|
274
274
|
|
|
275
275
|
# Navigate to create assistant page
|
|
276
|
-
create_page =
|
|
276
|
+
create_page = CreateEditAssistantPage(page)
|
|
277
277
|
create_page.navigate_to()
|
|
278
278
|
|
|
279
279
|
# Use the comprehensive create_assistant method with test data
|
|
@@ -297,7 +297,7 @@ class TestCreateAssistantCriticalHappyPath:
|
|
|
297
297
|
This test ensures that the form validation works correctly and provides
|
|
298
298
|
appropriate feedback to users about required fields.
|
|
299
299
|
"""
|
|
300
|
-
create_page =
|
|
300
|
+
create_page = CreateEditAssistantPage(page)
|
|
301
301
|
create_page.navigate_to()
|
|
302
302
|
|
|
303
303
|
# Get test data using the factory
|
|
@@ -333,7 +333,7 @@ class TestCreateAssistantNavigation:
|
|
|
333
333
|
3. Click Cancel button
|
|
334
334
|
4. Verify return to Assistants page
|
|
335
335
|
"""
|
|
336
|
-
create_page =
|
|
336
|
+
create_page = CreateEditAssistantPage(page)
|
|
337
337
|
create_page.navigate_to()
|
|
338
338
|
|
|
339
339
|
# Get test data using the factory
|
|
@@ -371,7 +371,7 @@ class TestCreateAssistantNavigation:
|
|
|
371
371
|
assistants_page.click_create_assistant()
|
|
372
372
|
|
|
373
373
|
# Now on create assistant page
|
|
374
|
-
create_page =
|
|
374
|
+
create_page = CreateEditAssistantPage(page)
|
|
375
375
|
create_page.should_be_on_create_assistant_page()
|
|
376
376
|
create_page.handle_ai_generator_modal_if_visible()
|
|
377
377
|
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import pytest
|
|
2
|
+
from tests import TEST_USER, PROJECT
|
|
3
|
+
from tests.ui.pageobject.assistants.assistant_view_page import AssistantViewPage
|
|
4
|
+
|
|
5
|
+
from tests.ui.pageobject.assistants.assistants_page import (
|
|
6
|
+
AssistantsPage,
|
|
7
|
+
)
|
|
8
|
+
from codemie_test_harness.tests.ui.test_data.assistant_test_data import (
|
|
9
|
+
ExternalToolKit,
|
|
10
|
+
MCPServersTool,
|
|
11
|
+
get_minimal_assistant_mcp_config_data,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from tests.ui.test_data.assistant_test_data import (
|
|
16
|
+
TOOLKIT_TOOLS,
|
|
17
|
+
AssistantPopUpMessages,
|
|
18
|
+
AssistantValidationErrors,
|
|
19
|
+
)
|
|
20
|
+
from tests.ui.pageobject.assistants.create_edit_assistant_page import (
|
|
21
|
+
CreateEditAssistantPage,
|
|
22
|
+
)
|
|
23
|
+
from tests.utils.base_utils import get_random_name
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@pytest.mark.assistant_ui
|
|
27
|
+
@pytest.mark.ui
|
|
28
|
+
def test_edit_assistant_page_elements_visibility(page, assistant):
|
|
29
|
+
"""
|
|
30
|
+
Test all main elements are visible on Edit Assistant page—fields, toolkits, checkboxes, etc.
|
|
31
|
+
"""
|
|
32
|
+
edit_page = CreateEditAssistantPage(page)
|
|
33
|
+
assistant_page = AssistantsPage(page)
|
|
34
|
+
assistant = assistant()
|
|
35
|
+
|
|
36
|
+
assistant_page.navigate_to()
|
|
37
|
+
assistant_page.search_assistants(assistant.name)
|
|
38
|
+
assistant_page.click_assistant_edit(assistant.name)
|
|
39
|
+
|
|
40
|
+
edit_page.should_have_all_form_fields_visible()
|
|
41
|
+
edit_page.should_have_top_p_and_temperature()
|
|
42
|
+
edit_page.should_have_datasource_context()
|
|
43
|
+
edit_page.should_have_sub_assistants_context()
|
|
44
|
+
edit_page.should_have_categories_visible()
|
|
45
|
+
|
|
46
|
+
for section, toolkits in TOOLKIT_TOOLS.items():
|
|
47
|
+
edit_page.select_section(section.value)
|
|
48
|
+
for toolkit, tools in toolkits.items():
|
|
49
|
+
edit_page.select_toolkit(section.value, toolkit.value)
|
|
50
|
+
for tool in tools:
|
|
51
|
+
edit_page.should_be_visible_tool(tool.value)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
@pytest.mark.assistant_ui
|
|
55
|
+
@pytest.mark.ui
|
|
56
|
+
def test_edit_assistant_form_field_interactions(page, assistant):
|
|
57
|
+
"""
|
|
58
|
+
Test interacting with all editable form fields.
|
|
59
|
+
"""
|
|
60
|
+
EDITED = " EDITED"
|
|
61
|
+
edit_page = CreateEditAssistantPage(page)
|
|
62
|
+
view_page = AssistantViewPage(page)
|
|
63
|
+
assistant_page = AssistantsPage(page)
|
|
64
|
+
assistant = assistant()
|
|
65
|
+
|
|
66
|
+
assistant_page.navigate_to()
|
|
67
|
+
assistant_page.search_assistants(assistant.name)
|
|
68
|
+
assistant_page.click_assistant_edit(assistant.name)
|
|
69
|
+
|
|
70
|
+
edit_page.fill_name(assistant.name + EDITED)
|
|
71
|
+
edit_page.should_have_name_value(assistant.name + EDITED)
|
|
72
|
+
edit_page.fill_description(assistant.description + EDITED)
|
|
73
|
+
edit_page.should_have_description_value(assistant.description + EDITED)
|
|
74
|
+
|
|
75
|
+
edit_page.toggle_shared_assistant(True)
|
|
76
|
+
edit_page.should_have_shared_checked()
|
|
77
|
+
edit_page.toggle_shared_assistant(False)
|
|
78
|
+
edit_page.should_have_shared_unchecked()
|
|
79
|
+
|
|
80
|
+
edit_page.fill_temperature("0.5")
|
|
81
|
+
edit_page.fill_top_p("0.5")
|
|
82
|
+
edit_page.should_have_top_p_and_temperature_value("0.5", "0.5")
|
|
83
|
+
edit_page.click_save()
|
|
84
|
+
assistant_page.should_see_updating_popup(
|
|
85
|
+
AssistantPopUpMessages.ASSISTANT_UPDATED_SUCCESS.value
|
|
86
|
+
)
|
|
87
|
+
assistant_page.should_see_assistant_with_name(assistant.name + EDITED)
|
|
88
|
+
|
|
89
|
+
assistant_page.click_assistant_view(assistant.name + EDITED)
|
|
90
|
+
view_page.should_have_all_form_fields_visible(
|
|
91
|
+
name=assistant.name + EDITED,
|
|
92
|
+
author=TEST_USER,
|
|
93
|
+
description=assistant.description + EDITED,
|
|
94
|
+
)
|
|
95
|
+
view_page.should_have_overview_form_fields_visible(
|
|
96
|
+
project=PROJECT, status="Not shared", assistant_id=assistant.id
|
|
97
|
+
)
|
|
98
|
+
view_page.should_have_access_links_form_fields_visible(
|
|
99
|
+
assistant_id=assistant.id, assistant_name=assistant.name
|
|
100
|
+
)
|
|
101
|
+
view_page.should_have_configuration_form_fields_visible(
|
|
102
|
+
temperature="0.5", top_p="0.5"
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
@pytest.mark.assistant_ui
|
|
107
|
+
@pytest.mark.ui
|
|
108
|
+
def test_edit_assistant_tools_interactions(page, assistant):
|
|
109
|
+
"""
|
|
110
|
+
Test interacting with all tools in assistant.
|
|
111
|
+
"""
|
|
112
|
+
edit_page = CreateEditAssistantPage(page)
|
|
113
|
+
view_page = AssistantViewPage(page)
|
|
114
|
+
assistant_page = AssistantsPage(page)
|
|
115
|
+
assistant = assistant()
|
|
116
|
+
|
|
117
|
+
assistant_page.navigate_to()
|
|
118
|
+
assistant_page.search_assistants(assistant.name)
|
|
119
|
+
assistant_page.click_assistant_edit(assistant.name)
|
|
120
|
+
|
|
121
|
+
for section, toolkits in TOOLKIT_TOOLS.items():
|
|
122
|
+
edit_page.select_section(section.value)
|
|
123
|
+
for toolkit, tools in toolkits.items():
|
|
124
|
+
edit_page.select_toolkit(section.value, toolkit.value)
|
|
125
|
+
for tool in tools:
|
|
126
|
+
edit_page.select_tool(tool.value)
|
|
127
|
+
edit_page.click_save()
|
|
128
|
+
assistant_page.should_see_updating_popup(
|
|
129
|
+
AssistantPopUpMessages.ASSISTANT_UPDATED_SUCCESS.value
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
assistant_page.click_assistant_view(assistant.name)
|
|
133
|
+
for section, toolkits in TOOLKIT_TOOLS.items():
|
|
134
|
+
for toolkit, tools in toolkits.items():
|
|
135
|
+
toolkit_label = toolkit.value
|
|
136
|
+
if ExternalToolKit.MCP_SERVERS.value in toolkit.value:
|
|
137
|
+
toolkit_label = "MCP"
|
|
138
|
+
view_page.should_see_toolkit_visible(toolkit_label)
|
|
139
|
+
for tool in tools:
|
|
140
|
+
test_data = get_minimal_assistant_mcp_config_data()
|
|
141
|
+
tool_label = tool.value
|
|
142
|
+
if MCPServersTool.ADD_MCP_SERVER.value in tool.value:
|
|
143
|
+
tool_label = test_data.name
|
|
144
|
+
view_page.should_see_toolkit_contains(toolkit_label, tool_label)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
@pytest.mark.assistant_ui
|
|
148
|
+
@pytest.mark.ui
|
|
149
|
+
def test_edit_assistant_incorrect_form(page, assistant):
|
|
150
|
+
"""
|
|
151
|
+
Test interacting with incorrect data.
|
|
152
|
+
"""
|
|
153
|
+
edit_page = CreateEditAssistantPage(page)
|
|
154
|
+
assistant_page = AssistantsPage(page)
|
|
155
|
+
assistant = assistant()
|
|
156
|
+
|
|
157
|
+
assistant_page.navigate_to()
|
|
158
|
+
assistant_page.search_assistants(assistant.name)
|
|
159
|
+
assistant_page.click_assistant_edit(assistant.name)
|
|
160
|
+
|
|
161
|
+
edit_page.fill_name("")
|
|
162
|
+
edit_page.should_have_name_error_textarea(
|
|
163
|
+
AssistantValidationErrors.NAME_REQUIRED.value
|
|
164
|
+
)
|
|
165
|
+
edit_page.fill_name(get_random_name())
|
|
166
|
+
|
|
167
|
+
edit_page.fill_icon_url(get_random_name())
|
|
168
|
+
edit_page.should_have_icon_error_textarea(
|
|
169
|
+
AssistantValidationErrors.ICON_URL_NOT_VALID.value
|
|
170
|
+
)
|
|
171
|
+
edit_page.fill_icon_url("")
|
|
172
|
+
|
|
173
|
+
edit_page.fill_description("")
|
|
174
|
+
edit_page.should_have_description_error_textarea(
|
|
175
|
+
AssistantValidationErrors.DESCRIPTION_REQUIRED.value
|
|
176
|
+
)
|
|
177
|
+
edit_page.fill_description(get_random_name())
|
|
178
|
+
|
|
179
|
+
edit_page.fill_system_prompt("")
|
|
180
|
+
edit_page.should_have_system_prompt_error_textarea(
|
|
181
|
+
AssistantValidationErrors.SYSTEM_PROMPT_REQUIRED.value
|
|
182
|
+
)
|
|
183
|
+
edit_page.fill_system_prompt(get_random_name())
|
|
184
|
+
|
|
185
|
+
edit_page.fill_temperature("3")
|
|
186
|
+
edit_page.should_have_temperature_error_textarea(
|
|
187
|
+
AssistantValidationErrors.TEMPERATURE_NOT_VALID.value
|
|
188
|
+
)
|
|
189
|
+
edit_page.fill_temperature("1")
|
|
190
|
+
|
|
191
|
+
edit_page.fill_top_p("2")
|
|
192
|
+
edit_page.should_have_top_p_error_textarea(
|
|
193
|
+
AssistantValidationErrors.TOP_P_NOT_VALID.value
|
|
194
|
+
)
|
|
195
|
+
edit_page.fill_top_p("1")
|
|
196
|
+
|
|
197
|
+
edit_page.click_save()
|
|
198
|
+
assistant_page.should_see_updating_popup(
|
|
199
|
+
AssistantPopUpMessages.ASSISTANT_UPDATED_SUCCESS.value
|
|
200
|
+
)
|
|
@@ -79,7 +79,7 @@ def test_datasource_creation_validation(page):
|
|
|
79
79
|
|
|
80
80
|
@pytest.mark.datasource
|
|
81
81
|
@pytest.mark.ui
|
|
82
|
-
def test_create_git_datasource(page,
|
|
82
|
+
def test_create_git_datasource(page, gitlab_integration):
|
|
83
83
|
"""Test creating a new datasource with all required fields."""
|
|
84
84
|
datasource_page = DataSourcePage(page)
|
|
85
85
|
create_page = CreateEditDatasourcePage(page)
|
|
@@ -89,7 +89,7 @@ def test_create_git_datasource(page, git_integration):
|
|
|
89
89
|
project_name=PROJECT,
|
|
90
90
|
repo_link=CredentialsManager.get_parameter("GITLAB_PROJECT"),
|
|
91
91
|
branch="main",
|
|
92
|
-
integration=
|
|
92
|
+
integration=gitlab_integration.alias,
|
|
93
93
|
)
|
|
94
94
|
|
|
95
95
|
datasource_page.should_see_table_row_with_values(
|
|
@@ -22,14 +22,14 @@ from codemie_test_harness.tests.utils.constants import FILES_PATH
|
|
|
22
22
|
@pytest.mark.datasource
|
|
23
23
|
@pytest.mark.ui
|
|
24
24
|
def test_edit_git_datasource(
|
|
25
|
-
page, datasource_utils,
|
|
25
|
+
page, datasource_utils, gitlab_integration, default_embedding_llm
|
|
26
26
|
):
|
|
27
27
|
"""Test that all main Edit Datasource page elements are visible."""
|
|
28
28
|
datasource_page = DataSourcePage(page)
|
|
29
29
|
edit_page = CreateEditDatasourcePage(page)
|
|
30
30
|
|
|
31
31
|
datasource = datasource_utils.create_gitlab_datasource(
|
|
32
|
-
setting_id=
|
|
32
|
+
setting_id=gitlab_integration.id,
|
|
33
33
|
embeddings_model=default_embedding_llm.base_name,
|
|
34
34
|
)
|
|
35
35
|
|
|
@@ -23,13 +23,13 @@ from codemie_test_harness.tests.utils.constants import FILES_PATH
|
|
|
23
23
|
@pytest.mark.datasource
|
|
24
24
|
@pytest.mark.ui
|
|
25
25
|
def test_view_git_datasource_page(
|
|
26
|
-
page, datasource_utils,
|
|
26
|
+
page, datasource_utils, gitlab_integration, default_embedding_llm, client
|
|
27
27
|
):
|
|
28
28
|
"""Test that all main View Datasource page elements are visible."""
|
|
29
29
|
datasource_page = DataSourcePage(page)
|
|
30
30
|
view_page = ViewDatasourcePage(page)
|
|
31
31
|
datasource = datasource_utils.create_gitlab_datasource(
|
|
32
|
-
setting_id=
|
|
32
|
+
setting_id=gitlab_integration.id,
|
|
33
33
|
embeddings_model=default_embedding_llm.base_name,
|
|
34
34
|
)
|
|
35
35
|
|