graphdb-workbench-tests 3.0.0-TR5 → 3.0.0-TR7
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.
- package/fixtures/graphdb-import/ontology-and-shapes.ttl +562 -0
- package/fixtures/graphql/endpoints/graphql-endpoint-configuration-types.json +46 -0
- package/fixtures/graphql/endpoints/graphql-endpoint-configuration.json +227 -0
- package/fixtures/graphql/endpoints/graphql-endpoints.json +4 -4
- package/fixtures/graphql/endpoints/graphql-swapi-endpoints.json +6 -6
- package/integration/graphql/create-graphql-endpoint.spec.js +213 -5
- package/integration/graphql/delete-graphql-endpoint.spec.js +46 -0
- package/integration/graphql/edit-graphql-enpoint.spec.js +196 -0
- package/integration/graphql/graphql-endpoint-filtering.spec.js +1 -1
- package/integration/graphql/graphql-endpoint-management-view.spec.js +1 -1
- package/integration/import/import-server-files-batch-operations.spec.js +4 -3
- package/integration/import/import-server-files.spec.js +7 -7
- package/integration/import/import-view.spec.js +2 -1
- package/integration/setup/namespaces.spec.js +19 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/steps/graphql/create-graphql-endpoint-steps.js +229 -1
- package/steps/graphql/edit-graphql-endpoint-steps.js +90 -0
- package/steps/graphql/graphql-endpoint-management-steps.js +30 -0
- package/steps/import/import-test-constants.js +1 -0
- package/steps/modal-dialog-steps.js +5 -1
- package/steps/setup/namespace-steps.js +17 -0
- package/stubs/graphql/graphql-stubs.js +17 -0
- /package/fixtures/graphql/{schema → soml}/swapi-schema-film-restricted.yaml +0 -0
- /package/fixtures/graphql/{schema → soml}/swapi-schema.yaml +0 -0
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
{
|
|
2
|
+
"configs": [
|
|
3
|
+
{
|
|
4
|
+
"key": "enable_mutations",
|
|
5
|
+
"label": "enable_mutations",
|
|
6
|
+
"description": "Controls whether the generated GraphQL schema should include object mutations or not.",
|
|
7
|
+
"type": "boolean",
|
|
8
|
+
"collection": false,
|
|
9
|
+
"value": null,
|
|
10
|
+
"values": null,
|
|
11
|
+
"required": false,
|
|
12
|
+
"regex": null
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"key": "lang.fetch",
|
|
16
|
+
"label": "fetch",
|
|
17
|
+
"description": "Default language fetch configuration",
|
|
18
|
+
"type": "string",
|
|
19
|
+
"collection": false,
|
|
20
|
+
"value": null,
|
|
21
|
+
"values": null,
|
|
22
|
+
"required": false,
|
|
23
|
+
"regex": "^(?:ALL:?)?(?:(?:-?[\\w]{2}(?:-[\\w]*)?~?|-?NONE|ANY|BROWSER)?(?:,(?:-?[\\w]{2}(?:-[\\w]*)?~?|-?NONE|ANY|BROWSER))*)$"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"key": "lang.validate",
|
|
27
|
+
"label": "validate",
|
|
28
|
+
"description": "Default language validation configuration",
|
|
29
|
+
"type": "string",
|
|
30
|
+
"collection": false,
|
|
31
|
+
"value": "UNIQ",
|
|
32
|
+
"values": null,
|
|
33
|
+
"required": false,
|
|
34
|
+
"regex": "^(?:[\\w]{2}~?|NONE|ANY|ALL)?(?:,(?:[\\w]{2}~?|NONE|ANY|ALL))*(?:;?UNIQ)?$"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"key": "lang.implicit",
|
|
38
|
+
"label": "implicit",
|
|
39
|
+
"description": "Default language to use when inserting rdf:langString values.",
|
|
40
|
+
"type": "string",
|
|
41
|
+
"collection": false,
|
|
42
|
+
"value": "en",
|
|
43
|
+
"values": null,
|
|
44
|
+
"required": false,
|
|
45
|
+
"regex": "[\\w]{2}(?:-[\\w]*)?"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"key": "lang.defaultNameFetch",
|
|
49
|
+
"label": "defaultNameFetch",
|
|
50
|
+
"description": "Default language spec to apply when loading values for the name property",
|
|
51
|
+
"type": "string",
|
|
52
|
+
"collection": false,
|
|
53
|
+
"value": "ANY",
|
|
54
|
+
"values": null,
|
|
55
|
+
"required": false,
|
|
56
|
+
"regex": "^(?:(?:-?[\\w]{2}(?:-[\\w]*)?~?|-?NONE|ANY|BROWSER)?(?:,(?:-?[\\w]{2}(?:-[\\w]*)?~?|-?NONE|ANY|BROWSER))*)$"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"key": "lang.appendDefaultNameFetch",
|
|
60
|
+
"label": "appendDefaultNameFetch",
|
|
61
|
+
"description": "Specifies whether the default spec, if any, should be appended or not to any user-defined name fetch spec",
|
|
62
|
+
"type": "boolean",
|
|
63
|
+
"collection": false,
|
|
64
|
+
"value": true,
|
|
65
|
+
"values": null,
|
|
66
|
+
"required": false,
|
|
67
|
+
"regex": null
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"key": "queryPfx",
|
|
71
|
+
"label": "queryPfx",
|
|
72
|
+
"description": "Allows setting a prefix that will be put in all queries in the GraphQL schema.",
|
|
73
|
+
"type": "string",
|
|
74
|
+
"collection": false,
|
|
75
|
+
"value": null,
|
|
76
|
+
"values": null,
|
|
77
|
+
"required": false,
|
|
78
|
+
"regex": "[\\w]*"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"key": "mutationPfx",
|
|
82
|
+
"label": "mutationPfx",
|
|
83
|
+
"description": "Allows setting a prefix that will be put in all mutations in the GraphQL schema.",
|
|
84
|
+
"type": "string",
|
|
85
|
+
"collection": false,
|
|
86
|
+
"value": null,
|
|
87
|
+
"values": null,
|
|
88
|
+
"required": false,
|
|
89
|
+
"regex": "[\\w]*"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"key": "search",
|
|
93
|
+
"label": "search",
|
|
94
|
+
"description": "Allows you to define a structure of the searchable data for fields that are not specified in the configuration of the objects and/or properties",
|
|
95
|
+
"type": "dictionary",
|
|
96
|
+
"collection": false,
|
|
97
|
+
"value": null,
|
|
98
|
+
"values": null,
|
|
99
|
+
"required": false,
|
|
100
|
+
"regex": null
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"key": "repository",
|
|
104
|
+
"label": "repository",
|
|
105
|
+
"description": "Changes the default repository used for the entire schema.",
|
|
106
|
+
"type": "string",
|
|
107
|
+
"collection": false,
|
|
108
|
+
"value": null,
|
|
109
|
+
"values": null,
|
|
110
|
+
"required": false,
|
|
111
|
+
"regex": "[\\w]*"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"key": "includeInferred",
|
|
115
|
+
"label": "includeInferred",
|
|
116
|
+
"description": "Controls whether query inference is enabled or disabled by default for all queries and mutations.",
|
|
117
|
+
"type": "boolean",
|
|
118
|
+
"collection": false,
|
|
119
|
+
"value": true,
|
|
120
|
+
"values": null,
|
|
121
|
+
"required": false,
|
|
122
|
+
"regex": null
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"key": "expandOwlSameAs",
|
|
126
|
+
"label": "expandOwlSameAs",
|
|
127
|
+
"description": "Controls whether owl:sameAs expansion is enabled or disabled by default for all queries and mutations.",
|
|
128
|
+
"type": "boolean",
|
|
129
|
+
"collection": false,
|
|
130
|
+
"value": true,
|
|
131
|
+
"values": null,
|
|
132
|
+
"required": false,
|
|
133
|
+
"regex": null
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"key": "disabledChecks",
|
|
137
|
+
"label": "disabledChecks",
|
|
138
|
+
"description": "Specifies which checks could be disabled during the schema validation.",
|
|
139
|
+
"type": "string",
|
|
140
|
+
"collection": true,
|
|
141
|
+
"value": true,
|
|
142
|
+
"values": [
|
|
143
|
+
"regexInheritanceCheck",
|
|
144
|
+
"rangeCheck"
|
|
145
|
+
],
|
|
146
|
+
"required": false,
|
|
147
|
+
"regex": null
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"key": "defaultRole",
|
|
151
|
+
"label": "defaultRole",
|
|
152
|
+
"description": "The default RBAC role the user will receive if no roles are found in the security JWT token or none of the roles match any in the rbac section of the current SOML schema.",
|
|
153
|
+
"type": "string",
|
|
154
|
+
"collection": false,
|
|
155
|
+
"value": "defaultRole",
|
|
156
|
+
"values": null,
|
|
157
|
+
"required": false,
|
|
158
|
+
"regex": "[\\w]*"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"key": "defaultIntegrationRole",
|
|
162
|
+
"label": "defaultIntegrationRole",
|
|
163
|
+
"description": "The default RBAC role that will have read-only access to the data and could be used for system integrations.",
|
|
164
|
+
"type": "string",
|
|
165
|
+
"collection": false,
|
|
166
|
+
"value": "Federation_SystemRole",
|
|
167
|
+
"values": null,
|
|
168
|
+
"required": false,
|
|
169
|
+
"regex": "[\\w]*"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"key": "exposeSomlInGraphQL",
|
|
173
|
+
"label": "exposeSomlInGraphQL",
|
|
174
|
+
"description": "Controls whether GraphQL schema should include directives that expose the effective SOML configurations for each output type and property.",
|
|
175
|
+
"type": "boolean",
|
|
176
|
+
"collection": false,
|
|
177
|
+
"value": false,
|
|
178
|
+
"values": null,
|
|
179
|
+
"required": false,
|
|
180
|
+
"regex": null
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"key": "enableCollectionCount",
|
|
184
|
+
"label": "enableCollectionCount",
|
|
185
|
+
"description": "Controls whether the collections should have a companion property that provides counting of the collection properties.",
|
|
186
|
+
"type": "boolean",
|
|
187
|
+
"collection": false,
|
|
188
|
+
"value": false,
|
|
189
|
+
"values": null,
|
|
190
|
+
"required": false,
|
|
191
|
+
"regex": null
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"key": "enableTypeCount",
|
|
195
|
+
"label": "enableTypeCount",
|
|
196
|
+
"description": "Controls whether new counting queries should be generated for all queryable types.",
|
|
197
|
+
"type": "boolean",
|
|
198
|
+
"collection": false,
|
|
199
|
+
"value": false,
|
|
200
|
+
"values": null,
|
|
201
|
+
"required": false,
|
|
202
|
+
"regex": null
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"key": "compactErrorMessages",
|
|
206
|
+
"label": "compactErrorMessages",
|
|
207
|
+
"description": "Controls the default behavior of the GraphQL Responder how to process the errors that are returned to the client.",
|
|
208
|
+
"type": "boolean",
|
|
209
|
+
"collection": false,
|
|
210
|
+
"value": false,
|
|
211
|
+
"values": null,
|
|
212
|
+
"required": false,
|
|
213
|
+
"regex": null
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"key": "enableGraphQlExplain",
|
|
217
|
+
"label": "enableGraphQlExplain",
|
|
218
|
+
"description": "Controls whether SemanticObjects should provide the generated SPARQL query or its explain plan.",
|
|
219
|
+
"type": "boolean",
|
|
220
|
+
"collection": false,
|
|
221
|
+
"value": true,
|
|
222
|
+
"values": null,
|
|
223
|
+
"required": false,
|
|
224
|
+
"regex": null
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
}
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
"repository": "test",
|
|
3
3
|
"endpoints": [
|
|
4
4
|
{
|
|
5
|
-
"
|
|
6
|
-
"
|
|
5
|
+
"endpointId": "countries",
|
|
6
|
+
"endpointURI": "/rest/repositories/test/graphql/countries",
|
|
7
7
|
"active": true,
|
|
8
8
|
"default": false
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
|
-
"
|
|
12
|
-
"
|
|
11
|
+
"endpointId": "rickmorty",
|
|
12
|
+
"endpointURI": "/rest/repositories/test/graphql/rickmorty",
|
|
13
13
|
"active": true,
|
|
14
14
|
"default": false
|
|
15
15
|
}
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
"repository": "test",
|
|
3
3
|
"endpoints": [
|
|
4
4
|
{
|
|
5
|
-
"
|
|
6
|
-
"
|
|
5
|
+
"endpointId": "swapi",
|
|
6
|
+
"endpointURI": "/rest/repositories/swapi/graphql/swapi",
|
|
7
7
|
"active": true,
|
|
8
8
|
"default": false
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
|
-
"
|
|
12
|
-
"
|
|
11
|
+
"endpointId": "film-restricted",
|
|
12
|
+
"endpointURI": "/rest/repositories/swapi/graphql/film-restricted",
|
|
13
13
|
"active": true,
|
|
14
14
|
"default": true
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
|
-
"
|
|
18
|
-
"
|
|
17
|
+
"endpointId": "swapi-characters",
|
|
18
|
+
"endpointURI": "/rest/repositories/swapi/graphql/swapi-characters",
|
|
19
19
|
"active": false,
|
|
20
20
|
"default": false
|
|
21
21
|
}
|
|
@@ -12,10 +12,11 @@ describe('Graphql: create endpoint', () => {
|
|
|
12
12
|
cy.createRepository({id: repositoryId});
|
|
13
13
|
cy.presetRepository(repositoryId);
|
|
14
14
|
// TODO: remove stubs and enable next imports when REST API is ready
|
|
15
|
-
|
|
16
|
-
// cy.
|
|
17
|
-
|
|
18
|
-
GraphqlStubs.
|
|
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');
|
|
19
20
|
RepositoriesStubs.spyGetRepositories();
|
|
20
21
|
});
|
|
21
22
|
|
|
@@ -23,7 +24,7 @@ describe('Graphql: create endpoint', () => {
|
|
|
23
24
|
cy.deleteRepository(repositoryId);
|
|
24
25
|
});
|
|
25
26
|
|
|
26
|
-
it('should be able to start graphql endpoint creation wizard', () => {
|
|
27
|
+
it('should be able to start graphql endpoint creation wizard - no source data', () => {
|
|
27
28
|
// Given I have a repository with no active GraphQL endpoints
|
|
28
29
|
// When I visit the endpoint management view
|
|
29
30
|
GraphqlEndpointManagementSteps.visit();
|
|
@@ -38,12 +39,218 @@ describe('Graphql: create endpoint', () => {
|
|
|
38
39
|
CreateGraphqlEndpointSteps.getSourceRepositorySelector().should('be.visible');
|
|
39
40
|
// And the source repository should be preselected to the active repository
|
|
40
41
|
CreateGraphqlEndpointSteps.getSelectedSourceRepository().should('have.text', repositoryId);
|
|
42
|
+
|
|
41
43
|
// And the active step should be the first step
|
|
42
44
|
CreateGraphqlEndpointSteps.getActiveStep().should('contain', 'Select schema source');
|
|
43
45
|
CreateGraphqlEndpointSteps.getSelectSchemaSourceView().should('be.visible');
|
|
44
46
|
// And the schema source should be preselected to the first option
|
|
45
47
|
CreateGraphqlEndpointSteps.getSchemaSourceTypes().should('have.length', 2);
|
|
46
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 configure generation settings (the second step)', () => {
|
|
232
|
+
// Given I have a repository with graphql shapes in it
|
|
233
|
+
cy.importServerFile(repositoryId, 'ontology-and-shapes.ttl');
|
|
234
|
+
// And I started the endpoint creation wizard
|
|
235
|
+
GraphqlEndpointManagementSteps.visit();
|
|
236
|
+
cy.wait('@getRepositories');
|
|
237
|
+
GraphqlEndpointManagementSteps.createEndpoint();
|
|
238
|
+
CreateGraphqlEndpointSteps.getView().should('be.visible');
|
|
239
|
+
CreateGraphqlEndpointSteps.getSelectSchemaSourceView().should('be.visible');
|
|
240
|
+
CreateGraphqlEndpointSteps.getAvailableGraphqlShapes().should('have.length', 2);
|
|
241
|
+
// When I select a graphql schema shape
|
|
242
|
+
CreateGraphqlEndpointSteps.selectGraphqlShape(1);
|
|
243
|
+
// Then I should be able to proceed to the next step
|
|
244
|
+
CreateGraphqlEndpointSteps.next();
|
|
245
|
+
CreateGraphqlEndpointSteps.getGenerationSettingsForm().should('be.visible');
|
|
246
|
+
// And the next button should be enabled because all settings fields are available and valid initially
|
|
247
|
+
CreateGraphqlEndpointSteps.getNextStepButton().should('be.enabled');
|
|
248
|
+
// When I click next
|
|
249
|
+
CreateGraphqlEndpointSteps.next();
|
|
250
|
+
// Then I should be on the generate endpoint step
|
|
251
|
+
CreateGraphqlEndpointSteps.getActiveStep().should('contain', 'Create');
|
|
252
|
+
CreateGraphqlEndpointSteps.getGenerateEndpointView().should('be.visible');
|
|
253
|
+
|
|
47
254
|
});
|
|
48
255
|
|
|
49
256
|
it('should be able to cancel the endpoint creation wizard', () => {
|
|
@@ -75,4 +282,5 @@ describe('Graphql: create endpoint', () => {
|
|
|
75
282
|
ModalDialogSteps.getDialog().should('not.exist');
|
|
76
283
|
cy.url().should('include', '/graphql/endpoints');
|
|
77
284
|
});
|
|
285
|
+
|
|
78
286
|
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {GraphqlEndpointManagementSteps} from "../../steps/graphql/graphql-endpoint-management-steps";
|
|
2
|
+
import {ModalDialogSteps} from "../../steps/modal-dialog-steps";
|
|
3
|
+
import {ApplicationSteps} from "../../steps/application-steps";
|
|
4
|
+
|
|
5
|
+
describe('Graphql: delete endpoint', () => {
|
|
6
|
+
let repositoryId;
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
repositoryId = 'graphql-endpoint-management-' + Date.now();
|
|
10
|
+
cy.createRepository({id: repositoryId});
|
|
11
|
+
cy.presetRepository(repositoryId);
|
|
12
|
+
cy.importServerFile(repositoryId, 'swapi-dataset.ttl');
|
|
13
|
+
cy.uploadGraphqlSchema(repositoryId, 'graphql/soml/swapi-schema.yaml', 'swapi');
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
afterEach(() => {
|
|
17
|
+
cy.deleteRepository(repositoryId);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should be able to delete graphql endpoint', () => {
|
|
21
|
+
// Given I have a repository with active GraphQL endpoint
|
|
22
|
+
// And I have visited the endpoint management view
|
|
23
|
+
GraphqlEndpointManagementSteps.visit();
|
|
24
|
+
GraphqlEndpointManagementSteps.getView().should('be.visible');
|
|
25
|
+
GraphqlEndpointManagementSteps.getEndpointsInfo().should('have.length', 1);
|
|
26
|
+
// When I click on the delete endpoint button
|
|
27
|
+
GraphqlEndpointManagementSteps.deleteEndpoint(0);
|
|
28
|
+
// Then I should see the confirmation dialog
|
|
29
|
+
ModalDialogSteps.getDialog().should('be.visible');
|
|
30
|
+
// When I reject the confirmation dialog
|
|
31
|
+
ModalDialogSteps.cancel();
|
|
32
|
+
// Then Confirmation dialog should be closed
|
|
33
|
+
ModalDialogSteps.getDialog().should('not.exist');
|
|
34
|
+
// And the endpoint should not be deleted
|
|
35
|
+
GraphqlEndpointManagementSteps.getEndpointsInfo().should('have.length', 1);
|
|
36
|
+
|
|
37
|
+
// When I click on the delete endpoint button again and confirm the deletion
|
|
38
|
+
GraphqlEndpointManagementSteps.deleteEndpoint(0);
|
|
39
|
+
ModalDialogSteps.confirm();
|
|
40
|
+
// Then I should see a success toast
|
|
41
|
+
ApplicationSteps.getSuccessNotifications().should('be.visible');
|
|
42
|
+
// And the endpoint should be deleted and the no results row should be visible
|
|
43
|
+
GraphqlEndpointManagementSteps.getEndpointsInfo().should('have.length', 1);
|
|
44
|
+
GraphqlEndpointManagementSteps.getNoResultsRow().should('be.visible');
|
|
45
|
+
});
|
|
46
|
+
});
|