graphdb-workbench-tests 3.0.0-TR6 → 3.0.0-TR8
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/graphql/endpoints/graphql-endpoint-configuration-types.json +46 -0
- package/fixtures/graphql/endpoints/graphql-endpoint-configuration.json +227 -0
- package/fixtures/graphql/soml/swapi-schema-planets.yaml +51 -0
- package/fixtures/graphql/soml/swapi-schema-species.yaml +66 -0
- package/integration/graphql/create-graphql-endpoint.spec.js +32 -6
- package/integration/graphql/delete-graphql-endpoint.spec.js +46 -0
- package/integration/graphql/edit-graphql-enpoint.spec.js +137 -0
- package/integration/graphql/graphql-endpoint-filtering.spec.js +12 -15
- package/integration/graphql/graphql-endpoint-management-view.spec.js +106 -99
- package/integration/graphql/graphql-playground.spec.js +68 -48
- package/integration/setup/namespaces.spec.js +19 -0
- package/integration/sparql-editor/saved-query/readonly-query.spec.js +59 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/steps/graphql/create-graphql-endpoint-steps.js +12 -0
- package/steps/graphql/edit-graphql-endpoint-steps.js +90 -0
- package/steps/graphql/graphiql-editor-tools-steps.js +10 -0
- package/steps/graphql/graphiql-playground-steps.js +6 -0
- package/steps/graphql/graphql-endpoint-management-steps.js +30 -0
- package/steps/modal-dialog-steps.js +5 -1
- package/steps/setup/namespace-steps.js +17 -0
- package/steps/yasgui/saved-queries-dialog.js +19 -3
- package/stubs/graphql/graphql-stubs.js +22 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {GraphqlEndpointManagementSteps} from "../../steps/graphql/graphql-endpoint-management-steps";
|
|
2
|
-
import {GraphqlStubs} from "../../stubs/graphql/graphql-stubs";
|
|
3
2
|
|
|
4
3
|
describe('GraphQL endpoints filtering', () => {
|
|
5
4
|
let repositoryId;
|
|
@@ -8,11 +7,9 @@ describe('GraphQL endpoints filtering', () => {
|
|
|
8
7
|
repositoryId = 'graphql-endpoint-filtering-' + Date.now();
|
|
9
8
|
cy.createRepository({id: repositoryId});
|
|
10
9
|
cy.presetRepository(repositoryId);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
GraphqlStubs.stubGetEndpointsInfo(repositoryId);
|
|
15
|
-
GraphqlStubs.stubGetEndpoints(repositoryId, 'graphql-swapi-endpoints.json');
|
|
10
|
+
cy.uploadGraphqlSchema(repositoryId, 'graphql/soml/swapi-schema.yaml', 'swapi');
|
|
11
|
+
cy.uploadGraphqlSchema(repositoryId, 'graphql/soml/swapi-schema-planets.yaml', 'swapi-planets');
|
|
12
|
+
cy.uploadGraphqlSchema(repositoryId, 'graphql/soml/swapi-schema-species.yaml', 'swapi-species');
|
|
16
13
|
});
|
|
17
14
|
|
|
18
15
|
afterEach(() => {
|
|
@@ -26,19 +23,19 @@ describe('GraphQL endpoints filtering', () => {
|
|
|
26
23
|
// Then I should see all endpoints
|
|
27
24
|
GraphqlEndpointManagementSteps.getEndpointsInfo().should('have.length', 3);
|
|
28
25
|
// When I filter the endpoints by the term "film"
|
|
29
|
-
GraphqlEndpointManagementSteps.filterEndpoints('
|
|
26
|
+
GraphqlEndpointManagementSteps.filterEndpoints('planets');
|
|
30
27
|
// Then I should see only one endpoint
|
|
31
28
|
GraphqlEndpointManagementSteps.getEndpointsInfo().should('have.length', 1);
|
|
32
29
|
GraphqlEndpointManagementSteps.verifyEndpointInfo([
|
|
33
30
|
{
|
|
34
|
-
id: '
|
|
35
|
-
label: '
|
|
36
|
-
description: '
|
|
37
|
-
default:
|
|
31
|
+
id: 'swapi-planets',
|
|
32
|
+
label: 'Star Wars planets API',
|
|
33
|
+
description: '',
|
|
34
|
+
default: false,
|
|
38
35
|
active: true,
|
|
39
|
-
modified: '
|
|
40
|
-
types:
|
|
41
|
-
properties:
|
|
36
|
+
modified: new Date().toISOString().split('T')[0],
|
|
37
|
+
types: 1,
|
|
38
|
+
properties: 10
|
|
42
39
|
}
|
|
43
40
|
]);
|
|
44
41
|
// When I clear the filter
|
|
@@ -47,7 +44,7 @@ describe('GraphQL endpoints filtering', () => {
|
|
|
47
44
|
GraphqlEndpointManagementSteps.getEndpointsInfo().should('have.length', 3);
|
|
48
45
|
});
|
|
49
46
|
|
|
50
|
-
it('should render no results banner when all endpoints are filtered', () => {
|
|
47
|
+
it.only('should render no results banner when all endpoints are filtered', () => {
|
|
51
48
|
// Given I have a repository with active GraphQL endpoints
|
|
52
49
|
// When I visit the endpoint management view
|
|
53
50
|
GraphqlEndpointManagementSteps.visit();
|
|
@@ -10,37 +10,12 @@ describe('GraphQL endpoints management', () => {
|
|
|
10
10
|
repositoryId = 'graphql-endpoint-management-' + Date.now();
|
|
11
11
|
cy.createRepository({id: repositoryId});
|
|
12
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
13
|
});
|
|
19
14
|
|
|
20
15
|
afterEach(() => {
|
|
21
16
|
cy.deleteRepository(repositoryId);
|
|
22
17
|
});
|
|
23
18
|
|
|
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
19
|
it('should render no results banner when no endpoints are found for the current repository', () => {
|
|
45
20
|
// Given I have a repository with no active GraphQL endpoints
|
|
46
21
|
GraphqlStubs.stubGetEndpointsInfo(repositoryId, 'no-graphql-endpoints-info.json');
|
|
@@ -50,82 +25,114 @@ describe('GraphQL endpoints management', () => {
|
|
|
50
25
|
GraphqlEndpointManagementSteps.getNoEndpointsInRepositoryBanner().should('be.visible');
|
|
51
26
|
});
|
|
52
27
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
ApplicationSteps.getErrorNotifications().should('be.visible');
|
|
61
|
-
// Then I should see the no results banner
|
|
62
|
-
GraphqlEndpointManagementSteps.getNoEndpointsInRepositoryBanner().should('be.visible');
|
|
63
|
-
});
|
|
28
|
+
context('with endpoints', () => {
|
|
29
|
+
beforeEach(() => {
|
|
30
|
+
cy.importServerFile(repositoryId, 'swapi-dataset.ttl');
|
|
31
|
+
cy.uploadGraphqlSchema(repositoryId, 'graphql/soml/swapi-schema.yaml', 'swapi');
|
|
32
|
+
cy.uploadGraphqlSchema(repositoryId, 'graphql/soml/swapi-schema-planets.yaml', 'swapi-planets');
|
|
33
|
+
cy.uploadGraphqlSchema(repositoryId, 'graphql/soml/swapi-schema-species.yaml', 'swapi-species');
|
|
34
|
+
});
|
|
64
35
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
36
|
+
it('should render endpoint management view', () => {
|
|
37
|
+
// Given I have a repository with active GraphQL endpoints
|
|
38
|
+
// When I visit the endpoint management view
|
|
39
|
+
GraphqlEndpointManagementSteps.visit();
|
|
40
|
+
// Then I should see the endpoint management view
|
|
41
|
+
GraphqlEndpointManagementSteps.getView().should('be.visible');
|
|
42
|
+
// And I should see the page info tooltip
|
|
43
|
+
// TODO: not ready yet
|
|
44
|
+
// And I should see the documentation link
|
|
45
|
+
// TODO: not ready yet
|
|
46
|
+
// And I should see the endpoints filter field
|
|
47
|
+
GraphqlEndpointManagementSteps.getEndpointFilterField().should('be.visible');
|
|
48
|
+
// And I should see the create endpoint button
|
|
49
|
+
GraphqlEndpointManagementSteps.getCreateEndpointButton().should('be.visible');
|
|
50
|
+
// And I should see the import endpoint schema definition button
|
|
51
|
+
GraphqlEndpointManagementSteps.getImportEndpointSchemaDefinitionButton().should('be.visible');
|
|
52
|
+
// And I should see the endpoint list
|
|
53
|
+
GraphqlEndpointManagementSteps.getEndpointTable().should('be.visible');
|
|
80
54
|
});
|
|
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
55
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
56
|
+
it('should render no results banner when endpoints are not loaded due to some error', () => {
|
|
57
|
+
// Given I have a repository with active GraphQL endpoints
|
|
58
|
+
// And the endpoints info cannot be loaded due to some error
|
|
59
|
+
GraphqlStubs.stubGetEndpointsInfoError(repositoryId);
|
|
60
|
+
// When I visit the endpoint management view
|
|
61
|
+
GraphqlEndpointManagementSteps.visit();
|
|
62
|
+
// Then I should see a toast with the error message
|
|
63
|
+
ApplicationSteps.getErrorNotifications().should('be.visible');
|
|
64
|
+
// Then I should see the no results banner
|
|
65
|
+
GraphqlEndpointManagementSteps.getNoEndpointsInRepositoryBanner().should('be.visible');
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it('should render endpoints info', () => {
|
|
69
|
+
// Given I have a repository with active GraphQL endpoints
|
|
70
|
+
// When I visit the endpoint management view
|
|
71
|
+
GraphqlEndpointManagementSteps.visit();
|
|
72
|
+
// Then I should see the endpoints info
|
|
73
|
+
GraphqlEndpointManagementSteps.getEndpointTable().within(() => {
|
|
74
|
+
cy.get('thead th').should('have.length', 9);
|
|
75
|
+
cy.get('thead th').eq(1).should('contain', 'Id');
|
|
76
|
+
cy.get('thead th').eq(2).should('contain', 'Label');
|
|
77
|
+
cy.get('thead th').eq(3).should('contain', 'Default');
|
|
78
|
+
cy.get('thead th').eq(4).should('contain', 'Active');
|
|
79
|
+
cy.get('thead th').eq(5).should('contain', 'Modified');
|
|
80
|
+
cy.get('thead th').eq(6).should('contain', 'Types');
|
|
81
|
+
cy.get('thead th').eq(7).should('contain', 'Properties');
|
|
82
|
+
cy.get('thead th').eq(8).should('contain', 'Actions');
|
|
83
|
+
});
|
|
84
|
+
GraphqlEndpointManagementSteps.getEndpointsInfo().should('have.length', 3);
|
|
85
|
+
GraphqlEndpointManagementSteps.verifyEndpointInfo([
|
|
86
|
+
{
|
|
87
|
+
id: 'swapi',
|
|
88
|
+
label: 'Ontotext Star Wars Ontology',
|
|
89
|
+
description: '',
|
|
90
|
+
default: true,
|
|
91
|
+
active: true,
|
|
92
|
+
modified: new Date().toISOString().split('T')[0],
|
|
93
|
+
types: 56,
|
|
94
|
+
properties: 68
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
id: 'swapi-planets',
|
|
98
|
+
label: 'Star Wars planets API',
|
|
99
|
+
description: '',
|
|
100
|
+
default: false,
|
|
101
|
+
active: true,
|
|
102
|
+
modified: new Date().toISOString().split('T')[0],
|
|
103
|
+
types: 1,
|
|
104
|
+
properties: 10
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
id: 'swapi-species',
|
|
108
|
+
label: 'Star Wars species API',
|
|
109
|
+
description: '',
|
|
110
|
+
default: false,
|
|
111
|
+
active: true,
|
|
112
|
+
modified: new Date().toISOString().split('T')[0],
|
|
113
|
+
types: 2,
|
|
114
|
+
properties: 17
|
|
115
|
+
}
|
|
116
|
+
]);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it('should be able to explore graphql endpoints which are active', () => {
|
|
120
|
+
// Given I have a repository with active GraphQL endpoints
|
|
121
|
+
// When I visit the endpoint management view
|
|
122
|
+
GraphqlEndpointManagementSteps.visit();
|
|
123
|
+
// Then I expect that inactive endpoints should not be clickable
|
|
124
|
+
GraphqlEndpointManagementSteps.getEndpointLink(0).should('have.prop', 'tagName', 'A');
|
|
125
|
+
GraphqlEndpointManagementSteps.getEndpointLink(1).should('have.prop', 'tagName', 'A');
|
|
126
|
+
// This is supposed to test for a inactive endpoint, due to some error during generation for example,
|
|
127
|
+
// but we can't simulate it by uploading SOML schemas. We test this in other tests.
|
|
128
|
+
// GraphqlEndpointManagementSteps.getEndpointLink(2).should('have.prop', 'tagName', 'SPAN');
|
|
129
|
+
GraphqlEndpointManagementSteps.getEndpointLink(2).should('have.prop', 'tagName', 'A');
|
|
130
|
+
// And I click on some endpoint
|
|
131
|
+
GraphqlEndpointManagementSteps.exploreEndpoint(1);
|
|
132
|
+
// Then I should be redirected to the GraphQL playground view
|
|
133
|
+
cy.url().should('include', '/graphql/playground');
|
|
134
|
+
// And the selected endpoint should be the one I clicked
|
|
135
|
+
GraphqlPlaygroundSteps.getSelectedEndpoint().should('contain', 'swapi-planets');
|
|
136
|
+
});
|
|
130
137
|
});
|
|
131
138
|
});
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import {GraphqlPlaygroundSteps} from "../../steps/graphql/graphql-playground-steps";
|
|
2
|
-
import {
|
|
2
|
+
import {GraphiqlPlaygroundSteps} from "../../steps/graphql/graphiql-playground-steps";
|
|
3
|
+
import {GraphiQLEditorToolsSteps} from "../../steps/graphql/graphiql-editor-tools-steps";
|
|
4
|
+
import {LanguageSelectorSteps} from "../../steps/language-selector-steps";
|
|
3
5
|
|
|
4
6
|
describe('GraphQL Playground', () => {
|
|
5
7
|
let repositoryId;
|
|
@@ -22,53 +24,71 @@ describe('GraphQL Playground', () => {
|
|
|
22
24
|
GraphqlPlaygroundSteps.getNoSchemasAlert().should('be.visible');
|
|
23
25
|
});
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
GraphqlStubs.stubGetEndpoints(repositoryId);
|
|
27
|
-
GraphqlStubs.stubCountriesSchema();
|
|
28
|
-
// Given I have opened the workbench
|
|
29
|
-
// When I visit the GraphQL Playground page
|
|
30
|
-
GraphqlPlaygroundSteps.visit();
|
|
31
|
-
// Then I should see the graphql endpoints select menu
|
|
32
|
-
GraphqlPlaygroundSteps.getEndpointsSelectMenu().should('be.visible');
|
|
33
|
-
// And the endpoints menu should contain 2 options
|
|
34
|
-
GraphqlPlaygroundSteps.getEndpointsSelectMenuOptions().should('have.length', 2);
|
|
35
|
-
// Then I should see the GraphQL Playground component
|
|
36
|
-
GraphqlPlaygroundSteps.getPlayground().should('exist').and('be.visible');
|
|
37
|
-
});
|
|
27
|
+
context('with schemas', () => {
|
|
38
28
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
29
|
+
beforeEach(() => {
|
|
30
|
+
cy.importServerFile(repositoryId, 'swapi-dataset.ttl');
|
|
31
|
+
cy.uploadGraphqlSchema(repositoryId, 'graphql/soml/swapi-schema.yaml', 'swapi');
|
|
32
|
+
cy.uploadGraphqlSchema(repositoryId, 'graphql/soml/swapi-schema-planets.yaml', 'swapi-planets');
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('should load GraphQL Playground', () => {
|
|
36
|
+
// Given I have opened the workbench
|
|
37
|
+
// When I visit the GraphQL Playground page
|
|
38
|
+
GraphqlPlaygroundSteps.visit();
|
|
39
|
+
// Then I should see the graphql endpoints select menu
|
|
40
|
+
GraphqlPlaygroundSteps.getEndpointsSelectMenu().should('be.visible');
|
|
41
|
+
// And the endpoints menu should contain 2 options
|
|
42
|
+
GraphqlPlaygroundSteps.getEndpointsSelectMenuOptions().should('have.length', 2);
|
|
43
|
+
// Then I should see the GraphQL Playground component
|
|
44
|
+
GraphqlPlaygroundSteps.getPlayground().should('exist').and('be.visible');
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('should be able to change the endpoint', () => {
|
|
48
|
+
// When I visit the GraphQL Playground page
|
|
49
|
+
GraphqlPlaygroundSteps.visit();
|
|
50
|
+
GraphqlPlaygroundSteps.getPlayground().should('exist').and('be.visible');
|
|
51
|
+
// Then I should see the countries endpoint selected
|
|
52
|
+
GraphqlPlaygroundSteps.getSelectedEndpoint().should('have.text', 'swapi');
|
|
53
|
+
// And I can execute a query on the countries endpoint
|
|
54
|
+
GraphqlPlaygroundSteps.setInEditor(`
|
|
55
|
+
query StarshipById {
|
|
56
|
+
starship(ID: "https://swapi.co/resource/starship/9") {
|
|
57
|
+
name
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
`);
|
|
61
|
+
// And I execute the query
|
|
62
|
+
GraphqlPlaygroundSteps.executeQuery();
|
|
63
|
+
// Then I get expected result
|
|
64
|
+
GraphqlPlaygroundSteps.getResponse().should('contain', '"name": "Death Star"');
|
|
65
|
+
// When I change the endpoint to countries
|
|
66
|
+
// GraphqlStubs.stubStubRickAndMortySchema();
|
|
67
|
+
GraphqlPlaygroundSteps.selectEndpoint('swapi-planets');
|
|
68
|
+
GraphqlPlaygroundSteps.setInEditor(`
|
|
69
|
+
query PlanetById {
|
|
70
|
+
planet(ID: "https://swapi.co/resource/planet/1") {
|
|
71
|
+
name
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
`);
|
|
75
|
+
// And I execute the query
|
|
76
|
+
GraphqlPlaygroundSteps.executeQuery();
|
|
77
|
+
// Then I get expected result from the new endpoint
|
|
78
|
+
GraphqlPlaygroundSteps.getResponse().should('contain', '"name": "Tatooine"');
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it('should be able to translate the labels', () => {
|
|
82
|
+
// Given: I have opened the workbench on the GraphQL Playground page.
|
|
83
|
+
GraphqlPlaygroundSteps.visit();
|
|
84
|
+
GraphiqlPlaygroundSteps.getPlayground().should('be.visible');
|
|
85
|
+
// the GraphQL is translated on english
|
|
86
|
+
GraphiQLEditorToolsSteps.getGraphiQLEditorTabButton(1).contains('Headers');
|
|
87
|
+
|
|
88
|
+
// When: I change the language.
|
|
89
|
+
LanguageSelectorSteps.changeLanguage('fr');
|
|
90
|
+
// Then: I expect to see GraphQL playground translated.
|
|
91
|
+
GraphiQLEditorToolsSteps.getGraphiQLEditorTabButton(1).contains('En-têtes');
|
|
92
|
+
});
|
|
73
93
|
});
|
|
74
94
|
});
|
|
@@ -277,4 +277,23 @@ describe('Namespaces', () => {
|
|
|
277
277
|
NamespaceSteps.getNamespacesTable().should('not.be.visible');
|
|
278
278
|
NamespaceSteps.getNoNamespacesAlert().should('be.visible');
|
|
279
279
|
});
|
|
280
|
+
|
|
281
|
+
it('Should got to the second page when click on second page button', () => {
|
|
282
|
+
// Given: I visited the namespaces view, and there is more than one page.
|
|
283
|
+
NamespaceSteps.getNamespacesPageElements()
|
|
284
|
+
// First page + three-page buttons + Last page.
|
|
285
|
+
.should('have.length', 5);
|
|
286
|
+
// The table with namespaces should contain the "geoext" namespace because it is among the first 10 namespaces (the paginator is set to 10 namespaces per page).
|
|
287
|
+
NamespaceSteps.getNamespace('geoext').should('be.visible');
|
|
288
|
+
// The namespace with the prefix "omgeo" should not exist because it is the fourteenth namespace and is only visible on the second page.
|
|
289
|
+
NamespaceSteps.verifyNamespaceNotExist('omgeo');
|
|
290
|
+
|
|
291
|
+
// When I go to the second page.
|
|
292
|
+
NamespaceSteps.getNamespacePageElement(2).click()
|
|
293
|
+
|
|
294
|
+
// Then I expect the "geoext" namespace to no longer be visible, as it is part of the first 10 namespaces.
|
|
295
|
+
NamespaceSteps.verifyNamespaceNotExist('geoext');
|
|
296
|
+
// The namespace with the prefix "omgeo" should now be visible because it appears on the second page.
|
|
297
|
+
NamespaceSteps.getNamespace('omgeo').should('be.visible');
|
|
298
|
+
});
|
|
280
299
|
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {SparqlEditorSteps} from "../../../steps/sparql-editor-steps";
|
|
2
|
+
import {YasguiSteps} from "../../../steps/yasgui/yasgui-steps";
|
|
3
|
+
import {QueryStubs} from "../../../stubs/yasgui/query-stubs";
|
|
4
|
+
import {UserAndAccessSteps} from "../../../steps/setup/user-and-access-steps";
|
|
5
|
+
import {SavedQuery} from "../../../steps/yasgui/saved-query";
|
|
6
|
+
import {SavedQueriesDialog} from "../../../steps/yasgui/saved-queries-dialog";
|
|
7
|
+
|
|
8
|
+
const USER_NAME = 'saved_query_user';
|
|
9
|
+
const USER_ADMINISTRATOR = 'admin';
|
|
10
|
+
const PASSWORD = 'root';
|
|
11
|
+
|
|
12
|
+
describe('Readonly saved query', () => {
|
|
13
|
+
|
|
14
|
+
let repositoryId;
|
|
15
|
+
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
repositoryId = 'sparql-editor-' + Date.now();
|
|
18
|
+
QueryStubs.stubQueryCountResponse();
|
|
19
|
+
cy.createRepository({id: repositoryId});
|
|
20
|
+
cy.presetRepository(repositoryId);
|
|
21
|
+
QueryStubs.stubDefaultQueryResponse(repositoryId);
|
|
22
|
+
cy.createUser({username: USER_NAME, password: PASSWORD});
|
|
23
|
+
UserAndAccessSteps.visit();
|
|
24
|
+
UserAndAccessSteps.toggleSecurity();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
afterEach(() => {
|
|
28
|
+
UserAndAccessSteps.logout();
|
|
29
|
+
cy.deleteRepository(repositoryId);
|
|
30
|
+
UserAndAccessSteps.visit();
|
|
31
|
+
UserAndAccessSteps.loginWithUser(USER_ADMINISTRATOR, PASSWORD);
|
|
32
|
+
UserAndAccessSteps.toggleSecurity();
|
|
33
|
+
cy.deleteUser(USER_NAME);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('Should not allow modifying a saved query if it is readonly', () => {
|
|
37
|
+
// Given: There is a public saved query created by a user.
|
|
38
|
+
UserAndAccessSteps.loginWithUser(USER_NAME, PASSWORD);
|
|
39
|
+
SparqlEditorSteps.visitSparqlEditorPage();
|
|
40
|
+
YasguiSteps.getYasgui().should('be.visible');
|
|
41
|
+
const savedQueryName = SavedQuery.generateQueryName();
|
|
42
|
+
SavedQuery.create(savedQueryName);
|
|
43
|
+
UserAndAccessSteps.logout();
|
|
44
|
+
|
|
45
|
+
// When: I log in with another user
|
|
46
|
+
UserAndAccessSteps.loginWithUser(USER_ADMINISTRATOR, PASSWORD);
|
|
47
|
+
// and open the popup with the saved query.
|
|
48
|
+
SparqlEditorSteps.visitSparqlEditorPage();
|
|
49
|
+
YasguiSteps.showSavedQueries();
|
|
50
|
+
|
|
51
|
+
// Then: I expect:
|
|
52
|
+
// 1. The delete button should not be visible because a saved query can only be deleted by the user who created it.
|
|
53
|
+
SavedQueriesDialog.getDeleteQueryButtonByName(savedQueryName).should('not.exist');
|
|
54
|
+
// 2. The edit button should not be visible because a saved query can only be edited by the user who created it.
|
|
55
|
+
SavedQueriesDialog.getEditQueryButtonByName(savedQueryName).should('not.exist');
|
|
56
|
+
// 3. The share button should be visible because a public saved query should be visible to all users.
|
|
57
|
+
SavedQueriesDialog.getShareQueryButtonByName(savedQueryName).should('exist');
|
|
58
|
+
});
|
|
59
|
+
});
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphdb-workbench-tests",
|
|
3
|
-
"version": "3.0.0-
|
|
3
|
+
"version": "3.0.0-TR8",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "graphdb-workbench-tests",
|
|
9
|
-
"version": "3.0.0-
|
|
9
|
+
"version": "3.0.0-TR8",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"cypress": "^13.3.1",
|
package/package.json
CHANGED
|
@@ -223,6 +223,18 @@ export class CreateGraphqlEndpointSteps {
|
|
|
223
223
|
return this.getView().find('.endpoint-configuration-view');
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
+
static getGenerationSettingsForm() {
|
|
227
|
+
return this.getConfigureEndpointView().find('.generation-settings-form');
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// ===================================
|
|
231
|
+
// Generate endpoint view
|
|
232
|
+
// ===================================
|
|
233
|
+
|
|
234
|
+
static getGenerateEndpointView() {
|
|
235
|
+
return this.getView().find('.generate-endpoint-view');
|
|
236
|
+
}
|
|
237
|
+
|
|
226
238
|
// ===================================
|
|
227
239
|
// Wizard actions
|
|
228
240
|
// ===================================
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import {ModalDialogSteps} from "../modal-dialog-steps";
|
|
2
|
+
|
|
3
|
+
export class EditGraphqlEndpointSteps extends ModalDialogSteps {
|
|
4
|
+
static getModalTitle() {
|
|
5
|
+
return this.getDialog().find('.modal-title');
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
static getDynamicForm() {
|
|
9
|
+
return this.getDialog().find('dynamic-form');
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
static getFormFields() {
|
|
13
|
+
return this.getDynamicForm().find('.form-field');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
static getInputField(index) {
|
|
17
|
+
return this.getFormFields().find('.input-field input').eq(index);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static getBooleanField(index) {
|
|
21
|
+
return this.getFormFields().find('.boolean-field input').eq(index);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
static getSelectField(index) {
|
|
25
|
+
return this.getFormFields().find('.select-field select').eq(index);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
static getMultiSelectField(index) {
|
|
29
|
+
return this.getFormFields().find('.multiselect-field multiselect-dropdown').eq(index);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
static toggleMultiSelectOption(index, optionLabel) {
|
|
33
|
+
this.getMultiSelectField(index)
|
|
34
|
+
.within(() => {
|
|
35
|
+
cy.get('button.dropdown-toggle').click();
|
|
36
|
+
cy.get('ul.dropdown-menu li')
|
|
37
|
+
.contains(optionLabel)
|
|
38
|
+
.click();
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static verifyMultiSelectOptionSelected(index, optionLabel) {
|
|
43
|
+
this.getModalTitle().click();
|
|
44
|
+
this.getMultiSelectField(index)
|
|
45
|
+
.within(() => {
|
|
46
|
+
cy.get('button.dropdown-toggle')
|
|
47
|
+
.should('contain.text', optionLabel);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
static getJsonField(index) {
|
|
52
|
+
return this.getFormFields().find('.json-field textarea').eq(index);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
static clearJsonField(index) {
|
|
56
|
+
return this.getJsonField(index).clear();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
static setJsonField(index, value) {
|
|
60
|
+
return this.clearJsonField(index).type(value, {parseSpecialCharSequences:false});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
static fillInputField(index, value) {
|
|
64
|
+
return this.getInputField(index).clear().type(value);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
static checkBooleanField(index) {
|
|
68
|
+
return this.getBooleanField(index).check();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
static uncheckBooleanField(index) {
|
|
72
|
+
return this.getBooleanField(index).uncheck();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
static toggleBooleanField(index) {
|
|
76
|
+
return this.getBooleanField(index).click();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
static selectOption(index, option) {
|
|
80
|
+
this.getSelectField(index).select(option);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
static getLoader() {
|
|
84
|
+
return this.getDialog().find('.graphql-endpoint-configuration-loader')
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
static getSavingLoader() {
|
|
88
|
+
return this.getDialog().find('.saving-endpoint-settings')
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export class GraphiQLEditorToolsSteps {
|
|
2
|
+
|
|
3
|
+
static getGraphiQLEditorTools() {
|
|
4
|
+
return cy.get(".graphiql-editor-tools");
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
static getGraphiQLEditorTabButton(index) {
|
|
8
|
+
return GraphiQLEditorToolsSteps.getGraphiQLEditorTools().find('button').eq(index);
|
|
9
|
+
}
|
|
10
|
+
}
|