graphdb-workbench-tests 3.0.0-TR4 → 3.0.0-TR6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/fixtures/graphdb-import/ontology-and-shapes.ttl +562 -0
  2. package/fixtures/graphdb-import/swapi-dataset.ttl +4393 -0
  3. package/fixtures/graphql/endpoints/graphql-endpoints-info.json +49 -0
  4. package/fixtures/graphql/endpoints/graphql-endpoints.json +17 -0
  5. package/fixtures/graphql/endpoints/graphql-swapi-endpoints.json +23 -0
  6. package/fixtures/graphql/endpoints/no-graphql-endpoints-info.json +3 -0
  7. package/fixtures/graphql/soml/swapi-schema-film-restricted.yaml +335 -0
  8. package/fixtures/graphql/soml/swapi-schema.yaml +857 -0
  9. package/fixtures/locale-en.json +173 -1
  10. package/integration/graphql/create-graphql-endpoint.spec.js +261 -0
  11. package/integration/graphql/graphql-endpoint-filtering.spec.js +69 -0
  12. package/integration/graphql/graphql-endpoint-management-view.spec.js +131 -0
  13. package/integration/import/import-server-files-batch-operations.spec.js +4 -3
  14. package/integration/import/import-server-files.spec.js +7 -7
  15. package/integration/import/import-view.spec.js +2 -1
  16. package/integration/sparql-editor/actions/show-saved-queries.spec.js +1 -1
  17. package/npm-shrinkwrap.json +2 -2
  18. package/package.json +1 -1
  19. package/steps/graphql/create-graphql-endpoint-steps.js +253 -0
  20. package/steps/graphql/graphql-endpoint-management-steps.js +84 -0
  21. package/steps/graphql/graphql-playground-steps.js +1 -1
  22. package/steps/import/import-test-constants.js +1 -0
  23. package/stubs/graphql/graphql-stubs.js +30 -4
  24. package/stubs/repositories/repositories-stubs.js +4 -0
  25. package/stubs/yasgui/query-stubs.js +2 -2
  26. package/support/import-commands.js +28 -0
  27. package/fixtures/graphql-editor/graphql-endpoints.json +0 -17
  28. /package/fixtures/{graphql-editor → graphql/editor}/countries-schema.json +0 -0
  29. /package/fixtures/{graphql-editor → graphql/editor}/rick-and-morty-schema.json +0 -0
  30. /package/fixtures/{graphql-editor → queries}/default-query-response.json +0 -0
