codemie-test-harness 0.1.177__py3-none-any.whl → 0.1.179__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.

Files changed (28) hide show
  1. codemie_test_harness/tests/assistant/default_integrations/test_default_integrations_for_tool_kit.py +2 -2
  2. codemie_test_harness/tests/test_data/ado_work_item_tools_test_data.py +3 -3
  3. codemie_test_harness/tests/test_data/google_datasource_test_data.py +4 -1
  4. codemie_test_harness/tests/ui/_test_data/datasource_test_data.py +125 -0
  5. codemie_test_harness/tests/ui/datasource/__init__.py +0 -0
  6. codemie_test_harness/tests/ui/datasource/test_create_datasource.py +191 -0
  7. codemie_test_harness/tests/ui/datasource/test_datasource_page.py +61 -0
  8. codemie_test_harness/tests/ui/datasource/test_edit_datasource.py +184 -0
  9. codemie_test_harness/tests/ui/datasource/test_view_datasource.py +222 -0
  10. codemie_test_harness/tests/ui/pageobject/assistants/assistants_page.py +1 -1
  11. codemie_test_harness/tests/ui/pageobject/base_page.py +31 -5
  12. codemie_test_harness/tests/ui/pageobject/components/project_selector.py +116 -0
  13. codemie_test_harness/tests/ui/pageobject/components/workflow_sidebar.py +1 -1
  14. codemie_test_harness/tests/ui/pageobject/datasources/__init__.py +0 -0
  15. codemie_test_harness/tests/ui/pageobject/datasources/create_edit_datasource_page.py +778 -0
  16. codemie_test_harness/tests/ui/pageobject/datasources/datasource_page.py +237 -0
  17. codemie_test_harness/tests/ui/pageobject/datasources/datasource_sidebar.py +303 -0
  18. codemie_test_harness/tests/ui/pageobject/datasources/view_datasource_page.py +337 -0
  19. codemie_test_harness/tests/utils/datasource_utils.py +13 -18
  20. codemie_test_harness/tests/workflow/assistant_tools/default_integrations/test_default_integrations_for_tool_kit.py +2 -2
  21. codemie_test_harness/tests/workflow/direct_tools_calling/test_workflow_with_vcs_tools.py +2 -0
  22. codemie_test_harness/tests/workflow/virtual_assistant_tools/default_integrations/test_default_integrations_for_tool_kit.py +2 -2
  23. {codemie_test_harness-0.1.177.dist-info → codemie_test_harness-0.1.179.dist-info}/METADATA +2 -2
  24. {codemie_test_harness-0.1.177.dist-info → codemie_test_harness-0.1.179.dist-info}/RECORD +27 -16
  25. codemie_test_harness/tests/ui/pytest.ini +0 -18
  26. /codemie_test_harness/tests/assistant/tools/{mcp → plugin}/test_single_assistant_dual_time_plugins.py +0 -0
  27. {codemie_test_harness-0.1.177.dist-info → codemie_test_harness-0.1.179.dist-info}/WHEEL +0 -0
  28. {codemie_test_harness-0.1.177.dist-info → codemie_test_harness-0.1.179.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,778 @@
1
+ from typing import Optional
2
+
3
+ from codemie_test_harness.tests.ui.pageobject.base_page import BasePage
4
+ from playwright.sync_api import expect
5
+ from reportportal_client import step
6
+ from codemie_test_harness.tests.test_data.google_datasource_test_data import (
7
+ GOOGLE_DOC_URL,
8
+ GOOGLE_GUIDE_URL,
9
+ )
10
+ from codemie_test_harness.tests.ui._test_data.datasource_test_data import (
11
+ DataSourceType,
12
+ SUMMARIZATION_METHODS_LIST,
13
+ EMBEDDING_MODELS_LIST,
14
+ DATA_SOURCE_TYPES_LIST,
15
+ FILE_INSTRUCTIONS,
16
+ GOOGLE_INSTRUCTIONS,
17
+ GOOGLE_EXAMPLE,
18
+ EMPTY_NAME_ERROR,
19
+ EMPTY_DESCRIPTION_ERROR,
20
+ EMPTY_REPO_LINK_ERROR,
21
+ EMPTY_BRANCH_ERROR,
22
+ EMPTY_CQL_ERROR,
23
+ EMPTY_JQL_ERROR,
24
+ EMPTY_FILE_ERROR,
25
+ EMPTY_GOOGLE_LINK_ERROR,
26
+ )
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
+ from codemie_test_harness.tests.utils.base_utils import get_random_name
34
+
35
+
36
+ class CreateEditDatasourcePage(BasePage):
37
+ """Create Data Source page object with property-based element locators."""
38
+
39
+ page_url = "/#/data-sources/create"
40
+
41
+ def __init__(self, page):
42
+ super().__init__(page)
43
+ self.sidebar = DataSourceSidebar(page)
44
+ self.selector = ProjectSelector(page)
45
+
46
+ # -----------------
47
+ # Page Elements
48
+ # -----------------
49
+
50
+ @property
51
+ def back_button(self):
52
+ return self.page.locator("button svg").nth(0).locator("xpath=..")
53
+
54
+ @property
55
+ def save_reindex_button(self):
56
+ return self.page.locator("button:has-text('Save & Reindex')")
57
+
58
+ @property
59
+ def shared_with_project_switch(self):
60
+ return self.page.locator("input#projectSpaceVisible + span")
61
+
62
+ @property
63
+ def name_input(self):
64
+ return self.page.locator("input#name")
65
+
66
+ @property
67
+ def disabled_name_input(self):
68
+ return self.page.locator("input#name[disabled]")
69
+
70
+ @property
71
+ def error_name_input(self):
72
+ return self.page.locator('label:has(input[name="name"]) .input-error-message')
73
+
74
+ @property
75
+ def description_input(self):
76
+ return self.page.locator("textarea#description")
77
+
78
+ @property
79
+ def error_description_input(self):
80
+ return self.description_input.locator(" + div")
81
+
82
+ @property
83
+ def datasource_type_selector(self):
84
+ return self.page.locator('span#indexType input[type="text"]')
85
+
86
+ @property
87
+ def datasource_type_dropdown(self):
88
+ return self.page.locator("span#indexType button")
89
+
90
+ @property
91
+ def integration_input(self):
92
+ return self.page.locator('span.p-autocomplete[id^="pr_id_"]')
93
+
94
+ @property
95
+ def add_integration_button(self):
96
+ return self.page.locator('button:has-text("Add User Integration")')
97
+
98
+ @property
99
+ def integration_dropdown(self):
100
+ return self.integration_input.locator("button")
101
+
102
+ def dropdown_values(self, value: str):
103
+ return self.page.locator(f'li:has-text("{value}")')
104
+
105
+ # -------------------------------
106
+ # Navigation methods
107
+ # -------------------------------
108
+ @step
109
+ def navigate_to(self):
110
+ """
111
+ Navigate to the Create DataSource page.
112
+
113
+ Returns:
114
+ self: Returns the page object for method chaining
115
+ """
116
+ self.page.goto(self.page_url)
117
+ self.wait_for_page_load()
118
+
119
+ return self
120
+
121
+ # -------------------------------
122
+ # Git DataSource Type Elements
123
+ # -------------------------------
124
+
125
+ @property
126
+ def summarization_method_input(self):
127
+ return self.page.locator('span#repoIndexType input[type="text"]')
128
+
129
+ @property
130
+ def summarization_method_dropdown(self):
131
+ return self.page.locator("span#repoIndexType button")
132
+
133
+ @property
134
+ def repo_link_input(self):
135
+ return self.page.locator("input#repoLink")
136
+
137
+ @property
138
+ def error_repo_link_input(self):
139
+ return self.page.locator(
140
+ 'label:has(input[name="repoLink"]) .input-error-message'
141
+ )
142
+
143
+ @property
144
+ def branch_input(self):
145
+ return self.page.locator("input#repoBranch")
146
+
147
+ @property
148
+ def error_branch_input(self):
149
+ return self.page.locator('label:has(input[name="branch"]) .input-error-message')
150
+
151
+ @property
152
+ def files_filter_input(self):
153
+ return self.page.locator("textarea#filesFilter")
154
+
155
+ @property
156
+ def embeddings_model_input(self):
157
+ return self.page.locator('span#embeddingsModel input[type="text"]')
158
+
159
+ @property
160
+ def embeddings_model_dropdown(self):
161
+ return self.page.locator("span#embeddingsModel button")
162
+
163
+ # -------------------------------
164
+ # Confluence DataSource Type Elements
165
+ # -------------------------------
166
+
167
+ @property
168
+ def cql_query_input(self):
169
+ return self.page.locator("input#cql")
170
+
171
+ @property
172
+ def error_cql_query_input(self):
173
+ return self.page.locator('label:has(input[name="cql"]) .input-error-message')
174
+
175
+ # -------------------------------
176
+ # Jira DataSource Type Elements
177
+ # -------------------------------
178
+
179
+ @property
180
+ def jql_query_input(self):
181
+ return self.page.locator("input#jql")
182
+
183
+ @property
184
+ def error_jql_query_input(self):
185
+ return self.page.locator('label:has(input[name="jql"]) .input-error-message')
186
+
187
+ # -------------------------------
188
+ # File DataSource Type Elements
189
+ # -------------------------------
190
+
191
+ @property
192
+ def select_file_button(self):
193
+ return self.page.locator("button:has-text('Select file')")
194
+
195
+ @property
196
+ def input_file(self):
197
+ return self.page.locator('input[type="file"]')
198
+
199
+ @property
200
+ def remove_file_icon(self):
201
+ return self.page.locator("svg.cursor-pointer")
202
+
203
+ @property
204
+ def add_file_button(self):
205
+ return self.page.locator("button:has-text('Add file')")
206
+
207
+ @property
208
+ def files_info_text(self):
209
+ return self.page.locator(".mb-4 div.flex.text-text-secondary.text-xs span")
210
+
211
+ @property
212
+ def error_files_info_text(self):
213
+ return self.page.locator(".mb-4 .text-fire-50")
214
+
215
+ @property
216
+ def file_input_field(self):
217
+ return self.page.locator("div.text-text-secondary.ml-2 ")
218
+
219
+ @property
220
+ def csv_separator_input(self):
221
+ return self.page.locator(
222
+ "span.p-autocomplete[id^='pr_id_'] input[name='csvSeparator']"
223
+ )
224
+
225
+ @property
226
+ def csv_separator_dropdown_button(self):
227
+ return self.page.locator(
228
+ "span.p-autocomplete[id^='pr_id_'] button[aria-label='Choose']"
229
+ )
230
+
231
+ @property
232
+ def csv_start_row_input(self):
233
+ return self.page.locator("input[name='csvStartRow']")
234
+
235
+ @property
236
+ def csv_rows_per_document_input(self):
237
+ return self.page.locator("input[name='csvRowsPerDocument']")
238
+
239
+ # -------------------------------
240
+ # Google DataSource Type Elements
241
+ # -------------------------------
242
+
243
+ @property
244
+ def google_query_input(self):
245
+ return self.page.locator("input#googleDoc")
246
+
247
+ @property
248
+ def error_google_query_input(self):
249
+ return self.page.locator(
250
+ 'label:has(input[name="googleDoc"]) .input-error-message'
251
+ )
252
+
253
+ @property
254
+ def google_instructions(self):
255
+ return self.page.locator(".mb-4 div.flex.text-text-secondary.text-xs span")
256
+
257
+ # -----------------
258
+ # Action Methods
259
+ # -----------------
260
+ @step
261
+ def fill_name(self, value: str):
262
+ self.name_input.fill(value)
263
+ return self
264
+
265
+ @step
266
+ def fill_description(self, value: str):
267
+ self.description_input.fill(value)
268
+ return self
269
+
270
+ @step
271
+ def select_project(self, value: str):
272
+ self.project_multiselect.click()
273
+ self.dropdown_values(value).click()
274
+ return self
275
+
276
+ @step
277
+ def toggle_shared_with_project(self):
278
+ self.shared_with_project_switch.click()
279
+ return self
280
+
281
+ @step
282
+ def select_datasource_type(self, value: str):
283
+ self.datasource_type_dropdown.click()
284
+ self.dropdown_values(value).click()
285
+ return self
286
+
287
+ @step
288
+ def select_integration(self, value: str):
289
+ self.integration_dropdown.click()
290
+ self.dropdown_values(value).click()
291
+ return self
292
+
293
+ @step
294
+ def click_create(self):
295
+ self.create_button.click()
296
+ return self
297
+
298
+ @step
299
+ def click_cancel(self):
300
+ self.cancel_button.click()
301
+ return self
302
+
303
+ def _base_create_datasource(
304
+ self,
305
+ name: Optional[str],
306
+ project_name: Optional[str],
307
+ description: Optional[str],
308
+ datasource_type: DataSourceType,
309
+ shared: bool = False,
310
+ integration: Optional[str] = None,
311
+ ):
312
+ """
313
+ Fills common fields for any DataSource type
314
+ (name, description, project, type, shared, integration) but does not click 'Create'.
315
+
316
+ Args:
317
+ name: Optional[name], defaults to random if not provided
318
+ project_name: Optional[str], selects a project if provided
319
+ description: Optional[str], defaults to random if empty
320
+ datasource_type: DataSourceType enum member
321
+ shared: If True, enable 'Shared with project' toggle
322
+ integration: Optionally select integration string
323
+
324
+ Returns:
325
+ The name used for the datasource
326
+ """
327
+ name = name or get_random_name()
328
+ description = description or get_random_name()
329
+ self.fill_name(name)
330
+ self.fill_description(description)
331
+ if project_name:
332
+ self.selector.search_and_select_project(project_name)
333
+ self.select_datasource_type(datasource_type)
334
+ if shared:
335
+ self.toggle_shared_with_project()
336
+ if integration:
337
+ self.select_integration(integration)
338
+ return name
339
+
340
+ @step
341
+ def create_git_datasource(
342
+ self,
343
+ name: Optional[str] = None,
344
+ project_name: Optional[str] = None,
345
+ description: Optional[str] = None,
346
+ shared: bool = False,
347
+ repo_link: Optional[str] = None,
348
+ branch: Optional[str] = None,
349
+ summarization_method: Optional[str] = None,
350
+ embeddings_model: Optional[str] = None,
351
+ integration: Optional[str] = None,
352
+ ):
353
+ """
354
+ Creates a Git DataSource with required and optional fields.
355
+ """
356
+ name = self._base_create_datasource(
357
+ name, project_name, description, DataSourceType.GIT, shared, integration
358
+ )
359
+ if repo_link:
360
+ self.fill_repo_link(repo_link)
361
+ if branch:
362
+ self.fill_branch(branch)
363
+ if summarization_method:
364
+ self.select_summarization_method(summarization_method)
365
+ if embeddings_model:
366
+ self.select_embeddings_model(embeddings_model)
367
+ self.click_create()
368
+ return name
369
+
370
+ @step
371
+ def create_confluence_datasource(
372
+ self,
373
+ name: Optional[str] = None,
374
+ project_name: Optional[str] = None,
375
+ description: Optional[str] = None,
376
+ shared: bool = False,
377
+ cql_query: Optional[str] = None,
378
+ integration: Optional[str] = None,
379
+ ):
380
+ """
381
+ Creates a Confluence DataSource with required and optional fields.
382
+ """
383
+ name = self._base_create_datasource(
384
+ name,
385
+ project_name,
386
+ description,
387
+ DataSourceType.CONFLUENCE,
388
+ shared,
389
+ integration,
390
+ )
391
+ if cql_query:
392
+ self.fill_cql_query(cql_query)
393
+ self.click_create()
394
+ return name
395
+
396
+ @step
397
+ def create_jira_datasource(
398
+ self,
399
+ name: Optional[str] = None,
400
+ project_name: Optional[str] = None,
401
+ description: Optional[str] = None,
402
+ shared: bool = False,
403
+ jql_query: Optional[str] = None,
404
+ integration: Optional[str] = None,
405
+ ):
406
+ """
407
+ Creates a Jira DataSource with required and optional fields.
408
+ """
409
+ name = self._base_create_datasource(
410
+ name, project_name, description, DataSourceType.JIRA, shared, integration
411
+ )
412
+ if jql_query:
413
+ self.fill_jql_query(jql_query)
414
+ self.click_create()
415
+ return name
416
+
417
+ @step
418
+ def create_file_datasource(
419
+ self,
420
+ name: Optional[str] = None,
421
+ project_name: Optional[str] = None,
422
+ description: Optional[str] = None,
423
+ shared: bool = False,
424
+ file_path: Optional[str] = None,
425
+ integration: Optional[str] = None,
426
+ ):
427
+ """
428
+ Creates a File DataSource with required and optional fields.
429
+ """
430
+ name = self._base_create_datasource(
431
+ name, project_name, description, DataSourceType.FILE, shared, integration
432
+ )
433
+ if file_path:
434
+ self.select_file(file_path)
435
+ self.click_create()
436
+ return name
437
+
438
+ @step
439
+ def create_google_datasource(
440
+ self,
441
+ name: Optional[str] = None,
442
+ project_name: Optional[str] = None,
443
+ description: Optional[str] = None,
444
+ shared: bool = False,
445
+ google_doc_link: Optional[str] = None,
446
+ integration: Optional[str] = None,
447
+ ):
448
+ """
449
+ Creates a Google DataSource with required and optional fields.
450
+ """
451
+ name = self._base_create_datasource(
452
+ name, project_name, description, DataSourceType.GOOGLE, shared, integration
453
+ )
454
+ if google_doc_link:
455
+ self.fill_google_doc_link(google_doc_link)
456
+ self.click_create()
457
+ return name
458
+
459
+ # -------------------------------
460
+ # Git DataSource Type Methods
461
+ # -------------------------------
462
+
463
+ @step
464
+ def select_summarization_method(self, value: str):
465
+ self.summarization_method_dropdown.click()
466
+ self.dropdown_values(value).click()
467
+ return self
468
+
469
+ @step
470
+ def fill_repo_link(self, value: str):
471
+ self.repo_link_input.fill(value)
472
+ return self
473
+
474
+ @step
475
+ def fill_branch(self, value: str):
476
+ self.branch_input.fill(value)
477
+ return self
478
+
479
+ @step
480
+ def fill_files_filter(self, value: str):
481
+ self.files_filter_input.fill(value)
482
+ return self
483
+
484
+ @step
485
+ def select_embeddings_model(self, value: str):
486
+ self.embeddings_model_dropdown.click()
487
+ self.dropdown_values(value).click()
488
+ return self
489
+
490
+ # -------------------------------
491
+ # Confluence DataSource Type Methods
492
+ # -------------------------------
493
+
494
+ @step
495
+ def fill_cql_query(self, cql: str):
496
+ self.cql_query_input.fill(cql)
497
+ return self
498
+
499
+ # -------------------------------
500
+ # Jira DataSource Type Methods
501
+ # -------------------------------
502
+
503
+ @step
504
+ def fill_jql_query(self, jql: str):
505
+ self.jql_query_input.fill(jql)
506
+ return self
507
+
508
+ # -------------------------------
509
+ # File DataSource Type Methods
510
+ # -------------------------------
511
+
512
+ @step
513
+ def select_file(self, path: str):
514
+ self.input_file.set_input_files(path)
515
+ return self
516
+
517
+ @step
518
+ def add_file(self):
519
+ self.add_file_button.click()
520
+ return self
521
+
522
+ # -------------------------------
523
+ # Google DataSource Type Methods
524
+ # -------------------------------
525
+
526
+ @step
527
+ def fill_google_doc_link(self, link: str):
528
+ self.google_query_input.fill(link)
529
+ return self
530
+
531
+ # -----------------
532
+ # Verification Methods
533
+ # -----------------
534
+
535
+ @step
536
+ def should_see_name_input(self):
537
+ expect(self.name_input).to_be_visible()
538
+ return self
539
+
540
+ @step
541
+ def should_see_disabled_name_input(self, name: str):
542
+ expect(self.disabled_name_input).to_be_visible()
543
+ expect(self.disabled_name_input).to_have_value(name)
544
+ return self
545
+
546
+ @step
547
+ def should_see_description_input(self):
548
+ expect(self.description_input).to_be_visible()
549
+ return self
550
+
551
+ @step
552
+ def should_see_shared_with_project_switch(self):
553
+ expect(self.shared_with_project_switch).to_be_visible()
554
+ return self
555
+
556
+ @step
557
+ def should_see_datasource_type_input(self):
558
+ expect(self.datasource_type_selector).to_be_visible()
559
+ # default value is Git
560
+ expect(self.datasource_type_selector).to_have_value("Git")
561
+ return self
562
+
563
+ @step
564
+ def should_see_datasource_type_dropdown_values(self):
565
+ self.datasource_type_dropdown.click()
566
+ for type in DATA_SOURCE_TYPES_LIST:
567
+ expect(self.dropdown_values(type)).to_be_visible()
568
+
569
+ @step
570
+ def should_see_create_button(self):
571
+ expect(self.create_button).to_be_visible()
572
+ return self
573
+
574
+ @step
575
+ def should_see_cancel_button(self):
576
+ expect(self.cancel_button).to_be_visible()
577
+ return self
578
+
579
+ @step
580
+ def should_see_save_reindex_button(self):
581
+ expect(self.save_reindex_button).to_be_visible()
582
+ return self
583
+
584
+ @step
585
+ def should_see_integration_input(self):
586
+ expect(self.integration_input).to_be_visible()
587
+ return self
588
+
589
+ @step
590
+ def should_see_add_integration_button(self):
591
+ expect(self.add_integration_button).to_be_visible()
592
+ return self
593
+
594
+ @step
595
+ def should_see_integration_input_or_button(self):
596
+ """
597
+ Verifies that either the integration input OR the add integration button is visible.
598
+ """
599
+ try:
600
+ self.should_see_integration_input()
601
+ except AssertionError:
602
+ self.should_see_add_integration_button()
603
+ return self
604
+
605
+ @step
606
+ def should_see_selected_integration(self, integration: str):
607
+ expect(self.integration_input).to_have_text(integration)
608
+ return self
609
+
610
+ @step
611
+ def should_see_main_fields(self):
612
+ self.should_see_name_input()
613
+ self.should_see_description_input()
614
+ self.selector.should_see_multiselect()
615
+ self.should_see_shared_with_project_switch()
616
+ self.should_see_datasource_type_input()
617
+ self.should_see_create_button()
618
+ self.should_see_cancel_button()
619
+ self.should_see_datasource_type_dropdown_values()
620
+ return self
621
+
622
+ @step
623
+ def should_see_error_for_empty_main_fields(self):
624
+ expect(self.error_name_input).to_be_visible()
625
+ expect(self.error_name_input).to_have_text(EMPTY_NAME_ERROR)
626
+ expect(self.error_description_input).to_be_visible()
627
+ expect(self.error_description_input).to_have_text(EMPTY_DESCRIPTION_ERROR)
628
+ return self
629
+
630
+ @step
631
+ def should_see_error_for_empty_git_fields(self):
632
+ expect(self.error_repo_link_input).to_be_visible()
633
+ expect(self.error_repo_link_input).to_have_text(EMPTY_REPO_LINK_ERROR)
634
+ expect(self.error_branch_input).to_be_visible()
635
+ expect(self.error_branch_input).to_have_text(EMPTY_BRANCH_ERROR)
636
+ return self
637
+
638
+ @step
639
+ def should_see_error_for_empty_confluence_fields(self):
640
+ expect(self.error_cql_query_input).to_be_visible()
641
+ expect(self.error_cql_query_input).to_have_text(EMPTY_CQL_ERROR)
642
+ return self
643
+
644
+ @step
645
+ def should_see_error_for_empty_jira_fields(self):
646
+ expect(self.error_jql_query_input).to_be_visible()
647
+ expect(self.error_jql_query_input).to_have_text(EMPTY_JQL_ERROR)
648
+ return self
649
+
650
+ @step
651
+ def should_see_error_for_empty_file_fields(self):
652
+ expect(self.error_files_info_text).to_be_visible()
653
+ expect(self.error_files_info_text).to_have_text(EMPTY_FILE_ERROR)
654
+ return self
655
+
656
+ @step
657
+ def should_see_error_for_empty_google_fields(self):
658
+ expect(self.error_google_query_input).to_be_visible()
659
+ expect(self.error_google_query_input).to_have_text(EMPTY_GOOGLE_LINK_ERROR)
660
+ return self
661
+
662
+ # -------------------------------
663
+ # Git DataSource Type Verification Methods
664
+ # -------------------------------
665
+
666
+ @step
667
+ def should_see_summarization_fields(self):
668
+ expect(self.summarization_method_input).to_be_visible()
669
+ expect(self.summarization_method_dropdown).to_be_visible()
670
+ return self
671
+
672
+ @step
673
+ def should_see_summarization_dropdown_values(self):
674
+ self.summarization_method_dropdown.click()
675
+ for method in SUMMARIZATION_METHODS_LIST:
676
+ expect(self.dropdown_values(method)).to_be_visible()
677
+
678
+ @step
679
+ def should_see_repo_fields(self):
680
+ expect(self.repo_link_input).to_be_visible()
681
+ expect(self.branch_input).to_be_visible()
682
+ return self
683
+
684
+ @step
685
+ def should_see_files_filter_textarea(self):
686
+ expect(self.files_filter_input).to_be_visible()
687
+ return self
688
+
689
+ @step
690
+ def should_see_embeddings_model_field(self):
691
+ expect(self.embeddings_model_input).to_be_visible()
692
+ expect(self.embeddings_model_dropdown).to_be_visible()
693
+ return self
694
+
695
+ @step
696
+ def should_see_embeddings_model_dropdown_values(self):
697
+ self.embeddings_model_dropdown.click()
698
+ for model in EMBEDDING_MODELS_LIST:
699
+ expect(self.dropdown_values(model)).to_be_visible()
700
+ self.page.click("body")
701
+ return self
702
+
703
+ @step
704
+ def should_see_git_fields(self):
705
+ self.should_see_summarization_fields()
706
+ self.should_see_embeddings_model_dropdown_values()
707
+ self.should_see_repo_fields()
708
+ self.should_see_files_filter_textarea()
709
+ self.should_see_embeddings_model_field()
710
+ self.should_see_embeddings_model_dropdown_values()
711
+ self.should_see_integration_input_or_button()
712
+ return self
713
+
714
+ # -------------------------------
715
+ # Confluence DataSource Type Verification Methods
716
+ # -------------------------------
717
+
718
+ @step
719
+ def should_see_confluence_cql_field(self):
720
+ expect(self.cql_query_input).to_be_visible()
721
+ return self
722
+
723
+ # -------------------------------
724
+ # Jira DataSource Type Verification Methods
725
+ # -------------------------------
726
+
727
+ @step
728
+ def should_see_jira_jql_field(self):
729
+ expect(self.jql_query_input).to_be_visible()
730
+ return self
731
+
732
+ # -------------------------------
733
+ # File DataSource Type Verification Methods
734
+ # -------------------------------
735
+
736
+ @step
737
+ def should_see_file_fields(self):
738
+ expect(self.select_file_button).to_be_visible()
739
+ expect(self.add_file_button).to_be_visible()
740
+ expect(self.files_info_text).to_be_visible()
741
+ expect(self.files_info_text).to_have_text(FILE_INSTRUCTIONS)
742
+ return self
743
+
744
+ @step
745
+ def should_see_uploaded_file(self, file_name: str):
746
+ expect(self.file_input_field).to_be_visible()
747
+ expect(self.file_input_field).to_have_text(file_name)
748
+ return self
749
+
750
+ @step
751
+ def should_see_csv_config(self):
752
+ expect(self.csv_separator_input).to_be_visible()
753
+ expect(self.csv_separator_input).to_have_value("; (selmicolor)")
754
+ expect(self.csv_separator_dropdown_button).to_be_visible()
755
+ expect(self.csv_start_row_input).to_be_visible()
756
+ expect(self.csv_start_row_input).to_have_text("1")
757
+ expect(self.csv_rows_per_document_input).to_be_visible()
758
+ expect(self.csv_rows_per_document_input).to_have_value("1")
759
+ return self
760
+
761
+ # -------------------------------
762
+ # Google DataSource Type Verification Methods
763
+ # -------------------------------
764
+
765
+ @step
766
+ def should_see_google_fields(self):
767
+ expect(self.google_query_input).to_be_visible()
768
+ expect(self.google_instructions.nth(0)).to_be_visible()
769
+ expect(self.google_instructions.nth(1)).to_be_visible()
770
+ expect(self.google_instructions.nth(0)).to_have_text(GOOGLE_INSTRUCTIONS)
771
+ expect(self.google_instructions.nth(0).locator("a")).to_have_attribute(
772
+ "href", GOOGLE_GUIDE_URL
773
+ )
774
+ expect(self.google_instructions.nth(1)).to_have_text(GOOGLE_EXAMPLE)
775
+ expect(self.google_instructions.nth(1).locator("a")).to_have_attribute(
776
+ "href", GOOGLE_DOC_URL
777
+ )
778
+ return self