codemie-test-harness 0.1.181__py3-none-any.whl → 0.1.183__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_file_indexing.py +2 -1
- codemie_test_harness/tests/ui/__init__.py +1 -0
- codemie_test_harness/tests/ui/assistants/test_create_assistant.py +3 -11
- codemie_test_harness/tests/ui/chats/conftest.py +14 -0
- codemie_test_harness/tests/ui/chats/test_chat_configuration.py +221 -0
- codemie_test_harness/tests/ui/chats/test_chat_functionality.py +222 -0
- codemie_test_harness/tests/ui/conftest.py +25 -4
- codemie_test_harness/tests/ui/datasource/test_create_datasource.py +8 -8
- codemie_test_harness/tests/ui/datasource/test_datasource_page.py +3 -3
- codemie_test_harness/tests/ui/datasource/test_edit_datasource.py +7 -6
- codemie_test_harness/tests/ui/datasource/test_view_datasource.py +6 -7
- codemie_test_harness/tests/ui/integrations/test_create_integration.py +3 -3
- codemie_test_harness/tests/ui/pageobject/base_page.py +12 -1
- codemie_test_harness/tests/ui/pageobject/chats/chat_page.py +622 -0
- codemie_test_harness/tests/ui/pageobject/chats/chats_sidebar.py +489 -0
- codemie_test_harness/tests/ui/pageobject/chats/configuration_panel.py +228 -0
- codemie_test_harness/tests/ui/pageobject/chats/configure_and_test_panel.py +102 -0
- codemie_test_harness/tests/ui/pageobject/datasources/create_edit_datasource_page.py +9 -8
- codemie_test_harness/tests/ui/pageobject/datasources/datasource_page.py +4 -4
- codemie_test_harness/tests/ui/pageobject/datasources/datasource_sidebar.py +4 -3
- codemie_test_harness/tests/ui/pageobject/integrations/create_integration_page.py +2 -2
- codemie_test_harness/tests/ui/{_test_data → test_data}/assistant_test_data.py +2 -0
- codemie_test_harness/tests/ui/test_data/chat_test_data.py +98 -0
- codemie_test_harness/tests/workflow/assistant_tools/mcp/test_workflow_with_assistant_with_mcp_server.py +3 -5
- codemie_test_harness/tests/workflow/virtual_assistant_tools/mcp/test_workflow_with_mcp_server.py +3 -4
- {codemie_test_harness-0.1.181.dist-info → codemie_test_harness-0.1.183.dist-info}/METADATA +2 -2
- {codemie_test_harness-0.1.181.dist-info → codemie_test_harness-0.1.183.dist-info}/RECORD +32 -24
- /codemie_test_harness/tests/ui/{_test_data → test_data}/__init__.py +0 -0
- /codemie_test_harness/tests/ui/{_test_data → test_data}/datasource_test_data.py +0 -0
- /codemie_test_harness/tests/ui/{_test_data → test_data}/integration_test_data.py +0 -0
- {codemie_test_harness-0.1.181.dist-info → codemie_test_harness-0.1.183.dist-info}/WHEEL +0 -0
- {codemie_test_harness-0.1.181.dist-info → codemie_test_harness-0.1.183.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Chat Configuration Panel Component for CodeMie UI Testing
|
|
3
|
+
|
|
4
|
+
This module implements the chat configuration side panel component following the established
|
|
5
|
+
POM patterns. It provides comprehensive support for configuration management including
|
|
6
|
+
LLM engine selection, assistant management, and configuration testing.
|
|
7
|
+
|
|
8
|
+
Architecture follows the same patterns as other panel components:
|
|
9
|
+
- Property-based element locators with precise unique selectors
|
|
10
|
+
- Method chaining support for fluent API
|
|
11
|
+
- ReportPortal integration via @step decorators
|
|
12
|
+
- Comprehensive verification methods
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
from playwright.sync_api import expect, Locator
|
|
16
|
+
from reportportal_client import step
|
|
17
|
+
|
|
18
|
+
from codemie_test_harness.tests.ui.pageobject.chats.configure_and_test_panel import (
|
|
19
|
+
ConfigureAndTestPanel,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class ConfigurationPanel:
|
|
24
|
+
"""
|
|
25
|
+
Chat configuration side panel component with comprehensive configuration management.
|
|
26
|
+
|
|
27
|
+
This component handles all configuration-related interactions including:
|
|
28
|
+
- Managing LLM engine selection
|
|
29
|
+
- Interacting with connected assistants
|
|
30
|
+
- Configuring and testing assistants
|
|
31
|
+
- Verification of configuration states
|
|
32
|
+
|
|
33
|
+
Follows established POM patterns with property-based locators.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
def __init__(self, page):
|
|
37
|
+
self.page = page
|
|
38
|
+
|
|
39
|
+
# ==================== PANEL CONTAINER ELEMENTS ====================
|
|
40
|
+
|
|
41
|
+
@property
|
|
42
|
+
def panel(self) -> Locator:
|
|
43
|
+
"""Main configuration panel container."""
|
|
44
|
+
# Using data-v attribute with class combination for uniqueness
|
|
45
|
+
return self.page.locator(".chat-info")
|
|
46
|
+
|
|
47
|
+
@property
|
|
48
|
+
def general_section(self) -> Locator:
|
|
49
|
+
"""General configuration section."""
|
|
50
|
+
return self.panel.locator("h3").filter(has_text="General")
|
|
51
|
+
|
|
52
|
+
@property
|
|
53
|
+
def connected_assistants_section(self) -> Locator:
|
|
54
|
+
"""Connected Assistants section."""
|
|
55
|
+
return self.panel.locator("div").filter(has_text="Connected Assistants")
|
|
56
|
+
|
|
57
|
+
# ==================== LLM ENGINE CONFIGURATION ====================
|
|
58
|
+
|
|
59
|
+
@property
|
|
60
|
+
def primary_llm_engine_label(self) -> Locator:
|
|
61
|
+
"""Primary LLM Engine label."""
|
|
62
|
+
return self.panel.locator('label[for="model_type"].text-xs.text-text-tertiary')
|
|
63
|
+
|
|
64
|
+
@property
|
|
65
|
+
def primary_llm_engine_dropdown(self) -> Locator:
|
|
66
|
+
"""Primary LLM Engine dropdown selector."""
|
|
67
|
+
return self.panel.locator('div.p-multiselect[id="model_type"]')
|
|
68
|
+
|
|
69
|
+
@property
|
|
70
|
+
def llm_engine_dropdown_trigger(self) -> Locator:
|
|
71
|
+
"""LLM Engine dropdown trigger button."""
|
|
72
|
+
return self.primary_llm_engine_dropdown.locator(
|
|
73
|
+
'div[data-pc-section="trigger"]'
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
@property
|
|
77
|
+
def llm_engine_current_selection(self) -> Locator:
|
|
78
|
+
"""Current LLM Engine selection display."""
|
|
79
|
+
return self.primary_llm_engine_dropdown.locator('div[data-pc-section="label"]')
|
|
80
|
+
|
|
81
|
+
# ==================== ASSISTANT LIST ELEMENTS ====================
|
|
82
|
+
class ConnectedAssistantCard:
|
|
83
|
+
def __init__(self, page, title: str):
|
|
84
|
+
self.page = page
|
|
85
|
+
# Target assistant card by finding the card that contains the title
|
|
86
|
+
self.assistant_card = self.page.locator(".assistant-list-item").filter(
|
|
87
|
+
has=self.page.locator(".font-semibold.text-base").filter(
|
|
88
|
+
has_text=f"{title}"
|
|
89
|
+
)
|
|
90
|
+
)
|
|
91
|
+
# ID field is the element with tooltip that contains the ID
|
|
92
|
+
self.id_field = self.assistant_card.locator(
|
|
93
|
+
"div.text-text-tertiary[data-pd-tooltip]"
|
|
94
|
+
).first
|
|
95
|
+
# Link field is the assistant link element with tooltip
|
|
96
|
+
self.link_field = self.assistant_card.locator(
|
|
97
|
+
"div.assistant-link[data-pd-tooltip]"
|
|
98
|
+
)
|
|
99
|
+
# Config button is the button with "Configure & Test" text
|
|
100
|
+
self.config_button = self.assistant_card.locator("button").filter(
|
|
101
|
+
has_text="Configure"
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
@property
|
|
105
|
+
def assistant_list(self) -> Locator:
|
|
106
|
+
"""Container for all assistant list items."""
|
|
107
|
+
return self.panel.locator("div.assistant-list")
|
|
108
|
+
|
|
109
|
+
# ==================== PANEL INTERACTION METHODS ====================
|
|
110
|
+
|
|
111
|
+
@step
|
|
112
|
+
def open_llm_engine_dropdown(self):
|
|
113
|
+
"""Open the Primary LLM Engine dropdown."""
|
|
114
|
+
if self.primary_llm_engine_dropdown.is_visible():
|
|
115
|
+
self.llm_engine_dropdown_trigger.click()
|
|
116
|
+
self.page.wait_for_timeout(1000)
|
|
117
|
+
return self
|
|
118
|
+
|
|
119
|
+
@step
|
|
120
|
+
def select_llm_engine_option(self, llm_name: str):
|
|
121
|
+
"""Select an option from the LLM Engine dropdown."""
|
|
122
|
+
self.open_llm_engine_dropdown()
|
|
123
|
+
|
|
124
|
+
search_input = self.page.locator(".p-multiselect-filter")
|
|
125
|
+
search_input.fill(llm_name)
|
|
126
|
+
option_item = self.page.locator(f'[aria-label="{llm_name}"]')
|
|
127
|
+
if option_item.is_visible():
|
|
128
|
+
option_item.click()
|
|
129
|
+
else:
|
|
130
|
+
raise Exception(f"'{llm_name} LLM is not found!")
|
|
131
|
+
|
|
132
|
+
return self
|
|
133
|
+
|
|
134
|
+
@step
|
|
135
|
+
def open_assistant_configuration(self, assistant_name: str):
|
|
136
|
+
assistant_card = self.ConnectedAssistantCard(
|
|
137
|
+
page=self.page, title=assistant_name
|
|
138
|
+
)
|
|
139
|
+
assistant_card.config_button.click()
|
|
140
|
+
return ConfigureAndTestPanel(self.page)
|
|
141
|
+
|
|
142
|
+
# ==================== VERIFICATION METHODS ====================
|
|
143
|
+
|
|
144
|
+
@step
|
|
145
|
+
def should_be_visible(self):
|
|
146
|
+
"""Verify that the configuration panel is visible."""
|
|
147
|
+
expect(self.panel).to_be_visible()
|
|
148
|
+
return self
|
|
149
|
+
|
|
150
|
+
@step
|
|
151
|
+
def should_be_hidden(self):
|
|
152
|
+
"""Verify that the configuration panel is hidden."""
|
|
153
|
+
expect(self.panel).to_be_hidden()
|
|
154
|
+
return self
|
|
155
|
+
|
|
156
|
+
@step
|
|
157
|
+
def should_have_general_section_visible(self):
|
|
158
|
+
"""Verify that the General section is visible."""
|
|
159
|
+
expect(self.general_section).to_be_visible()
|
|
160
|
+
return self
|
|
161
|
+
|
|
162
|
+
@step
|
|
163
|
+
def should_have_connected_assistants_section_visible(self):
|
|
164
|
+
"""Verify that the Connected Assistants section is visible."""
|
|
165
|
+
expect(self.connected_assistants_section).to_be_visible()
|
|
166
|
+
return self
|
|
167
|
+
|
|
168
|
+
@step
|
|
169
|
+
def should_have_llm_engine_dropdown_visible(self):
|
|
170
|
+
"""Verify that the Primary LLM Engine dropdown is visible."""
|
|
171
|
+
expect(self.primary_llm_engine_dropdown).to_be_visible()
|
|
172
|
+
return self
|
|
173
|
+
|
|
174
|
+
@step
|
|
175
|
+
def should_have_llm_engine_selection(self, expected_text: str):
|
|
176
|
+
"""
|
|
177
|
+
Verify the LLM Engine dropdown shows expected selection.
|
|
178
|
+
|
|
179
|
+
Args:
|
|
180
|
+
expected_text: Expected selection text (e.g., "Default: GPT-4.1 2025-04-14")
|
|
181
|
+
"""
|
|
182
|
+
expect(self.llm_engine_current_selection).to_contain_text(expected_text)
|
|
183
|
+
return self
|
|
184
|
+
|
|
185
|
+
@step
|
|
186
|
+
def should_have_assistant_list_visible(
|
|
187
|
+
self,
|
|
188
|
+
):
|
|
189
|
+
expect(self.assistant_list).to_be_visible()
|
|
190
|
+
return self
|
|
191
|
+
|
|
192
|
+
@step
|
|
193
|
+
def should_have_assistant_visible(self, assistant_name: str):
|
|
194
|
+
"""
|
|
195
|
+
Verify that a specific assistant is visible.
|
|
196
|
+
|
|
197
|
+
Args:
|
|
198
|
+
assistant_name: Name of the assistant to verify
|
|
199
|
+
"""
|
|
200
|
+
assistant_card = self.ConnectedAssistantCard(
|
|
201
|
+
page=self.page, title=assistant_name
|
|
202
|
+
)
|
|
203
|
+
expect(assistant_card.id_field).to_be_visible()
|
|
204
|
+
expect(assistant_card.link_field).to_be_visible()
|
|
205
|
+
expect(assistant_card.config_button).to_be_visible()
|
|
206
|
+
return self
|
|
207
|
+
|
|
208
|
+
@step
|
|
209
|
+
def should_have_all_sections_visible(self):
|
|
210
|
+
"""Verify that all main panel sections are visible."""
|
|
211
|
+
self.should_have_general_section_visible()
|
|
212
|
+
self.should_have_connected_assistants_section_visible()
|
|
213
|
+
self.should_have_llm_engine_dropdown_visible()
|
|
214
|
+
self.should_have_assistant_list_visible()
|
|
215
|
+
self.should_have_assistant_visible("AI/Run Chatbot")
|
|
216
|
+
return self
|
|
217
|
+
|
|
218
|
+
# ==================== UTILITY METHODS ====================
|
|
219
|
+
|
|
220
|
+
@step
|
|
221
|
+
def is_visible(self) -> bool:
|
|
222
|
+
"""Check if the configuration panel is currently visible."""
|
|
223
|
+
return self.panel.is_visible()
|
|
224
|
+
|
|
225
|
+
@step
|
|
226
|
+
def get_current_llm_engine_selection(self) -> str:
|
|
227
|
+
"""Get the current LLM Engine selection text."""
|
|
228
|
+
return self.llm_engine_current_selection.text_content()
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Assistant Configure & Test Panel Component for CodeMie UI Testing
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from playwright.sync_api import expect, Locator
|
|
6
|
+
from reportportal_client import step
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ConfigureAndTestPanel:
|
|
10
|
+
"""
|
|
11
|
+
Assistant Configure & Test side panel component with comprehensive configuration management.
|
|
12
|
+
|
|
13
|
+
This component handles all configuration-related interactions including.
|
|
14
|
+
|
|
15
|
+
Follows established POM patterns with property-based locators.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
def __init__(self, page):
|
|
19
|
+
self.page = page
|
|
20
|
+
|
|
21
|
+
# ==================== PANEL CONTAINER ELEMENTS ====================
|
|
22
|
+
|
|
23
|
+
@property
|
|
24
|
+
def panel(self) -> Locator:
|
|
25
|
+
"""Panel main container."""
|
|
26
|
+
return self.page.locator(".h-full .bg-sidebar")
|
|
27
|
+
|
|
28
|
+
@property
|
|
29
|
+
def panel_title(self) -> Locator:
|
|
30
|
+
return self.panel.locator("h4")
|
|
31
|
+
|
|
32
|
+
@property
|
|
33
|
+
def cancel_button(self) -> Locator:
|
|
34
|
+
return self.panel.locator("button").filter(has_text="Cancel")
|
|
35
|
+
|
|
36
|
+
@property
|
|
37
|
+
def save_button(self) -> Locator:
|
|
38
|
+
return self.panel.locator("button").filter(has_text="Save")
|
|
39
|
+
|
|
40
|
+
@property
|
|
41
|
+
def system_prompt_current_section(self) -> Locator:
|
|
42
|
+
"""System Prompt current version section."""
|
|
43
|
+
return self.panel.locator("div#current")
|
|
44
|
+
|
|
45
|
+
@property
|
|
46
|
+
def system_prompt_edit_field(self) -> Locator:
|
|
47
|
+
"""System Prompt editing field section."""
|
|
48
|
+
return self.system_prompt_current_section.locator("textarea#system_prompt")
|
|
49
|
+
|
|
50
|
+
# ==================== VERIFICATION METHODS ====================
|
|
51
|
+
|
|
52
|
+
@step
|
|
53
|
+
def should_be_visible(self):
|
|
54
|
+
"""Verify that the configuration panel is visible."""
|
|
55
|
+
expect(self.panel).to_be_visible()
|
|
56
|
+
return self
|
|
57
|
+
|
|
58
|
+
@step
|
|
59
|
+
def should_be_hidden(self):
|
|
60
|
+
"""Verify that the configuration panel is hidden."""
|
|
61
|
+
expect(self.panel).to_be_hidden()
|
|
62
|
+
return self
|
|
63
|
+
|
|
64
|
+
@step
|
|
65
|
+
def should_have_system_prompt_section_visible(self):
|
|
66
|
+
"""Verify that the System prompt section is visible."""
|
|
67
|
+
expect(self.system_prompt_current_section).to_be_visible()
|
|
68
|
+
return self
|
|
69
|
+
|
|
70
|
+
@step
|
|
71
|
+
def should_have_all_sections_visible(self):
|
|
72
|
+
"""Verify that all main panel sections are visible."""
|
|
73
|
+
expect(self.panel_title).to_be_visible()
|
|
74
|
+
expect(self.cancel_button).to_be_visible()
|
|
75
|
+
expect(self.save_button).to_be_visible()
|
|
76
|
+
self.should_have_system_prompt_section_visible()
|
|
77
|
+
expect(self.system_prompt_edit_field).to_be_visible()
|
|
78
|
+
return self
|
|
79
|
+
|
|
80
|
+
@step
|
|
81
|
+
def should_have_system_prompt(self, system_prompt_text: str):
|
|
82
|
+
"""Verify that the System prompt text matches param"""
|
|
83
|
+
expect(self.system_prompt_edit_field).to_have_value(system_prompt_text)
|
|
84
|
+
return self
|
|
85
|
+
|
|
86
|
+
# ==================== INTERACTION METHODS ====================
|
|
87
|
+
|
|
88
|
+
@step
|
|
89
|
+
def update_system_prompt(self, new_sys_prompt: str):
|
|
90
|
+
self.system_prompt_edit_field.clear()
|
|
91
|
+
self.system_prompt_edit_field.fill(new_sys_prompt)
|
|
92
|
+
return self
|
|
93
|
+
|
|
94
|
+
@step
|
|
95
|
+
def save_changes(self):
|
|
96
|
+
self.save_button.click()
|
|
97
|
+
return self
|
|
98
|
+
|
|
99
|
+
@step
|
|
100
|
+
def cancel_changes(self):
|
|
101
|
+
self.cancel_button.click()
|
|
102
|
+
return self
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
from typing import Optional
|
|
2
2
|
|
|
3
|
-
from codemie_test_harness.tests.ui.pageobject.base_page import BasePage
|
|
4
3
|
from playwright.sync_api import expect
|
|
5
4
|
from reportportal_client import step
|
|
5
|
+
|
|
6
6
|
from codemie_test_harness.tests.test_data.google_datasource_test_data import (
|
|
7
7
|
GOOGLE_DOC_URL,
|
|
8
8
|
GOOGLE_GUIDE_URL,
|
|
9
9
|
)
|
|
10
|
-
from codemie_test_harness.tests.ui.
|
|
10
|
+
from codemie_test_harness.tests.ui.pageobject.base_page import BasePage
|
|
11
|
+
from codemie_test_harness.tests.ui.pageobject.components.project_selector import (
|
|
12
|
+
ProjectSelector,
|
|
13
|
+
)
|
|
14
|
+
from codemie_test_harness.tests.ui.pageobject.datasources.datasource_sidebar import (
|
|
15
|
+
DataSourceSidebar,
|
|
16
|
+
)
|
|
17
|
+
from codemie_test_harness.tests.ui.test_data.datasource_test_data import (
|
|
11
18
|
DataSourceType,
|
|
12
19
|
SUMMARIZATION_METHODS_LIST,
|
|
13
20
|
EMBEDDING_MODELS_LIST,
|
|
@@ -24,12 +31,6 @@ from codemie_test_harness.tests.ui._test_data.datasource_test_data import (
|
|
|
24
31
|
EMPTY_FILE_ERROR,
|
|
25
32
|
EMPTY_GOOGLE_LINK_ERROR,
|
|
26
33
|
)
|
|
27
|
-
from codemie_test_harness.tests.ui.pageobject.components.project_selector import (
|
|
28
|
-
ProjectSelector,
|
|
29
|
-
)
|
|
30
|
-
from codemie_test_harness.tests.ui.pageobject.datasources.datasource_sidebar import (
|
|
31
|
-
DataSourceSidebar,
|
|
32
|
-
)
|
|
33
34
|
from codemie_test_harness.tests.utils.base_utils import get_random_name
|
|
34
35
|
|
|
35
36
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import re
|
|
2
2
|
|
|
3
3
|
from hamcrest import has_length, assert_that, greater_than_or_equal_to
|
|
4
|
-
from reportportal_client import step
|
|
5
4
|
from playwright.sync_api import expect
|
|
5
|
+
from reportportal_client import step
|
|
6
6
|
|
|
7
7
|
from codemie_test_harness.tests.ui.pageobject.base_page import BasePage
|
|
8
|
-
from codemie_test_harness.tests.ui._test_data.datasource_test_data import (
|
|
9
|
-
DATAS_SOURCE_COLUMN_LIST,
|
|
10
|
-
)
|
|
11
8
|
from codemie_test_harness.tests.ui.pageobject.datasources.datasource_sidebar import (
|
|
12
9
|
DataSourceSidebar,
|
|
13
10
|
)
|
|
11
|
+
from codemie_test_harness.tests.ui.test_data.datasource_test_data import (
|
|
12
|
+
DATAS_SOURCE_COLUMN_LIST,
|
|
13
|
+
)
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
class DataSourcePage(BasePage):
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
from reportportal_client import step
|
|
2
1
|
from playwright.sync_api import expect
|
|
3
|
-
from
|
|
2
|
+
from reportportal_client import step
|
|
3
|
+
|
|
4
|
+
from codemie_test_harness.tests.ui.pageobject.base_page import BasePage
|
|
5
|
+
from codemie_test_harness.tests.ui.test_data.datasource_test_data import (
|
|
4
6
|
DATA_SOURCE_FILTER_STATUSES_LIST,
|
|
5
7
|
DATA_SOURCE_FILTER_TYPES_LIST,
|
|
6
8
|
PROJECT_LABEL,
|
|
7
9
|
STATUS_LABEL,
|
|
8
10
|
)
|
|
9
|
-
from codemie_test_harness.tests.ui.pageobject.base_page import BasePage
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
class DataSourceSidebar(BasePage):
|
|
@@ -7,10 +7,10 @@ from codemie_sdk.models.integration import CredentialTypes
|
|
|
7
7
|
from playwright.sync_api import expect, Locator
|
|
8
8
|
from reportportal_client import step
|
|
9
9
|
|
|
10
|
-
from codemie_test_harness.tests.ui.
|
|
10
|
+
from codemie_test_harness.tests.ui.pageobject.base_page import BasePage
|
|
11
|
+
from codemie_test_harness.tests.ui.test_data.integration_test_data import (
|
|
11
12
|
IntegrationTestData,
|
|
12
13
|
)
|
|
13
|
-
from codemie_test_harness.tests.ui.pageobject.base_page import BasePage
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
# noinspection PyArgumentList
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Test Data for Chat UI Tests
|
|
3
|
+
|
|
4
|
+
This module provides test data generation and management for chat-related UI tests.
|
|
5
|
+
Following best practices by separating test data from test logic and providing
|
|
6
|
+
reusable data factories for consistent testing.
|
|
7
|
+
|
|
8
|
+
Architecture follows the same patterns as other test data modules in the framework.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from dataclasses import dataclass
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@dataclass
|
|
15
|
+
class ChatTestMessage:
|
|
16
|
+
"""
|
|
17
|
+
Data class for chat message test data.
|
|
18
|
+
|
|
19
|
+
Encapsulates message content and metadata for chat testing scenarios.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
content: str
|
|
23
|
+
expected_response: str
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class ChatTestDataFactory:
|
|
27
|
+
"""
|
|
28
|
+
Factory class for generating chat test data.
|
|
29
|
+
|
|
30
|
+
This factory provides various methods to create different types of
|
|
31
|
+
chat test data for different testing scenarios.
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
@staticmethod
|
|
35
|
+
def create_simple_test_message() -> ChatTestMessage:
|
|
36
|
+
"""
|
|
37
|
+
Create a simple test message for basic chat functionality testing.
|
|
38
|
+
|
|
39
|
+
Returns:
|
|
40
|
+
ChatTestMessage: Simple test message data
|
|
41
|
+
"""
|
|
42
|
+
return ChatTestMessage(
|
|
43
|
+
content="Hello, this is a test message for chat functionality validation.",
|
|
44
|
+
expected_response="",
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
@staticmethod
|
|
48
|
+
def create_coding_help_message() -> ChatTestMessage:
|
|
49
|
+
"""
|
|
50
|
+
Create a coding-related question message.
|
|
51
|
+
"""
|
|
52
|
+
return ChatTestMessage(
|
|
53
|
+
content="Hello, I need help with a coding question.",
|
|
54
|
+
expected_response="",
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
@staticmethod
|
|
58
|
+
def create_coding_question_message() -> ChatTestMessage:
|
|
59
|
+
"""
|
|
60
|
+
Create a coding-related question message.
|
|
61
|
+
"""
|
|
62
|
+
return ChatTestMessage(
|
|
63
|
+
content="Can you help me understand Python decorators?",
|
|
64
|
+
expected_response="",
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
# ==================== CONVENIENCE FUNCTIONS ====================
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def get_simple_test_message() -> ChatTestMessage:
|
|
72
|
+
"""Convenience function to get simple test message."""
|
|
73
|
+
return ChatTestDataFactory.create_simple_test_message()
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def get_coding_help_message() -> ChatTestMessage:
|
|
77
|
+
"""Convenience function to get coding help message."""
|
|
78
|
+
return ChatTestDataFactory.create_coding_help_message()
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def get_coding_question_message() -> ChatTestMessage:
|
|
82
|
+
"""Convenience function to get coding question message."""
|
|
83
|
+
return ChatTestDataFactory.create_coding_question_message()
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
# ==================== TEST DATA CONSTANTS ====================
|
|
87
|
+
|
|
88
|
+
# Common test messages for reuse
|
|
89
|
+
COMMON_TEST_MESSAGES = {
|
|
90
|
+
"hello": "Hello, how can you help me today?",
|
|
91
|
+
"coding_help": "Can you help me debug this Python code?",
|
|
92
|
+
"documentation": "Please help me write documentation for this API.",
|
|
93
|
+
"code_review": "Can you review this code and suggest improvements?",
|
|
94
|
+
"testing_help": "What are the best practices for unit testing?",
|
|
95
|
+
"architecture": "How should I design a microservices architecture?",
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
LLM_ENGINES = ["Bedrock Claude 4 Sonnet"]
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
from codemie_test_harness.tests.utils.env_resolver import EnvironmentResolver
|
|
2
|
-
|
|
3
1
|
import pytest
|
|
4
2
|
|
|
5
3
|
from codemie_test_harness.tests.test_data.mcp_server_test_data import (
|
|
@@ -15,9 +13,9 @@ from codemie_test_harness.tests.test_data.mcp_server_test_data import (
|
|
|
15
13
|
CLI_MCP_SERVER,
|
|
16
14
|
)
|
|
17
15
|
|
|
18
|
-
pytestmark = pytest.mark.skipif(
|
|
19
|
-
|
|
20
|
-
)
|
|
16
|
+
# pytestmark = pytest.mark.skipif(
|
|
17
|
+
# EnvironmentResolver.is_localhost(), reason="Skipping this test on local environment"
|
|
18
|
+
# )
|
|
21
19
|
|
|
22
20
|
|
|
23
21
|
@pytest.mark.workflow
|
codemie_test_harness/tests/workflow/virtual_assistant_tools/mcp/test_workflow_with_mcp_server.py
CHANGED
|
@@ -13,11 +13,10 @@ from codemie_test_harness.tests.test_data.mcp_server_test_data import (
|
|
|
13
13
|
CLI_MCP_SERVER,
|
|
14
14
|
)
|
|
15
15
|
from codemie_test_harness.tests.utils.base_utils import get_random_name
|
|
16
|
-
from codemie_test_harness.tests.utils.env_resolver import EnvironmentResolver
|
|
17
16
|
|
|
18
|
-
pytestmark = pytest.mark.skipif(
|
|
19
|
-
|
|
20
|
-
)
|
|
17
|
+
# pytestmark = pytest.mark.skipif(
|
|
18
|
+
# EnvironmentResolver.is_localhost(), reason="Skipping this test on local environment"
|
|
19
|
+
# )
|
|
21
20
|
|
|
22
21
|
|
|
23
22
|
@pytest.mark.workflow
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: codemie-test-harness
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.183
|
|
4
4
|
Summary: Autotest for CodeMie backend and UI
|
|
5
5
|
Author: Anton Yeromin
|
|
6
6
|
Author-email: anton_yeromin@epam.com
|
|
@@ -13,7 +13,7 @@ Requires-Dist: aws-assume-role-lib (>=2.10.0,<3.0.0)
|
|
|
13
13
|
Requires-Dist: boto3 (>=1.39.8,<2.0.0)
|
|
14
14
|
Requires-Dist: click (>=8.1.7,<9.0.0)
|
|
15
15
|
Requires-Dist: codemie-plugins (>=0.1.123,<0.2.0)
|
|
16
|
-
Requires-Dist: codemie-sdk-python (==0.1.
|
|
16
|
+
Requires-Dist: codemie-sdk-python (==0.1.183)
|
|
17
17
|
Requires-Dist: pytest (>=8.4.1,<9.0.0)
|
|
18
18
|
Requires-Dist: pytest-playwright (>=0.7.0,<0.8.0)
|
|
19
19
|
Requires-Dist: pytest-reportportal (>=5.5.2,<6.0.0)
|