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
@@ -13,8 +13,8 @@ from codemie_test_harness.tests.test_data.ado_wiki_tools_test_data import (
13
13
  from codemie_test_harness.tests.utils.credentials_manager import CredentialsManager
14
14
  from codemie_test_harness.tests.utils.constants import test_project_name
15
15
 
16
- ado_wiki_prompt = ado_wiki_get_test_data[0][2]
17
- ado_wiki_answer = ado_wiki_get_test_data[0][3]
16
+ ado_wiki_prompt = ado_wiki_get_test_data[1][2]
17
+ ado_wiki_answer = ado_wiki_get_test_data[1][3]
18
18
 
19
19
 
20
20
  @pytest.mark.integration
@@ -134,12 +134,12 @@ ADO_WORK_ITEM_UPDATE = {
134
134
 
135
135
  ADO_WORK_ITEM_LINK = {
136
136
  "prompt_to_assistant": """
137
- Run {{'source_id': {}, 'target_id': 5296, 'link_type': 'System.LinkTypes.Hierarchy-Reverse'}} to
138
- link the Work Items with the ID 5296 to be the parent of Work Item with ID '{}' in
137
+ Run {{'source_id': {}, 'target_id': 5297, 'link_type': 'System.LinkTypes.Hierarchy-Reverse'}} to
138
+ link the Work Items with the ID 5297 to be the parent of Work Item with ID '{}' in
139
139
  the project 'CodemieAnton'
140
140
  """,
141
141
  "expected_llm_answer": """
142
- The Work Item with ID 5296 has been successfully linked as the parent of the Work Item with ID `{}`
142
+ The Work Item with ID 5297 has been successfully linked as the parent of the Work Item with ID `{}`
143
143
  using the `System.LinkTypes.Hierarchy-Reverse` link type.
144
144
  """,
145
145
  }
@@ -1,6 +1,9 @@
1
1
  """Test data constants for Google Datasource tests"""
2
2
 
3
- GOOGLE_DOC_URL = "https://docs.google.com/document/d/19EXgnFCgJontz0ToCAH6zMGwBTdhi5X97P9JIby4wHs/edit#heading=h.b01c2ig0adfg"
3
+ GOOGLE_DOC_URL = "https://docs.google.com/document/d/19EXgnFCgJontz0ToCAH6zMGwBTdhi5X97P9JIby4wHs/edit?tab=t.0#heading=h.b01c2ig0adfg"
4
+ GOOGLE_GUIDE_URL = (
5
+ "https://docs.google.com/document/d/1ZNWwxN8ukpJZyTbYjWQPym3Bc1-bQvBxBpTL0yfVF-w"
6
+ )
4
7
 
5
8
  USER_PROMPT = 'Tell context of the What is "Platform A"? section?'
6
9
 
@@ -0,0 +1,125 @@
1
+ """
2
+ Test Data for Data Source UI – used for parametrized testing and test validation
3
+ """
4
+
5
+ from enum import Enum
6
+
7
+
8
+ # ==================== ENUMS ====================
9
+ class DataSourceFilterType(str, Enum):
10
+ CODE = "Code"
11
+ CONFLUENCE = "Confluence"
12
+ JIRA = "Jira"
13
+ FILE = "File"
14
+ GOOGLE = "Google"
15
+ PROVIDER = "Provider"
16
+
17
+ def __str__(self):
18
+ return self.value
19
+
20
+
21
+ class DataSourceType(str, Enum):
22
+ GIT = "Git"
23
+ CONFLUENCE = "Confluence"
24
+ JIRA = "Jira"
25
+ FILE = "File"
26
+ GOOGLE = "Google"
27
+
28
+ def __str__(self):
29
+ return self.value
30
+
31
+
32
+ class DataSourceFilterStatus(str, Enum):
33
+ COMPLETED = "Completed"
34
+ FAILED = "Failed"
35
+ IN_PROGRESS = "In Progress"
36
+
37
+ def __str__(self):
38
+ return self.value
39
+
40
+
41
+ class DataSourceStatus(str, Enum):
42
+ COMPLETED = "Completed"
43
+ ERROR = "Error"
44
+ FETCHING = "Fetching"
45
+
46
+ def __str__(self):
47
+ return self.value
48
+
49
+
50
+ class SummarizationMethod(str, Enum):
51
+ WHOLE_CODEBASE = "Whole Codebase"
52
+ PER_FILE = "Summarization per file"
53
+ PER_CHUNKS = "Summarization per chunks"
54
+
55
+ def __str__(self):
56
+ return self.value
57
+
58
+
59
+ class EmbeddingModel(str, Enum):
60
+ ADA = "Text Embedding Ada"
61
+ GECKO = "Text Embedding Gecko"
62
+ TITAN_V2 = "Titan Embed Text v2.0"
63
+
64
+ def __str__(self):
65
+ return self.value
66
+
67
+
68
+ class DataSourceColumnName(str, Enum):
69
+ NAME = "Name"
70
+ PROJECT = "Project"
71
+ TYPE = "Type"
72
+ CREATED_BY = "Created By"
73
+ CREATED = "Created"
74
+ UPDATED = "Updated"
75
+ SHARED = "Shared"
76
+ STATUS = "Status"
77
+ ACTIONS = "Actions"
78
+
79
+ def __str__(self):
80
+ return self.value
81
+
82
+
83
+ # ==================== CONSTANTS ====================
84
+
85
+ DATA_SOURCE_FILTER_TYPES_LIST = [t for t in DataSourceFilterType]
86
+ DATA_SOURCE_TYPES_LIST = [t for t in DataSourceType]
87
+ DATA_SOURCE_FILTER_STATUSES_LIST = [s for s in DataSourceFilterStatus]
88
+ DATA_SOURCE_STATUSES_LIST = [s for s in DataSourceStatus]
89
+ DATAS_SOURCE_COLUMN_LIST = [c for c in DataSourceColumnName]
90
+ SUMMARIZATION_METHODS_LIST = [m for m in SummarizationMethod]
91
+ EMBEDDING_MODELS_LIST = [m for m in EmbeddingModel]
92
+
93
+ PROJECT_LABEL = "Project"
94
+ STATUS_LABEL = "Status"
95
+
96
+ MAIN_TITLE_DATASOURCE = "Data Sources"
97
+ MAIN_SUBTITLE_DATASOURCE = "Connect and manage your data sources in one place"
98
+ TITLE_CREATE_DATASOURCE = "New DataSource"
99
+ SUBTITLE_CREATE_DATASOURCE = "Start indexing your data source"
100
+ TITLE_VIEW_DATASOURCE = "View DataSource"
101
+ SUBTITLE_VIEW_DATASOURCE = "View your data source datails"
102
+ UPDATE_TITLE_DATASOURCE = "Update DataSource"
103
+ UPDATE_SUBTITLE_DATASOURCE = "Update your data source and start re-indexing"
104
+
105
+ FILE_INSTRUCTIONS = (
106
+ "Max size: 100Mb. Formats: .yml, .yaml, .json, .pptx, .csv, .txt, "
107
+ ".pdf, .docx, .xlsx, .xml"
108
+ )
109
+ GOOGLE_INSTRUCTIONS = (
110
+ "Please ensure your Google document is properly formatted and shared with the"
111
+ " service account. For detailed instructions, refer to the Guide"
112
+ )
113
+ GOOGLE_EXAMPLE = "Google documents must follow a specific format for LLM routing: View Format Example"
114
+
115
+ EMPTY_NAME_ERROR = "Data source name is required"
116
+ EMPTY_DESCRIPTION_ERROR = "description is a required field"
117
+ EMPTY_REPO_LINK_ERROR = "Repo Link is required"
118
+ EMPTY_BRANCH_ERROR = "Branch is required"
119
+ EMPTY_CQL_ERROR = "cql is a required field"
120
+ EMPTY_JQL_ERROR = "jql is a required field"
121
+ EMPTY_FILE_ERROR = (
122
+ "Invalid file type found, only .yml, .yaml, .json, .pptx, .csv, .txt, .pdf, "
123
+ ".docx, .xlsx, .xml are allowed"
124
+ )
125
+ EMPTY_GOOGLE_LINK_ERROR = "Google Docs link is required"
File without changes
@@ -0,0 +1,191 @@
1
+ import pytest
2
+ from codemie_test_harness.tests import CredentialsManager, PROJECT, TEST_USER
3
+ from codemie_test_harness.tests.test_data.google_datasource_test_data import (
4
+ GOOGLE_DOC_URL,
5
+ )
6
+ from codemie_test_harness.tests.ui._test_data.datasource_test_data import (
7
+ DataSourceType,
8
+ DataSourceFilterType,
9
+ DataSourceStatus,
10
+ SUBTITLE_CREATE_DATASOURCE,
11
+ TITLE_CREATE_DATASOURCE,
12
+ )
13
+ from codemie_test_harness.tests.ui.pageobject.datasources.create_edit_datasource_page import (
14
+ CreateEditDatasourcePage,
15
+ )
16
+
17
+ from codemie_test_harness.tests.ui.pageobject.datasources.datasource_page import (
18
+ DataSourcePage,
19
+ )
20
+ from codemie_test_harness.tests.utils.constants import FILES_PATH
21
+
22
+
23
+ @pytest.mark.datasource_ui
24
+ @pytest.mark.ui
25
+ def test_open_create_datasource_page_and_elements(page):
26
+ """Open Create Datasource page and verify critical elements."""
27
+ create_page = CreateEditDatasourcePage(page)
28
+
29
+ create_page.navigate_to()
30
+ create_page.sidebar.should_see_title_subtitle(
31
+ TITLE_CREATE_DATASOURCE, SUBTITLE_CREATE_DATASOURCE
32
+ )
33
+ create_page.should_see_main_fields()
34
+
35
+ create_page.select_datasource_type(DataSourceType.GIT)
36
+ create_page.should_see_git_fields()
37
+
38
+ create_page.select_datasource_type(DataSourceFilterType.CONFLUENCE)
39
+ create_page.should_see_confluence_cql_field()
40
+ create_page.should_see_integration_input_or_button()
41
+
42
+ create_page.select_datasource_type(DataSourceFilterType.JIRA)
43
+ create_page.should_see_jira_jql_field()
44
+ create_page.should_see_integration_input_or_button()
45
+
46
+ create_page.select_datasource_type(DataSourceFilterType.FILE)
47
+ create_page.should_see_file_fields()
48
+ create_page.select_datasource_type(DataSourceFilterType.GOOGLE)
49
+ create_page.should_see_google_fields()
50
+
51
+
52
+ @pytest.mark.datasource_ui
53
+ @pytest.mark.ui
54
+ def test_datasource_creation_validation(page):
55
+ """Test create datasource without data and observing errors."""
56
+ create_page = CreateEditDatasourcePage(page)
57
+
58
+ create_page.navigate_to()
59
+ create_page.select_datasource_type(DataSourceType.GIT).click_create()
60
+ create_page.should_see_error_for_empty_main_fields()
61
+ create_page.should_see_error_for_empty_git_fields()
62
+
63
+ create_page.select_datasource_type(DataSourceFilterType.CONFLUENCE).click_create()
64
+ create_page.should_see_error_for_empty_main_fields()
65
+ create_page.should_see_error_for_empty_confluence_fields()
66
+
67
+ create_page.select_datasource_type(DataSourceFilterType.JIRA).click_create()
68
+ create_page.should_see_error_for_empty_main_fields()
69
+ create_page.should_see_error_for_empty_jira_fields()
70
+
71
+ create_page.select_datasource_type(DataSourceFilterType.FILE).click_create()
72
+ create_page.should_see_error_for_empty_main_fields()
73
+ create_page.should_see_error_for_empty_file_fields()
74
+
75
+ create_page.select_datasource_type(DataSourceFilterType.GOOGLE).click_create()
76
+ create_page.should_see_error_for_empty_main_fields()
77
+ create_page.should_see_error_for_empty_google_fields()
78
+
79
+
80
+ @pytest.mark.datasource_ui
81
+ @pytest.mark.ui
82
+ def test_create_git_datasource(page, git_integration):
83
+ """Test creating a new datasource with all required fields."""
84
+ datasource_page = DataSourcePage(page)
85
+ create_page = CreateEditDatasourcePage(page)
86
+
87
+ create_page.navigate_to()
88
+ datasource = create_page.create_git_datasource(
89
+ project_name=PROJECT,
90
+ repo_link=CredentialsManager.get_parameter("GITLAB_PROJECT"),
91
+ branch="main",
92
+ integration=git_integration.alias,
93
+ )
94
+
95
+ datasource_page.should_see_table_row_with_values(
96
+ name=datasource,
97
+ status=DataSourceStatus.COMPLETED,
98
+ project=PROJECT,
99
+ type_=DataSourceFilterType.CODE,
100
+ created_by=TEST_USER,
101
+ )
102
+
103
+
104
+ @pytest.mark.datasource_ui
105
+ @pytest.mark.ui
106
+ def test_create_confluence_datasource(page, confluence_integration):
107
+ """Test creating a new datasource with all required fields."""
108
+ datasource_page = DataSourcePage(page)
109
+ create_page = CreateEditDatasourcePage(page)
110
+
111
+ create_page.navigate_to()
112
+ datasource = create_page.create_confluence_datasource(
113
+ project_name=PROJECT,
114
+ cql_query=CredentialsManager.confluence_cql(),
115
+ integration=confluence_integration.alias,
116
+ )
117
+
118
+ datasource_page.should_see_table_row_with_values(
119
+ name=datasource,
120
+ status=DataSourceStatus.COMPLETED,
121
+ project=PROJECT,
122
+ type_=DataSourceFilterType.CONFLUENCE,
123
+ created_by=TEST_USER,
124
+ )
125
+
126
+
127
+ @pytest.mark.datasource_ui
128
+ @pytest.mark.ui
129
+ def test_create_jira_datasource(page, jira_integration):
130
+ """Test creating a new datasource with all required fields."""
131
+ datasource_page = DataSourcePage(page)
132
+ create_page = CreateEditDatasourcePage(page)
133
+
134
+ create_page.navigate_to()
135
+ datasource = create_page.create_jira_datasource(
136
+ project_name=PROJECT,
137
+ jql_query=CredentialsManager.jira_jql(),
138
+ integration=jira_integration.alias,
139
+ )
140
+
141
+ datasource_page.should_see_table_row_with_values(
142
+ name=datasource,
143
+ status=DataSourceStatus.COMPLETED,
144
+ project=PROJECT,
145
+ type_=DataSourceFilterType.JIRA,
146
+ created_by=TEST_USER,
147
+ )
148
+
149
+
150
+ @pytest.mark.datasource_ui
151
+ @pytest.mark.ui
152
+ def test_create_file_datasource(page):
153
+ """Test creating a new datasource with all required fields."""
154
+ datasource_page = DataSourcePage(page)
155
+ create_page = CreateEditDatasourcePage(page)
156
+
157
+ create_page.navigate_to()
158
+ datasource = create_page.create_file_datasource(
159
+ project_name=PROJECT,
160
+ file_path=[str(FILES_PATH / "test.txt")],
161
+ )
162
+
163
+ datasource_page.should_see_table_row_with_values(
164
+ name=datasource,
165
+ status=DataSourceStatus.COMPLETED,
166
+ project=PROJECT,
167
+ type_=DataSourceFilterType.FILE,
168
+ created_by=TEST_USER,
169
+ )
170
+
171
+
172
+ @pytest.mark.datasource_ui
173
+ @pytest.mark.ui
174
+ def test_create_google_datasource(page):
175
+ """Test creating a new datasource with all required fields."""
176
+ datasource_page = DataSourcePage(page)
177
+ create_page = CreateEditDatasourcePage(page)
178
+
179
+ create_page.navigate_to()
180
+ datasource = create_page.create_google_datasource(
181
+ project_name=PROJECT,
182
+ google_doc_link=GOOGLE_DOC_URL,
183
+ )
184
+
185
+ datasource_page.should_see_table_row_with_values(
186
+ name=datasource,
187
+ status=DataSourceStatus.COMPLETED,
188
+ project=PROJECT,
189
+ type_=DataSourceFilterType.GOOGLE,
190
+ created_by=TEST_USER,
191
+ )
@@ -0,0 +1,61 @@
1
+ import pytest
2
+
3
+ from codemie_test_harness.tests.ui.pageobject.datasources.datasource_page import (
4
+ DataSourcePage,
5
+ )
6
+ from codemie_test_harness.tests.utils.base_utils import get_random_name
7
+ from codemie_test_harness.tests import TEST_USER
8
+ from codemie_test_harness.tests.ui._test_data.datasource_test_data import (
9
+ MAIN_TITLE_DATASOURCE,
10
+ MAIN_SUBTITLE_DATASOURCE,
11
+ )
12
+
13
+
14
+ @pytest.mark.datasource_ui
15
+ @pytest.mark.ui
16
+ def test_datasource_sidebar_interaction(page):
17
+ """Test sidebar filters interactions."""
18
+ search_input = get_random_name()
19
+ datasource_page = DataSourcePage(page)
20
+
21
+ datasource_page.navigate_to()
22
+ datasource_page.sidebar.should_see_title_subtitle(
23
+ MAIN_TITLE_DATASOURCE, MAIN_SUBTITLE_DATASOURCE
24
+ )
25
+ datasource_page.sidebar.input_data_search(search_input).should_see_search_input(
26
+ search_input
27
+ )
28
+ datasource_page.sidebar.should_see_selected_checkboxes()
29
+ datasource_page.sidebar.toggle_created_by_me().should_see_created_by_me_value(
30
+ TEST_USER
31
+ )
32
+ datasource_page.sidebar.should_see_project_filter()
33
+ datasource_page.sidebar.should_see_status_dropdown()
34
+ datasource_page.sidebar.should_select_status_dropdown()
35
+ datasource_page.sidebar.click_clear_all_button().should_see_cleared_filters()
36
+
37
+
38
+ @pytest.mark.datasource_ui
39
+ @pytest.mark.ui
40
+ def test_datasource_sidebar_hiding_elements(page):
41
+ """Test sidebar filters hiding."""
42
+ datasource_page = DataSourcePage(page)
43
+
44
+ datasource_page.navigate_to()
45
+ datasource_page.sidebar.click_type_filter_hide_button().should_not_see_type_filters()
46
+ datasource_page.sidebar.click_project_filter_hide_button().should_not_see_project_filters()
47
+ datasource_page.sidebar.click_created_by_filter_hide_button().should_not_see_created_by_filters()
48
+ datasource_page.sidebar.click_status_filter_hide_button().should_not_see_status_filters()
49
+
50
+
51
+ @pytest.mark.datasource_ui
52
+ @pytest.mark.ui
53
+ def test_datasource_page_elements_visibility(page):
54
+ """Test DataSource index page and sidebar elements are visible."""
55
+ datasource_page = DataSourcePage(page)
56
+
57
+ datasource_page.navigate_to()
58
+ datasource_page.should_see_create_datasource_button()
59
+ datasource_page.should_see_table_rows(minimum_count=10)
60
+ datasource_page.should_see_table_column_names()
61
+ datasource_page.should_see_pagination()
@@ -0,0 +1,184 @@
1
+ import pytest
2
+ from codemie_test_harness.tests import PROJECT, TEST_USER
3
+ from codemie_test_harness.tests.test_data.google_datasource_test_data import (
4
+ GOOGLE_DOC_URL,
5
+ )
6
+ from codemie_test_harness.tests.ui._test_data.datasource_test_data import (
7
+ DataSourceStatus,
8
+ DataSourceFilterType,
9
+ UPDATE_SUBTITLE_DATASOURCE,
10
+ UPDATE_TITLE_DATASOURCE,
11
+ )
12
+ from codemie_test_harness.tests.ui.pageobject.datasources.create_edit_datasource_page import (
13
+ CreateEditDatasourcePage,
14
+ )
15
+ from codemie_test_harness.tests.ui.pageobject.datasources.datasource_page import (
16
+ DataSourcePage,
17
+ )
18
+ from codemie_test_harness.tests.utils.constants import FILES_PATH
19
+
20
+
21
+ @pytest.mark.datasource_ui
22
+ @pytest.mark.ui
23
+ def test_edit_git_datasource(
24
+ page, datasource_utils, git_integration, default_embedding_llm
25
+ ):
26
+ """Test that all main Edit Datasource page elements are visible."""
27
+ datasource_page = DataSourcePage(page)
28
+ edit_page = CreateEditDatasourcePage(page)
29
+
30
+ datasource = datasource_utils.create_gitlab_datasource(
31
+ setting_id=git_integration.id,
32
+ embeddings_model=default_embedding_llm.base_name,
33
+ )
34
+
35
+ datasource_page.navigate_to()
36
+ datasource_page.should_see_table_row_with_values(
37
+ name=datasource.name,
38
+ status=DataSourceStatus.COMPLETED,
39
+ project=PROJECT,
40
+ type_=DataSourceFilterType.CODE,
41
+ created_by=TEST_USER,
42
+ )
43
+
44
+ datasource_page.open_row_action_menu(datasource.name)
45
+ datasource_page.should_see_edit_dropdown_values()
46
+ datasource_page.should_see_edit_dropdown_full_reindex_value()
47
+ datasource_page.click_row_action("Edit")
48
+
49
+ edit_page.sidebar.should_see_title_subtitle(
50
+ UPDATE_TITLE_DATASOURCE, UPDATE_SUBTITLE_DATASOURCE
51
+ )
52
+ edit_page.selector.should_see_disabled_multiselect(PROJECT)
53
+ edit_page.should_see_disabled_name_input(datasource.name)
54
+ edit_page.should_see_save_reindex_button()
55
+
56
+
57
+ @pytest.mark.datasource_ui
58
+ @pytest.mark.ui
59
+ def test_edit_confluence_datasource(page, datasource_utils, confluence_integration):
60
+ """Test that all main Edit Datasource page elements are visible."""
61
+ datasource_page = DataSourcePage(page)
62
+ edit_page = CreateEditDatasourcePage(page)
63
+
64
+ datasource = datasource_utils.create_confluence_datasource(
65
+ setting_id=confluence_integration.id,
66
+ )
67
+
68
+ datasource_page.navigate_to()
69
+ datasource_page.should_see_table_row_with_values(
70
+ name=datasource.name,
71
+ status=DataSourceStatus.COMPLETED,
72
+ project=PROJECT,
73
+ type_=DataSourceFilterType.CONFLUENCE,
74
+ created_by=TEST_USER,
75
+ )
76
+
77
+ datasource_page.open_row_action_menu(datasource.name)
78
+ datasource_page.should_see_edit_dropdown_values()
79
+ datasource_page.should_see_edit_dropdown_full_reindex_value()
80
+ datasource_page.click_row_action("Edit")
81
+
82
+ edit_page.sidebar.should_see_title_subtitle(
83
+ UPDATE_TITLE_DATASOURCE, UPDATE_SUBTITLE_DATASOURCE
84
+ )
85
+ edit_page.selector.should_see_disabled_multiselect(PROJECT)
86
+ edit_page.should_see_disabled_name_input(datasource.name)
87
+ edit_page.should_see_save_reindex_button()
88
+
89
+
90
+ @pytest.mark.datasource_ui
91
+ @pytest.mark.ui
92
+ def test_edit_jira_datasource(page, datasource_utils, jira_integration):
93
+ """Test that all main Edit Datasource page elements are visible."""
94
+ datasource_page = DataSourcePage(page)
95
+ edit_page = CreateEditDatasourcePage(page)
96
+
97
+ datasource = datasource_utils.create_jira_datasource(
98
+ setting_id=jira_integration.id,
99
+ )
100
+
101
+ datasource_page.navigate_to()
102
+ datasource_page.should_see_table_row_with_values(
103
+ name=datasource.name,
104
+ status=DataSourceStatus.COMPLETED,
105
+ project=PROJECT,
106
+ type_=DataSourceFilterType.JIRA,
107
+ created_by=TEST_USER,
108
+ )
109
+
110
+ datasource_page.open_row_action_menu(datasource.name)
111
+ datasource_page.should_see_edit_dropdown_values()
112
+ datasource_page.should_see_edit_dropdown_index_values()
113
+ datasource_page.click_row_action("Edit")
114
+
115
+ edit_page.sidebar.should_see_title_subtitle(
116
+ UPDATE_TITLE_DATASOURCE, UPDATE_SUBTITLE_DATASOURCE
117
+ )
118
+ edit_page.selector.should_see_disabled_multiselect(PROJECT)
119
+ edit_page.should_see_disabled_name_input(datasource.name)
120
+ edit_page.should_see_save_reindex_button()
121
+
122
+
123
+ @pytest.mark.datasource_ui
124
+ @pytest.mark.ui
125
+ def test_edit_file_datasource(page, datasource_utils):
126
+ """Test that all main Edit Datasource page elements are visible."""
127
+ datasource_page = DataSourcePage(page)
128
+ edit_page = CreateEditDatasourcePage(page)
129
+
130
+ datasource = datasource_utils.create_file_datasource(
131
+ files=[str(FILES_PATH / "test.txt")],
132
+ )
133
+
134
+ datasource_page.navigate_to()
135
+ datasource_page.should_see_table_row_with_values(
136
+ name=datasource.name,
137
+ status=DataSourceStatus.COMPLETED,
138
+ project=PROJECT,
139
+ type_=DataSourceFilterType.FILE,
140
+ created_by=TEST_USER,
141
+ )
142
+
143
+ datasource_page.open_row_action_menu(datasource.name)
144
+ datasource_page.should_see_edit_dropdown_values()
145
+ datasource_page.click_row_action("Edit")
146
+
147
+ edit_page.sidebar.should_see_title_subtitle(
148
+ UPDATE_TITLE_DATASOURCE, UPDATE_SUBTITLE_DATASOURCE
149
+ )
150
+ edit_page.selector.should_see_disabled_multiselect(PROJECT)
151
+ edit_page.should_see_disabled_name_input(datasource.name)
152
+
153
+
154
+ @pytest.mark.datasource_ui
155
+ @pytest.mark.ui
156
+ def test_edit_google_datasource(page, datasource_utils):
157
+ """Test that all main Edit Datasource page elements are visible."""
158
+ datasource_page = DataSourcePage(page)
159
+ edit_page = CreateEditDatasourcePage(page)
160
+
161
+ datasource = datasource_utils.create_google_doc_datasource(
162
+ google_doc=GOOGLE_DOC_URL
163
+ )
164
+
165
+ datasource_page.navigate_to()
166
+ datasource_page.should_see_table_row_with_values(
167
+ name=datasource.name,
168
+ status=DataSourceStatus.COMPLETED,
169
+ project=PROJECT,
170
+ type_=DataSourceFilterType.GOOGLE,
171
+ created_by=TEST_USER,
172
+ )
173
+
174
+ datasource_page.open_row_action_menu(datasource.name)
175
+ datasource_page.should_see_edit_dropdown_values()
176
+ datasource_page.should_see_edit_dropdown_full_reindex_value()
177
+ datasource_page.click_row_action("Edit")
178
+
179
+ edit_page.sidebar.should_see_title_subtitle(
180
+ UPDATE_TITLE_DATASOURCE, UPDATE_SUBTITLE_DATASOURCE
181
+ )
182
+ edit_page.selector.should_see_disabled_multiselect(PROJECT)
183
+ edit_page.should_see_disabled_name_input(datasource.name)
184
+ edit_page.should_see_save_reindex_button()