@@ -435,7 +435,7 @@
435
435
  "form": {
436
436
  "agent_name": {
437
437
  "label": "Agent name",
438
- "placeholder": "Enter a user friendly name",
438
+ "placeholder": "Enter а user friendly name",
439
439
  "tooltip": "A descriptive name that helps you identify this agent."
440
440
  },
441
441
  "repository": {
@@ -725,6 +725,174 @@
725
725
  "help.how.content1": "<b>Talk to Your Graph</b> is powered by OpenAI's Assistants API. You begin by selecting or configuring an agent, which defines the context and rules for querying. Once set, you can start a conversation by asking questions in natural language. The assistant interprets your query, runs the appropriate query methods to retrieve data, and responds with an answer. Persistent chat ensures conversations stay contextually aware, enabling deeper, more coherent interactions over time. You can use multiple agents concurrently to cover various domains or data sources.",
726
726
  "help.how.content2": "An agent in <b>Talk to Your Graph</b> is an AI-driven assistant specifically configured to interact with your graph database. It uses advanced natural language processing to understand and respond to your questions by querying the database and delivering relevant information. Each agent is tailored to a specific context, making interactions seamless and efficient, whether you're retrieving data, exploring insights, or working on complex projects."
727
727
  },
728
+ "graphql": {
729
+ "playground": {
730
+ "message": {
731
+ "no_schemas_in_repository": "No active endpoints found in the current repository. Manage the GraphQL schemas <a href=\"#\">here</a>"
732
+ },
733
+ "endpoint_selector": {
734
+ "tooltip": "Select a GraphQL endpoint"
735
+ }
736
+ },
737
+ "endpoints_management": {
738
+ "toolbar": {
739
+ "endpoints_filter": {
740
+ "placeholder": "Filter by ID or Label"
741
+ },
742
+ "create_endpoint": {
743
+ "label": "New endpoint",
744
+ "tooltip": "Create a new GraphQL endpoint"
745
+ },
746
+ "import_schema": {
747
+ "label": "Import schema definition",
748
+ "tooltip": "Import a GraphQL endpoint schema definition"
749
+ }
750
+ },
751
+ "table": {
752
+ "column": {
753
+ "id": "Id",
754
+ "label": "Label",
755
+ "is_default": "Default",
756
+ "is_active": "Active",
757
+ "modified_on": "Modified",
758
+ "types_count": "Types",
759
+ "props_count": "Properties",
760
+ "actions": "Actions"
761
+ },
762
+ "actions": {
763
+ "explore_endpoint": {
764
+ "active": {
765
+ "tooltip": "Explore the endpoint in the GraphQL Playground"
766
+ },
767
+ "inactive": {
768
+ "tooltip": "The endpoint is not active and cannot be explored in the GraphQL Playground"
769
+ }
770
+ },
771
+ "create_endpoint": {
772
+ "label": "Create endpoint",
773
+ "tooltip": "Create a new GraphQL endpoint"
774
+ },
775
+ "import_schema": {
776
+ "label": "Import schema definition",
777
+ "tooltip": "Import a GraphQL endpoint schema definition"
778
+ },
779
+ "configure_endpoint": {
780
+ "label": "Configure endpoint",
781
+ "tooltip": "Configure the GraphQL endpoint"
782
+ },
783
+ "delete_endpoint": {
784
+ "label": "Delete endpoint",
785
+ "tooltip": "Delete the GraphQL endpoint"
786
+ },
787
+ "export_schema": {
788
+ "label": "Export schema definition",
789
+ "tooltip": "Export the GraphQL endpoint schema definition"
790
+ }
791
+ },
792
+ "messages": {
793
+ "endpoints_filter_no_result": "No GraphQL endpoints found for current search criteria",
794
+ "no_endpoints_in_repository": "No GraphQL endpoints found in the repository"
795
+ },
796
+ "labels": {
797
+ "description": "Description"
798
+ }
799
+ }
800
+ },
801
+ "create_endpoint": {
802
+ "toolbar": {
803
+ "source_repository_selector": {
804
+ "label": "Source repository",
805
+ "tooltip": "Select the repository to use as the source for the schemas of the new GraphQL endpoint"
806
+ }
807
+ },
808
+ "wizard_steps": {
809
+ "select_schema_source": {
810
+ "title": "Select schema source",
811
+ "source_type": {
812
+ "graphql_schema_shapes": {
813
+ "label": "GraphQL schema shapes"
814
+ },
815
+ "shacl_shapes": {
816
+ "label": "OWL ontologies/SHACL shapes"
817
+ }
818
+ },
819
+ "graphql_schema_shapes": {
820
+ "title": "GraphQL schema shapes",
821
+ "messages": {
822
+ "no_schemas": "No GraphQL schema shapes were found in the selected repository. You can choose or browse other repositories or choose the other source.",
823
+ "endpoint_per_shape": "Each GraphQL schema shape results in one endpoint"
824
+ }
825
+ },
826
+ "shacl_shapes": {
827
+ "title": "Set endpoint",
828
+ "form": {
829
+ "endpoint_id": {
830
+ "label": "Endpoint ID",
831
+ "tooltip": "The unique identifier for the new GraphQL endpoint. It must be unique within the repository.",
832
+ "placeholder": "star-wars"
833
+ },
834
+ "vocabulary_prefix": {
835
+ "label": "Vocabulary prefix",
836
+ "tooltip": "Vocabulary prefix",
837
+ "placeholder": "Select prefix"
838
+ },
839
+ "endpoint_label": {
840
+ "label": "Endpoint label",
841
+ "tooltip": "The label for the new GraphQL endpoint",
842
+ "placeholder": "Star Wars"
843
+ }
844
+ },
845
+ "source": {
846
+ "use_all_graphs": {
847
+ "label": "Use all graphs",
848
+ "messages": {
849
+ "all_graphs": "All {{count}} graphs are included for endpoint creation"
850
+ }
851
+ },
852
+ "use_shacl_shape_graph": {
853
+ "label": "Use SHACL shape graph",
854
+ "messages": {
855
+ "all_shacl_shape_graphs": "All {{count}} SHACL shape graphs are included for endpoint creation"
856
+ }
857
+ },
858
+ "pick_graphs": {
859
+ "label": "Select one or more graphs"
860
+ }
861
+ },
862
+ "messages": {
863
+
864
+ }
865
+ }
866
+ },
867
+ "configure_endpoint": {
868
+ "title": "Configure endpoint",
869
+ "endpoint_parameters": {
870
+ "title": "Parameters",
871
+ "form": {}
872
+ }
873
+ },
874
+ "actions": {
875
+ "next": {
876
+ "label": "Next"
877
+ },
878
+ "back": {
879
+ "label": "Back"
880
+ },
881
+ "cancel": {
882
+ "label": "Cancel",
883
+ "tooltip": "Cancel the creation of the new GraphQL endpoint and return to the list of endpoints",
884
+ "confirmation": {
885
+ "title": "Cancel endpoint creation",
886
+ "body": "Are you sure you want to cancel the creation of the new GraphQL endpoint?"
887
+ }
888
+ },
889
+ "generate_endpoint": {
890
+ "label": "Generate"
891
+ }
892
+ }
893
+ }
894
+ }
895
+ },
728
896
  "config.name.label": "Config name",
729
897
  "graph.config.required": "My graph config (required)",
730
898
  "description.text": "Description",
@@ -1265,6 +1433,10 @@
1265
1433
  "menu.support.label": "Support",
1266
1434
  "menu.guides.label": "Interactive guides",
1267
1435
  "menu.plugins.label": "Plugins",
1436
+ "menu.graphql.label": "GraphQL",
1437
+ "menu.graphql-endpoint-management.label": "Endpoint Management",
1438
+ "menu.create-graphql-endpoint.label": "New endpoint",
1439
+ "menu.graphql-playground.label": "GraphQL Playground",
1268
1440
  "core.popover.get.url.query": "Get URL to query",
1269
1441
  "core.popover.shared.query.warning": "Query shared by another user. You may not edit or delete it.",
1270
1442
  "core.edit.query": "Edit query",
@@ -0,0 +1,261 @@
1
+ import {GraphqlEndpointManagementSteps} from "../../steps/graphql/graphql-endpoint-management-steps";
2
+ import {GraphqlStubs} from "../../stubs/graphql/graphql-stubs";
3
+ import {CreateGraphqlEndpointSteps} from "../../steps/graphql/create-graphql-endpoint-steps";
4
+ import {RepositoriesStubs} from "../../stubs/repositories/repositories-stubs";
5
+ import {ModalDialogSteps} from "../../steps/modal-dialog-steps";
6
+
7
+ describe('Graphql: create endpoint', () => {
8
+ let repositoryId;
9
+
10
+ beforeEach(() => {
11
+ repositoryId = 'create-graphql-endpoint-' + Date.now();
12
+ cy.createRepository({id: repositoryId});
13
+ cy.presetRepository(repositoryId);
14
+ // TODO: remove stubs and enable next imports when REST API is ready
15
+ cy.importServerFile(repositoryId, 'swapi-dataset.ttl');
16
+ // cy.importServerFile(repositoryId, 'ontology-and-shapes.ttl');
17
+ // cy.uploadGraphqlSchema(repositoryId, 'graphql/soml/swapi-schema.yaml', 'swapi');
18
+ // GraphqlStubs.stubGetNoEndpointsInfo(repositoryId);
19
+ // GraphqlStubs.stubGetEndpoints(repositoryId, 'graphql-swapi-endpoints.json');
20
+ RepositoriesStubs.spyGetRepositories();
21
+ });
22
+
23
+ afterEach(() => {
24
+ cy.deleteRepository(repositoryId);
25
+ });
26
+
27
+ it('should be able to start graphql endpoint creation wizard - no source data', () => {
28
+ // Given I have a repository with no active GraphQL endpoints
29
+ // When I visit the endpoint management view
30
+ GraphqlEndpointManagementSteps.visit();
31
+ cy.wait('@getRepositories');
32
+ // Then I should see no endpoints
33
+ GraphqlEndpointManagementSteps.getEndpointTable().should('not.exist');
34
+ // When I click on the create endpoint button
35
+ GraphqlEndpointManagementSteps.createEndpoint();
36
+ // Then I should see the create endpoint wizard
37
+ CreateGraphqlEndpointSteps.getView().should('be.visible');
38
+ cy.url().should('include', '/graphql/endpoint/create');
39
+ CreateGraphqlEndpointSteps.getSourceRepositorySelector().should('be.visible');
40
+ // And the source repository should be preselected to the active repository
41
+ CreateGraphqlEndpointSteps.getSelectedSourceRepository().should('have.text', repositoryId);
42
+
43
+ // And the active step should be the first step
44
+ CreateGraphqlEndpointSteps.getActiveStep().should('contain', 'Select schema source');
45
+ CreateGraphqlEndpointSteps.getSelectSchemaSourceView().should('be.visible');
46
+ // And the schema source should be preselected to the first option
47
+ CreateGraphqlEndpointSteps.getSchemaSourceTypes().should('have.length', 2);
48
+ CreateGraphqlEndpointSteps.getSelectedSchemaSource().parent().should('contain', 'GraphQL schema shapes');
49
+ // And there must be no graphql schema shapes in the source repository
50
+ CreateGraphqlEndpointSteps.getGraphqlSchemaShapesNotFound().should('be.visible');
51
+
52
+ // When I switch to the second schema source option
53
+ CreateGraphqlEndpointSteps.selectOntologiesAndShaclShapesOption();
54
+ // Then I expect the schema source to be switched to ontologies and SHACL shapes
55
+ CreateGraphqlEndpointSteps.getOntologiesAndShaclShapesView().should('be.visible');
56
+ CreateGraphqlEndpointSteps.getEndpointParamsForm().should('be.visible');
57
+ // And endpoint params form should be empty
58
+ CreateGraphqlEndpointSteps.getEndpointIdFieldInput().should('have.value', '');
59
+ CreateGraphqlEndpointSteps.getEndpointLabelFieldInput().should('have.value', '');
60
+ CreateGraphqlEndpointSteps.getVocabularyPrefixSelectSelectedOption().should('be.empty');
61
+
62
+ // And Use all graphs option should be selected by default
63
+ CreateGraphqlEndpointSteps.getSelectedGraphSource().parent().should('contain', 'Use all graphs');
64
+ // And No graphs should be found
65
+ CreateGraphqlEndpointSteps.getGraphsNotFound().should('be.visible');
66
+
67
+ // When I switch to shacl shape graphs option
68
+ CreateGraphqlEndpointSteps.selectUseShaclShapeGraphsOption();
69
+ CreateGraphqlEndpointSteps.getShaclShapeGraphsNotFound().should('be.visible');
70
+
71
+ // When I switch to pick graphs option
72
+ CreateGraphqlEndpointSteps.selectPickGraphsOption();
73
+ CreateGraphqlEndpointSteps.getPickGraphsNoGraphsFound().should('be.visible');
74
+
75
+ // And the next button should be disabled
76
+ CreateGraphqlEndpointSteps.getNextStepButton().should('be.disabled');
77
+ });
78
+
79
+ it('should be able to select graphql schema shapes and open next step', () => {
80
+ // Given I have a repository with graphql shapes in it
81
+ cy.importServerFile(repositoryId, 'ontology-and-shapes.ttl');
82
+ // When I start the endpoint creation wizard
83
+ GraphqlEndpointManagementSteps.visit();
84
+ cy.wait('@getRepositories');
85
+ GraphqlEndpointManagementSteps.createEndpoint();
86
+ CreateGraphqlEndpointSteps.getView().should('be.visible');
87
+ CreateGraphqlEndpointSteps.getSelectedSourceRepository().should('have.text', repositoryId);
88
+ // Then the select schema source view is visible
89
+ CreateGraphqlEndpointSteps.getActiveStep().should('contain', 'Select schema source');
90
+ CreateGraphqlEndpointSteps.getSelectSchemaSourceView().should('be.visible');
91
+ // And the graphql schema selector is visible
92
+ CreateGraphqlEndpointSteps.getGraphqlSchemaSelector().should('be.visible');
93
+ // And the graphql schema shapes are found
94
+ CreateGraphqlEndpointSteps.getAvailableGraphqlShapes().should('have.length', 2);
95
+ CreateGraphqlEndpointSteps.getSelectedGraphqlShapes().should('have.length', 0);
96
+ CreateGraphqlEndpointSteps.getSelectedGraphqlShapesCountBanner().should('not.exist');
97
+ // And I can select or deselect the graphql shapes
98
+ CreateGraphqlEndpointSteps.selectAllGraphqlShapes();
99
+ CreateGraphqlEndpointSteps.getAvailableGraphqlShapes().should('have.length', 0);
100
+ CreateGraphqlEndpointSteps.getSelectedGraphqlShapes().should('have.length', 2);
101
+ CreateGraphqlEndpointSteps.getSelectedGraphqlShapesCountBanner().should('contain', '2 GraphQL schema shapes included');
102
+ // And the next button should be enabled because I have selected the shapes
103
+ CreateGraphqlEndpointSteps.getNextStepButton().should('be.enabled');
104
+
105
+ CreateGraphqlEndpointSteps.deselectAllGraphqlShapes();
106
+ CreateGraphqlEndpointSteps.getAvailableGraphqlShapes().should('have.length', 2);
107
+ CreateGraphqlEndpointSteps.getSelectedGraphqlShapes().should('have.length', 0);
108
+ CreateGraphqlEndpointSteps.getSelectedGraphqlShapesCountBanner().should('not.exist');
109
+ // And the next button should be disabled because I have not selected any shapes
110
+ CreateGraphqlEndpointSteps.getNextStepButton().should('be.disabled');
111
+
112
+ CreateGraphqlEndpointSteps.selectGraphqlShape(0);
113
+ CreateGraphqlEndpointSteps.getAvailableGraphqlShapes().should('have.length', 1);
114
+ CreateGraphqlEndpointSteps.getAvailableGraphqlShape(0).should('contain', 'Swapi GraphQL Schema');
115
+ CreateGraphqlEndpointSteps.getSelectedGraphqlShapes().should('have.length', 1);
116
+ CreateGraphqlEndpointSteps.getSelectedGraphqlShape(0).should('contain', 'Character GraphQL Schema');
117
+ CreateGraphqlEndpointSteps.getSelectedGraphqlShapesCountBanner().should('contain', '1 GraphQL schema shapes included');
118
+ CreateGraphqlEndpointSteps.deselectAllGraphqlShape(0);
119
+ CreateGraphqlEndpointSteps.getAvailableGraphqlShapes().should('have.length', 2);
120
+ CreateGraphqlEndpointSteps.getSelectedGraphqlShapes().should('have.length', 0);
121
+ CreateGraphqlEndpointSteps.getSelectedGraphqlShapesCountBanner().should('not.exist');
122
+
123
+ // And I can filter the graphql shapes
124
+ CreateGraphqlEndpointSteps.filterSelectedGraphqlShapes('swapi');
125
+ CreateGraphqlEndpointSteps.getAvailableGraphqlShapes().should('have.length', 1);
126
+ CreateGraphqlEndpointSteps.getAvailableGraphqlShape(0).should('contain', 'Swapi GraphQL Schema');
127
+ CreateGraphqlEndpointSteps.filterSelectedGraphqlShapes('non-existing');
128
+ CreateGraphqlEndpointSteps.getAvailableGraphqlShapes().should('have.length', 0);
129
+ CreateGraphqlEndpointSteps.clearSelectedGraphqlShapesFilter();
130
+ CreateGraphqlEndpointSteps.getAvailableGraphqlShapes().should('have.length', 2);
131
+
132
+ // When I select a graphql shacl shape
133
+ CreateGraphqlEndpointSteps.selectGraphqlShape(1);
134
+ // And I proceed to the next step
135
+ CreateGraphqlEndpointSteps.next();
136
+ // Then I should be on the next step
137
+ CreateGraphqlEndpointSteps.getActiveStep().should('contain', 'Configure endpoint');
138
+ CreateGraphqlEndpointSteps.getConfigureEndpointView().should('be.visible');
139
+ // And I should see the cancel button
140
+ CreateGraphqlEndpointSteps.getCancelButton().should('be.visible');
141
+ // And I should see the back button
142
+ CreateGraphqlEndpointSteps.getBackButton().should('be.visible');
143
+
144
+ // When I click on the back button
145
+ CreateGraphqlEndpointSteps.back();
146
+ // Then I should be back on the previous step
147
+ CreateGraphqlEndpointSteps.getActiveStep().should('contain', 'Select schema source');
148
+ // And the graphql schema shapes should be selected as before
149
+ CreateGraphqlEndpointSteps.getAvailableGraphqlShapes().should('have.length', 1);
150
+ CreateGraphqlEndpointSteps.getAvailableGraphqlShape(0).should('contain', 'Character GraphQL Schema');
151
+ CreateGraphqlEndpointSteps.getSelectedGraphqlShapes().should('have.length', 1);
152
+ CreateGraphqlEndpointSteps.getSelectedGraphqlShape(0).should('contain', 'Swapi GraphQL Schema');
153
+ });
154
+
155
+ it('should be able to select graphs and endpoint properties and open next step', () => {
156
+ // Given I have a repository with graphql shapes in it
157
+ cy.importServerFile(repositoryId, 'ontology-and-shapes.ttl');
158
+ // When we upload a SOML schema, two graphs are created, and we can use this to test the behavior for graphs selection
159
+ cy.uploadGraphqlSchema(repositoryId, 'graphql/soml/swapi-schema.yaml', 'swapi');
160
+ // When I start the endpoint creation wizard
161
+ GraphqlEndpointManagementSteps.visit();
162
+ cy.wait('@getRepositories');
163
+ GraphqlEndpointManagementSteps.createEndpoint();
164
+ CreateGraphqlEndpointSteps.getView().should('be.visible');
165
+ CreateGraphqlEndpointSteps.getSelectedSourceRepository().should('have.text', repositoryId);
166
+
167
+ // When I switch to the second schema source option
168
+ CreateGraphqlEndpointSteps.selectOntologiesAndShaclShapesOption();
169
+ CreateGraphqlEndpointSteps.getOntologiesAndShaclShapesView().should('be.visible');
170
+ CreateGraphqlEndpointSteps.getSelectedGraphSource().parent().should('contain', 'Use all graphs');
171
+ // Then I should see the message that all graphs will be used
172
+ CreateGraphqlEndpointSteps.getAllGraphsWillBeUsedMessage().should('be.visible');
173
+ // And the next button should be disabled until endpoint params are filled
174
+ CreateGraphqlEndpointSteps.getNextStepButton().should('be.disabled');
175
+
176
+ // When I fill in the endpoint params
177
+ CreateGraphqlEndpointSteps.typeEndpointId('swapi-endpoint');
178
+ // The next button should still be disabled because there are more required fields
179
+ CreateGraphqlEndpointSteps.getNextStepButton().should('be.disabled');
180
+ // When I fill in the endpoint label which is optional
181
+ CreateGraphqlEndpointSteps.typeEndpointLabel('Swapi endpoint');
182
+ // The next button should still be disabled because there are more required fields
183
+ CreateGraphqlEndpointSteps.getNextStepButton().should('be.disabled');
184
+ // When I select the vocabulary prefix
185
+ CreateGraphqlEndpointSteps.selectVocabularyPrefix('voc');
186
+ // Then the next button should be enabled
187
+ CreateGraphqlEndpointSteps.getNextStepButton().should('be.enabled');
188
+
189
+ // When I switch to SHACL shape graphs option
190
+ CreateGraphqlEndpointSteps.selectUseShaclShapeGraphsOption();
191
+ CreateGraphqlEndpointSteps.getShaclShapeGraphsNotFound().should('be.visible');
192
+ // And the next button should be disabled because there are no graphs to select
193
+ CreateGraphqlEndpointSteps.getNextStepButton().should('be.disabled');
194
+
195
+ // When I switch to pick graphs option
196
+ CreateGraphqlEndpointSteps.selectPickGraphsOption();
197
+ // And the next button should be disabled because no graphs are still selected
198
+ CreateGraphqlEndpointSteps.getNextStepButton().should('be.disabled');
199
+ // And I can select graphs
200
+ CreateGraphqlEndpointSteps.getGraphsSelector().should('be.visible');
201
+ CreateGraphqlEndpointSteps.getAvailableGraphs().should('have.length', 2);
202
+ CreateGraphqlEndpointSteps.getSelectedGraphs().should('have.length', 0);
203
+ CreateGraphqlEndpointSteps.getSelectedGraphsCountBanner().should('not.exist');
204
+ CreateGraphqlEndpointSteps.selectAllGraphs();
205
+ CreateGraphqlEndpointSteps.getAvailableGraphs().should('have.length', 0);
206
+ CreateGraphqlEndpointSteps.getSelectedGraphs().should('have.length', 2);
207
+ CreateGraphqlEndpointSteps.getSelectedGraphsCountBanner().should('contain', '2 SHACL shape graphs are included');
208
+ CreateGraphqlEndpointSteps.getNextStepButton().should('be.enabled');
209
+
210
+ // When I click next
211
+ CreateGraphqlEndpointSteps.next();
212
+ // Then I should be on the next step
213
+ CreateGraphqlEndpointSteps.getActiveStep().should('contain', 'Configure endpoint');
214
+ CreateGraphqlEndpointSteps.getConfigureEndpointView().should('be.visible');
215
+ // And I should see the cancel button
216
+ CreateGraphqlEndpointSteps.getCancelButton().should('be.visible');
217
+ // And I should see the back button
218
+ CreateGraphqlEndpointSteps.getBackButton().should('be.visible');
219
+ // When I click on the back button
220
+ CreateGraphqlEndpointSteps.back();
221
+ // Then I should be back on the previous step
222
+ CreateGraphqlEndpointSteps.getActiveStep().should('contain', 'Select schema source');
223
+ CreateGraphqlEndpointSteps.getSelectedSchemaSource().parent().should('contain', 'OWL ontologies/SHACL shapes');
224
+ CreateGraphqlEndpointSteps.getSelectedGraphSource().parent().should('contain', 'Select one or more graphs');
225
+ CreateGraphqlEndpointSteps.getSelectedGraphs().should('have.length', 2);
226
+ CreateGraphqlEndpointSteps.getEndpointIdFieldInput().should('have.value', 'swapi-endpoint');
227
+ CreateGraphqlEndpointSteps.getEndpointLabelFieldInput().should('have.value', 'Swapi endpoint');
228
+ CreateGraphqlEndpointSteps.getVocabularyPrefixSelectSelectedOption().should('have.text', 'voc');
229
+ });
230
+
231
+ it('should be able to cancel the endpoint creation wizard', () => {
232
+ // Given I have a repository with no active GraphQL endpoints
233
+ // When I visit the endpoint management view
234
+ GraphqlEndpointManagementSteps.visit();
235
+ cy.wait('@getRepositories');
236
+ // Then I should see no endpoints
237
+ GraphqlEndpointManagementSteps.getEndpointTable().should('not.exist');
238
+ // When I click on the create endpoint button
239
+ GraphqlEndpointManagementSteps.createEndpoint();
240
+ // Then I should see the create endpoint wizard
241
+ CreateGraphqlEndpointSteps.getView().should('be.visible');
242
+ CreateGraphqlEndpointSteps.getSelectSchemaSourceView().should('be.visible');
243
+ CreateGraphqlEndpointSteps.getSchemaSourceTypes().should('have.length', 2);
244
+ // When I click on the cancel button
245
+ CreateGraphqlEndpointSteps.cancelEndpointCreation();
246
+ // Then I should see a confirmation dialog
247
+ ModalDialogSteps.getDialog().should('be.visible');
248
+ // When I click on the cancel button in the dialog
249
+ ModalDialogSteps.clickOnCancelButton();
250
+ // Then I should stay on the same page
251
+ ModalDialogSteps.getDialog().should('not.exist');
252
+ cy.url().should('include', '/graphql/endpoint/create');
253
+ // When I click on the cancel button again and confirm
254
+ CreateGraphqlEndpointSteps.cancelEndpointCreation();
255
+ ModalDialogSteps.confirm();
256
+ // Then I should be redirected back to the endpoint management view
257
+ ModalDialogSteps.getDialog().should('not.exist');
258
+ cy.url().should('include', '/graphql/endpoints');
259
+ });
260
+
261
+ });
@@ -0,0 +1,69 @@
1
+ import {GraphqlEndpointManagementSteps} from "../../steps/graphql/graphql-endpoint-management-steps";
2
+ import {GraphqlStubs} from "../../stubs/graphql/graphql-stubs";
3
+
4
+ describe('GraphQL endpoints filtering', () => {
5
+ let repositoryId;
6
+
7
+ beforeEach(() => {
8
+ repositoryId = 'graphql-endpoint-filtering-' + Date.now();
9
+ cy.createRepository({id: repositoryId});
10
+ cy.presetRepository(repositoryId);
11
+ // TODO: remove stubs and enable next imports when REST API is ready
12
+ // cy.importServerFile(repositoryId, 'swapi-dataset.ttl');
13
+ // cy.uploadGraphqlSchema(repositoryId, 'graphql/soml/swapi-schema.yaml', 'swapi');
14
+ GraphqlStubs.stubGetEndpointsInfo(repositoryId);
15
+ GraphqlStubs.stubGetEndpoints(repositoryId, 'graphql-swapi-endpoints.json');
16
+ });
17
+
18
+ afterEach(() => {
19
+ cy.deleteRepository(repositoryId);
20
+ });
21
+
22
+ it('should be able to filter endpoints', () => {
23
+ // Given I have a repository with active GraphQL endpoints
24
+ // When I visit the endpoint management view
25
+ GraphqlEndpointManagementSteps.visit();
26
+ // Then I should see all endpoints
27
+ GraphqlEndpointManagementSteps.getEndpointsInfo().should('have.length', 3);
28
+ // When I filter the endpoints by the term "film"
29
+ GraphqlEndpointManagementSteps.filterEndpoints('film');
30
+ // Then I should see only one endpoint
31
+ GraphqlEndpointManagementSteps.getEndpointsInfo().should('have.length', 1);
32
+ GraphqlEndpointManagementSteps.verifyEndpointInfo([
33
+ {
34
+ id: 'film-restricted',
35
+ label: 'SWAPI GraphQL endpoint with restricted film relations',
36
+ description: 'SWAPI GraphQL endpoint with restricted film relations description',
37
+ default: true,
38
+ active: true,
39
+ modified: '2025-01-28',
40
+ types: 13,
41
+ properties: 133
42
+ }
43
+ ]);
44
+ // When I clear the filter
45
+ GraphqlEndpointManagementSteps.clearFilter();
46
+ // Then I should see all endpoints
47
+ GraphqlEndpointManagementSteps.getEndpointsInfo().should('have.length', 3);
48
+ });
49
+
50
+ it('should render no results banner when all endpoints are filtered', () => {
51
+ // Given I have a repository with active GraphQL endpoints
52
+ // When I visit the endpoint management view
53
+ GraphqlEndpointManagementSteps.visit();
54
+ // Then I should see all endpoints
55
+ GraphqlEndpointManagementSteps.getEndpointsInfo().should('have.length', 3);
56
+ // And the no results banner should not be visible
57
+ GraphqlEndpointManagementSteps.getNoResultsInTableBanner().should('not.exist');
58
+ // When I filter the endpoints by the term "starship"
59
+ GraphqlEndpointManagementSteps.filterEndpoints('starship');
60
+ // Then I should see the no results banner
61
+ GraphqlEndpointManagementSteps.getNoResultsInTableBanner().should('be.visible');
62
+ // When I clear the filter
63
+ GraphqlEndpointManagementSteps.clearFilter();
64
+ // Then I should see all endpoints
65
+ GraphqlEndpointManagementSteps.getEndpointsInfo().should('have.length', 3);
66
+ // And the no results banner should not be visible
67
+ GraphqlEndpointManagementSteps.getNoResultsInTableBanner().should('not.exist');
68
+ });
69
+ });
@@ -0,0 +1,131 @@
1
+ import {GraphqlEndpointManagementSteps} from "../../steps/graphql/graphql-endpoint-management-steps";
2
+ import {GraphqlStubs} from "../../stubs/graphql/graphql-stubs";
3
+ import {GraphqlPlaygroundSteps} from "../../steps/graphql/graphql-playground-steps";
4
+ import {ApplicationSteps} from "../../steps/application-steps";
5
+
6
+ describe('GraphQL endpoints management', () => {
7
+ let repositoryId;
8
+
9
+ beforeEach(() => {
10
+ repositoryId = 'graphql-endpoint-management-' + Date.now();
11
+ cy.createRepository({id: repositoryId});
12
+ cy.presetRepository(repositoryId);
13
+ // TODO: remove stubs and enable next imports when REST API is ready
14
+ // cy.importServerFile(repositoryId, 'swapi-dataset.ttl');
15
+ // cy.uploadGraphqlSchema(repositoryId, 'graphql/soml/swapi-schema.yaml', 'swapi');
16
+ GraphqlStubs.stubGetEndpointsInfo(repositoryId);
17
+ GraphqlStubs.stubGetEndpoints(repositoryId, 'graphql-swapi-endpoints.json');
18
+ });
19
+
20
+ afterEach(() => {
21
+ cy.deleteRepository(repositoryId);
22
+ });
23
+
24
+ it('should render endpoint management view', () => {
25
+ // Given I have a repository with active GraphQL endpoints
26
+ // When I visit the endpoint management view
27
+ GraphqlEndpointManagementSteps.visit();
28
+ // Then I should see the endpoint management view
29
+ GraphqlEndpointManagementSteps.getView().should('be.visible');
30
+ // And I should see the page info tooltip
31
+ // TODO: not ready yet
32
+ // And I should see the documentation link
33
+ // TODO: not ready yet
34
+ // And I should see the endpoints filter field
35
+ GraphqlEndpointManagementSteps.getEndpointFilterField().should('be.visible');
36
+ // And I should see the create endpoint button
37
+ GraphqlEndpointManagementSteps.getCreateEndpointButton().should('be.visible');
38
+ // And I should see the import endpoint schema definition button
39
+ GraphqlEndpointManagementSteps.getImportEndpointSchemaDefinitionButton().should('be.visible');
40
+ // And I should see the endpoint list
41
+ GraphqlEndpointManagementSteps.getEndpointTable().should('be.visible');
42
+ });
43
+
44
+ it('should render no results banner when no endpoints are found for the current repository', () => {
45
+ // Given I have a repository with no active GraphQL endpoints
46
+ GraphqlStubs.stubGetEndpointsInfo(repositoryId, 'no-graphql-endpoints-info.json');
47
+ // When I visit the endpoint management view
48
+ GraphqlEndpointManagementSteps.visit();
49
+ // Then I should see the no results banner
50
+ GraphqlEndpointManagementSteps.getNoEndpointsInRepositoryBanner().should('be.visible');
51
+ });
52
+
53
+ it('should render no results banner when endpoints are not loaded due to some error', () => {
54
+ // Given I have a repository with active GraphQL endpoints
55
+ // And the endpoints info cannot be loaded due to some error
56
+ GraphqlStubs.stubGetEndpointsInfoError(repositoryId);
57
+ // When I visit the endpoint management view
58
+ GraphqlEndpointManagementSteps.visit();
59
+ // Then I should see a toast with the error message
60
+ ApplicationSteps.getErrorNotifications().should('be.visible');
61
+ // Then I should see the no results banner
62
+ GraphqlEndpointManagementSteps.getNoEndpointsInRepositoryBanner().should('be.visible');
63
+ });
64
+
65
+ it('should render endpoints info', () => {
66
+ // Given I have a repository with active GraphQL endpoints
67
+ // When I visit the endpoint management view
68
+ GraphqlEndpointManagementSteps.visit();
69
+ // Then I should see the endpoints info
70
+ GraphqlEndpointManagementSteps.getEndpointTable().within(() => {
71
+ cy.get('thead th').should('have.length', 9);
72
+ cy.get('thead th').eq(1).should('contain', 'Id');
73
+ cy.get('thead th').eq(2).should('contain', 'Label');
74
+ cy.get('thead th').eq(3).should('contain', 'Default');
75
+ cy.get('thead th').eq(4).should('contain', 'Active');
76
+ cy.get('thead th').eq(5).should('contain', 'Modified');
77
+ cy.get('thead th').eq(6).should('contain', 'Types');
78
+ cy.get('thead th').eq(7).should('contain', 'Properties');
79
+ cy.get('thead th').eq(8).should('contain', 'Actions');
80
+ });
81
+ GraphqlEndpointManagementSteps.getEndpointsInfo().should('have.length', 3);
82
+ GraphqlEndpointManagementSteps.verifyEndpointInfo([
83
+ {
84
+ id: 'swapi',
85
+ label: 'SWAPI GraphQL endpoint',
86
+ description: 'SWAPI GraphQL endpoint description',
87
+ default: false,
88
+ active: true,
89
+ modified: '2025-01-28',
90
+ types: 10,
91
+ properties: 120
92
+ },
93
+ {
94
+ id: 'film-restricted',
95
+ label: 'SWAPI GraphQL endpoint with restricted film relations',
96
+ description: 'SWAPI GraphQL endpoint with restricted film relations description',
97
+ default: true,
98
+ active: true,
99
+ modified: '2025-01-28',
100
+ types: 13,
101
+ properties: 133
102
+ },
103
+ {
104
+ id: 'swapi-characters',
105
+ label: 'SWAPI GraphQL endpoint for swapi characters',
106
+ description: 'SWAPI GraphQL endpoint for swapi characters description',
107
+ default: false,
108
+ active: false,
109
+ modified: '2025-01-28',
110
+ types: 3,
111
+ properties: 20
112
+ }
113
+ ]);
114
+ });
115
+
116
+ it('should be able to explore graphql endpoints which are active', () => {
117
+ // Given I have a repository with active GraphQL endpoints
118
+ // When I visit the endpoint management view
119
+ GraphqlEndpointManagementSteps.visit();
120
+ // Then I expect that inactive endpoints should not be clickable
121
+ GraphqlEndpointManagementSteps.getEndpointLink(0).should('have.prop', 'tagName', 'A');
122
+ GraphqlEndpointManagementSteps.getEndpointLink(1).should('have.prop', 'tagName', 'A');
123
+ GraphqlEndpointManagementSteps.getEndpointLink(2).should('have.prop', 'tagName', 'SPAN');
124
+ // And I click on some endpoint
125
+ GraphqlEndpointManagementSteps.exploreEndpoint(1);
126
+ // Then I should be redirected to the GraphQL playground view
127
+ cy.url().should('include', '/graphql/playground');
128
+ // And the selected endpoint should be the one I clicked
129
+ GraphqlPlaygroundSteps.getSelectedEndpoint().should('contain', 'film-restricted');
130
+ });
131
+ });