graphdb-workbench-tests 3.4.0-migrated-guide-services → 3.5.0-reactodia-poc

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 (42) hide show
  1. package/e2e-legacy/cluster/cluster-states.spec.js +3 -3
  2. package/e2e-legacy/explore/visual-graph/node-info-panel.spec.js +58 -0
  3. package/e2e-legacy/explore/visual-graph/visual-graph-links-limit.spec.js +167 -0
  4. package/e2e-legacy/explore/visual-graph/visual.graph.spec.js +55 -78
  5. package/e2e-legacy/graphql/graphql-in-remote-location.spec.js +49 -0
  6. package/e2e-legacy/guides/table-graph-explore/table-graph-explore-guide.spec.js +2 -1
  7. package/e2e-legacy/guides/ttyg/configure-agent/configure-agent-guide.spec.js +34 -26
  8. package/e2e-legacy/guides/visual-graph/visual-graph-guide.spec.js +42 -58
  9. package/e2e-legacy/home/create-repository.spec.js +6 -0
  10. package/e2e-legacy/repository/attach-remote-location.spec.js +47 -12
  11. package/e2e-legacy/repository/url-with-repository-id-parameter.spec.js +1 -1
  12. package/e2e-legacy/resource/resource.spec.js +33 -13
  13. package/e2e-legacy/setup/aclmanagement/acl-management-with-selected repository.spec.js +44 -0
  14. package/e2e-legacy/sparql-editor/actions/execute-query.spec.js +2 -0
  15. package/e2e-legacy/sparql-editor/actions/expand-results-over-sameas.spec.js +8 -8
  16. package/e2e-legacy/sparql-editor/actions/include-inferred-statements.spec.js +4 -4
  17. package/e2e-legacy/sparql-editor/actions/inferred-sameas.spec.js +3 -3
  18. package/e2e-legacy/sparql-editor/yasr/toolbar/visual-graph-button.spec.js +90 -36
  19. package/e2e-legacy/sparql-editor/yasr/yasr.spec.js +80 -0
  20. package/fixtures/graph/graph-configurations.json +59 -0
  21. package/fixtures/guides/ttyg/configure-agent/configure-ttyg-agent-guide.json +6 -1
  22. package/npm-shrinkwrap.json +32 -33
  23. package/package.json +1 -1
  24. package/steps/graphql/create-graphql-endpoint-steps.js +8 -0
  25. package/steps/graphql/graphql-endpoint-management-steps.js +8 -0
  26. package/steps/graphql/graphql-playground-steps.js +8 -0
  27. package/steps/guides/movies-guide-steps.js +2 -1
  28. package/steps/home-steps.js +4 -7
  29. package/steps/repositories/attach-repository-steps.js +16 -0
  30. package/steps/repository-steps.js +24 -0
  31. package/steps/resource/resource-steps.js +0 -8
  32. package/steps/setup/acl-management-steps.js +12 -0
  33. package/steps/sparql-editor-steps.js +18 -4
  34. package/steps/ttyg/ttyg-agent-settings-modal.steps.js +1 -1
  35. package/steps/visual-graph-split-button-steps.js +45 -0
  36. package/steps/visual-graph-steps.js +12 -0
  37. package/steps/yasgui/yasr-steps.js +30 -6
  38. package/stubs/cluster/remote-location-stubs.js +4 -0
  39. package/stubs/graph-config-stubs.js +17 -0
  40. package/support/commands.js +1 -0
  41. package/support/repository-commands.js +22 -3
  42. package/support/url-commands.js +13 -0
@@ -7,10 +7,12 @@ import {YasqeSteps} from "../../steps/yasgui/yasqe-steps";
7
7
  import {YasrSteps} from "../../steps/yasgui/yasr-steps";
8
8
  import {YasguiSteps} from "../../steps/yasgui/yasgui-steps";
9
9
  import {JsonLdModalSteps} from "../../steps/json-ld-modal-steps";
10
+ import {GraphConfigStubs} from '../../stubs/graph-config-stubs.js';
11
+ import {VisualGraphSplitButtonSteps} from '../../steps/visual-graph-split-button-steps.js';
10
12
 
11
13
  const FILE_TO_IMPORT = 'resource-test-data.ttl';
12
- const SUBJECT_RESOURCE = 'http:%2F%2Fexample.com%2Fontology%23CustomerLoyalty';
13
- const SUBJECT_RESOURCE_SHORT_URI = 'http://example.com/ontology#CustomerLoyalty';
14
+ const SUBJECT_RESOURCE_ENCODED = 'http:%2F%2Fexample.com%2Fontology%23CustomerLoyalty';
15
+ const SUBJECT_RESOURCE = 'http://example.com/ontology#CustomerLoyalty';
14
16
  const PREDICATE_SOURCE = 'http:%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23subClassOf';
15
17
  const CONTEXT_EXPLICIT = 'http://www.ontotext.com/explicit';
16
18
  const OBJECT_RESOURCE = 'http:%2F%2Fexample.com%2Fontology%23Metric';
@@ -33,13 +35,13 @@ describe('Resource view', () => {
33
35
 
34
36
  it('should open resource view with active role tab depend on url role parameter', () => {
35
37
  ResourceSteps.getAllRoles().forEach((role) => {
36
- ResourceSteps.visit(`uri=${SUBJECT_RESOURCE}&role=${role}`);
38
+ ResourceSteps.visit(`uri=${SUBJECT_RESOURCE_ENCODED}&role=${role}`);
37
39
  ResourceSteps.verifyActiveRoleTab(role);
38
40
  });
39
41
  });
40
42
 
41
43
  it('should open subject tab if role parameter is miss', () => {
42
- ResourceSteps.visit(`uri=${SUBJECT_RESOURCE}&role=subject`);
44
+ ResourceSteps.visit(`uri=${SUBJECT_RESOURCE_ENCODED}&role=subject`);
43
45
  ResourceSteps.verifyActiveRoleTab('subject');
44
46
  });
45
47
 
@@ -62,17 +64,35 @@ describe('Resource view', () => {
62
64
  YasrSteps.getResults().should('have.length', 5);
63
65
  });
64
66
 
65
- it('should navigate to visual graph view', () => {
67
+ it('should open graphs-visualizations view when click on main button', () => {
66
68
  // When I am on resource view and page loaded a resource.
67
- ResourceSteps.visit(`uri=${SUBJECT_RESOURCE}&role=subject`);
69
+ ResourceSteps.visit(`uri=${SUBJECT_RESOURCE_ENCODED}&role=subject`);
68
70
 
69
71
  // When I click on "Visual graph" button.
70
- ResourceSteps.clickOnVisualGraphButton();
72
+ VisualGraphSplitButtonSteps.clickOnVisualizeMainButton();
71
73
 
72
74
  // Then I expect to be redirected to explore graph view.
73
75
  VisualGraphSteps.verifyUrl();
74
76
  });
75
77
 
78
+ it('should open graphs-visualizations view when select a graph configuration', () => {
79
+ // When I am on resource view and page loaded a resource.
80
+ ResourceSteps.visit(`uri=${SUBJECT_RESOURCE_ENCODED}&role=subject`);
81
+ GraphConfigStubs.stubGetGraphConfigs();
82
+
83
+ // WHEN: I open the dropdown.
84
+ VisualGraphSplitButtonSteps.toggleGraphConfigDropdown();
85
+ // THEN: I expect to see all graph configurations.
86
+ VisualGraphSplitButtonSteps.getGraphConfigs().should('have.length', 3);
87
+
88
+ // WHEN: I select a graph configuration
89
+ VisualGraphSplitButtonSteps.selectGraphConfig();
90
+ // THEN: I expect to be navigated to graphs-visualizations view.
91
+ cy.url().should('include', 'graphs-visualizations');
92
+ cy.getQueryParam('uri').should('include', SUBJECT_RESOURCE);
93
+ cy.getQueryParam('config').should('eq', 'de99fd5de7f94ef98f1875dff55fc1c9');
94
+ });
95
+
76
96
  it('should displays results depends on explicit/implicit dropdown', () => {
77
97
  // When I am on resource view and page loaded a resource that has triplets in explicit and implicit context,
78
98
  ResourceSteps.visit(`uri=${IMPLICIT_EXPLICIT_RESOURCE}&role=all`);
@@ -175,11 +195,11 @@ describe('Resource view', () => {
175
195
  it('should list the triples of a resource used as subject', () => {
176
196
  // When I am on resource view,
177
197
  // and page loaded a resource that is used as subject,
178
- ResourceSteps.visit(`uri=${SUBJECT_RESOURCE}&role=subject`);
198
+ ResourceSteps.visit(`uri=${SUBJECT_RESOURCE_ENCODED}&role=subject`);
179
199
 
180
200
  // Then I expect to see only one result because the resource has only one triplet as subject.
181
201
  YasrSteps.getResults().should('have.length', 1);
182
- YasrSteps.getResultLink(0, 1).should('contain', SUBJECT_RESOURCE_SHORT_URI);
202
+ YasrSteps.getResultLink(0, 1).should('contain', SUBJECT_RESOURCE);
183
203
  YasrSteps.getResultLink(0, 2).should('contain', 'rdfs:subClassOf');
184
204
  YasrSteps.getResultLink(0, 3).should('contain', 'http://example.com/ontology#Metric');
185
205
  YasrSteps.getResultLink(0, 4).should('contain', CONTEXT_EXPLICIT);
@@ -196,7 +216,7 @@ describe('Resource view', () => {
196
216
  YasrSteps.getResults().should('have.length', 1);
197
217
  YasrSteps.getResultLink(0, 1).should('contain', 'http://example.com/resource/person/W6J1827/customerLoyalty');
198
218
  YasrSteps.getResultLink(0, 2).should('contain', 'rdf:type');
199
- YasrSteps.getResultLink(0, 3).should('contain', SUBJECT_RESOURCE_SHORT_URI);
219
+ YasrSteps.getResultLink(0, 3).should('contain', SUBJECT_RESOURCE);
200
220
  YasrSteps.getResultLink(0, 4).should('contain', CONTEXT_EXPLICIT);
201
221
 
202
222
  // When I click on "context" tab.
@@ -211,14 +231,14 @@ describe('Resource view', () => {
211
231
  // Then I expect to see all triples of subject without mater of its role.
212
232
  YasrSteps.getResults().should('have.length', 2);
213
233
 
214
- YasrSteps.getResultLink(0, 1).should('contain', SUBJECT_RESOURCE_SHORT_URI);
234
+ YasrSteps.getResultLink(0, 1).should('contain', SUBJECT_RESOURCE);
215
235
  YasrSteps.getResultLink(0, 2).should('contain', 'rdfs:subClassOf');
216
236
  YasrSteps.getResultLink(0, 3).should('contain', 'http://example.com/ontology#Metric');
217
237
  YasrSteps.getResultLink(0, 4).should('contain', CONTEXT_EXPLICIT);
218
238
 
219
239
  YasrSteps.getResultLink(1, 1).should('contain', 'http://example.com/resource/person/W6J1827/customerLoyalty');
220
240
  YasrSteps.getResultLink(1, 2).should('contain', 'rdf:type');
221
- YasrSteps.getResultLink(1, 3).should('contain', SUBJECT_RESOURCE_SHORT_URI);
241
+ YasrSteps.getResultLink(1, 3).should('contain', SUBJECT_RESOURCE);
222
242
  YasrSteps.getResultLink(1, 4).should('contain', CONTEXT_EXPLICIT);
223
243
  });
224
244
 
@@ -364,7 +384,7 @@ describe('Resource view', () => {
364
384
  context('Download as', () => {
365
385
  it('should download as JSON-LD and then restore defaults', () => {
366
386
  // Given I am in the Resource view
367
- ResourceSteps.visit(`uri=${SUBJECT_RESOURCE}&role=subject`);
387
+ ResourceSteps.visit(`uri=${SUBJECT_RESOURCE_ENCODED}&role=subject`);
368
388
  cy.window().then((win) => {
369
389
  expect(win.jsonld).to.exist;
370
390
  cy.stub(win.jsonld, 'compact').resolves({
@@ -1,6 +1,8 @@
1
1
  import HomeSteps from "../../../steps/home-steps";
2
2
  import {MainMenuSteps} from "../../../steps/main-menu-steps";
3
3
  import {AclManagementSteps} from "../../../steps/setup/acl-management-steps";
4
+ import {RepositorySteps} from '../../../steps/repository-steps.js';
5
+ import {RepositorySelectorSteps} from '../../../steps/repository-selector-steps.js';
4
6
 
5
7
  function verifyStateWithSelectedRepository() {
6
8
  AclManagementSteps.getPageHeading().should('be.visible');
@@ -12,15 +14,18 @@ function verifyStateWithSelectedRepository() {
12
14
 
13
15
  describe('ACL Management initial state with repositories', () => {
14
16
  let repositoryId;
17
+ let fedexRepositoryId;
15
18
 
16
19
  beforeEach(() => {
17
20
  repositoryId = 'acl-management-' + Date.now();
21
+ fedexRepositoryId = 'fedex-repo-' + Date.now();
18
22
  cy.createRepository({id: repositoryId});
19
23
  cy.presetRepository(repositoryId);
20
24
  });
21
25
 
22
26
  afterEach(() => {
23
27
  cy.deleteRepository(repositoryId);
28
+ cy.deleteRepository(fedexRepositoryId);
24
29
  });
25
30
 
26
31
  it('Should display the correct initial state when navigating via URL', () => {
@@ -37,4 +42,43 @@ describe('ACL Management initial state with repositories', () => {
37
42
  // Then,
38
43
  verifyStateWithSelectedRepository();
39
44
  });
45
+
46
+ it('should prevent ACL management with FedEx repository', () => {
47
+ // Given I have created a Fedex repository
48
+ createFedexRepository(repositoryId, fedexRepositoryId);
49
+ // When I select the fedex repository
50
+ RepositorySelectorSteps.selectRepository(fedexRepositoryId);
51
+ RepositorySelectorSteps.getSelectedRepository().should('contain', fedexRepositoryId);
52
+ RepositorySteps.getActiveRepositoryRow().should('contain', fedexRepositoryId);
53
+ // And I navigate to ACL management page
54
+ MainMenuSteps.clickOnACLManagement();
55
+ // Then I should see the warning message about Fedex repository
56
+ AclManagementSteps.getFedexWarningMessage().should('be.visible');
57
+ AclManagementSteps.getAclManagementContent().should('not.exist');
58
+ // When I switch to graphdb repository
59
+ RepositorySelectorSteps.selectRepository(repositoryId);
60
+ // Then the warning message should be hidden
61
+ AclManagementSteps.getFedexWarningMessage().should('not.exist');
62
+ AclManagementSteps.getAclManagementContent().should('be.visible');
63
+ // When I select a fedex repository
64
+ RepositorySelectorSteps.selectRepository(fedexRepositoryId);
65
+ // Then the fedex warning should become visible
66
+ AclManagementSteps.getFedexWarningMessage().should('be.visible');
67
+ AclManagementSteps.getAclManagementContent().should('not.exist');
68
+ // Go to home page before end to prevent error when delete the repository happens
69
+ HomeSteps.visit();
70
+ });
40
71
  })
72
+
73
+ function createFedexRepository(repositoryId, fedexRepositoryId) {
74
+ RepositorySteps.visit();
75
+ RepositorySteps.getCreateRepositoryButton().click();
76
+ RepositorySteps.createFedexRepositoryType();
77
+ cy.url().should('include', '/repository/create/fedx');
78
+ RepositorySteps.typeRepositoryId(fedexRepositoryId);
79
+ RepositorySteps.selectFedexMember(repositoryId);
80
+ RepositorySteps.saveRepository();
81
+ RepositorySteps.getRepositoriesPage().should('be.visible');
82
+ RepositorySteps.getRepositoryFromList(fedexRepositoryId)
83
+ .should('be.visible');
84
+ }
@@ -26,6 +26,7 @@ describe('Execute query', () => {
26
26
  cy.intercept('POST', `/repositories/${repositoryId}`).as('query');
27
27
  YasqeSteps.executeQuery();
28
28
  cy.wait('@query').then((interception) => {
29
+ expect(interception.request.method).to.equal('POST');
29
30
  const headers = interception.request.headers;
30
31
  expect(headers).to.have.property('x-graphdb-local-consistency');
31
32
  expect(headers).to.have.property('x-graphdb-repository-location');
@@ -35,6 +36,7 @@ describe('Execute query', () => {
35
36
  YasguiSteps.getTabs().should('have.length', 2);
36
37
  YasqeSteps.executeQuery();
37
38
  cy.wait('@query').then((interception) => {
39
+ expect(interception.request.method).to.equal('POST');
38
40
  const headers = interception.request.headers;
39
41
  expect(headers).to.have.property('x-graphdb-local-consistency');
40
42
  expect(headers).to.have.property('x-graphdb-repository-location');
@@ -58,7 +58,7 @@ describe('Expand results over owl:sameAs', () => {
58
58
  YasguiSteps.getYasgui().should('be.visible');
59
59
 
60
60
  // Then I expect that "sameAs" element to be enabled by default
61
- YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-on');
61
+ YasqeSteps.getActionButton(5).should('have.class', 'icon-same-as-on');
62
62
  // and the tooltip of element describes that "sameAs" element is enabled.
63
63
  YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Expand results over owl:sameAs: ON');
64
64
 
@@ -66,7 +66,7 @@ describe('Expand results over owl:sameAs', () => {
66
66
  YasguiSteps.openANewTab();
67
67
 
68
68
  // Then I expect that "sameAs" element to be enabled in the new tab.
69
- YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-on');
69
+ YasqeSteps.getActionButton(5).should('have.class', 'icon-same-as-on');
70
70
  // and the tooltip of element describes that "sameAs" element is enabled.
71
71
  YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Expand results over owl:sameAs: ON');
72
72
  });
@@ -79,7 +79,7 @@ describe('Expand results over owl:sameAs', () => {
79
79
  YasguiSteps.getYasgui().should('be.visible');
80
80
 
81
81
  // Then I expect that "sameAs" element to be disabled by default
82
- YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-off');
82
+ YasqeSteps.getActionButton(5).should('have.class', 'icon-same-as-off');
83
83
  // and the tooltip of element describes that "sameAs" element is disabled.
84
84
  YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Expand results over owl:sameAs: OFF');
85
85
 
@@ -87,7 +87,7 @@ describe('Expand results over owl:sameAs', () => {
87
87
  YasguiSteps.openANewTab();
88
88
 
89
89
  // Then I expect that "sameAs" element to be disabled in the new tab.
90
- YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-off');
90
+ YasqeSteps.getActionButton(5).should('have.class', 'icon-same-as-off');
91
91
  // and the tooltip of element describes that "sameAs" element is disabled.
92
92
  YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Expand results over owl:sameAs: OFF');
93
93
  });
@@ -102,13 +102,13 @@ describe('Expand results over owl:sameAs', () => {
102
102
  // Then I expect that "sameAs" element to be disabled by default
103
103
  YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Requires \'Include Inferred\'!');
104
104
  // and the tooltip of element describes that "infer" is required.
105
- YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-off');
105
+ YasqeSteps.getActionButton(5).should('have.class', 'icon-same-as-off');
106
106
 
107
107
  // When I open a new Tab.
108
108
  YasguiSteps.openANewTab();
109
109
 
110
110
  // Then I expect that "sameAs" element to be disabled in the new tab,
111
- YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-off');
111
+ YasqeSteps.getActionButton(5).should('have.class', 'icon-same-as-off');
112
112
  // and the tooltip of element describes that "infer" is required.
113
113
  YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Requires \'Include Inferred\'!');
114
114
  });
@@ -121,7 +121,7 @@ describe('Expand results over owl:sameAs', () => {
121
121
  YasguiSteps.getYasgui().should('be.visible');
122
122
 
123
123
  // Then I expect that "sameAs" element to be disabled by default,
124
- YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-off');
124
+ YasqeSteps.getActionButton(5).should('have.class', 'icon-same-as-off');
125
125
  // and the tooltip of element describes that "infer" is required.
126
126
  YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Requires \'Include Inferred\'!');
127
127
 
@@ -129,7 +129,7 @@ describe('Expand results over owl:sameAs', () => {
129
129
  YasguiSteps.openANewTab();
130
130
 
131
131
  // Then I expect that "sameAs" element to be disabled in the new tab,
132
- YasqeSteps.getActionButton(4).should('have.class', 'icon-same-as-off');
132
+ YasqeSteps.getActionButton(5).should('have.class', 'icon-same-as-off');
133
133
  // and the tooltip of element describes that "infer" is required.
134
134
  YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Requires \'Include Inferred\'!');
135
135
  });
@@ -64,7 +64,7 @@ describe('Include inferred statements', () => {
64
64
  YasguiSteps.getYasgui().should('be.visible');
65
65
 
66
66
  // Then I expect that "infer" element to be enabled by default,
67
- YasqeSteps.getActionButton(3).should('have.class', 'icon-inferred-on');
67
+ YasqeSteps.getActionButton(4).should('have.class', 'icon-inferred-on');
68
68
  // and the tooltip of element describes that "infer" functionality is enabled.
69
69
  YasqeSteps.getActionButtonTooltip(3).should('have.attr', 'yasgui-data-tooltip', 'Include inferred data in results: ON');
70
70
 
@@ -72,7 +72,7 @@ describe('Include inferred statements', () => {
72
72
  YasguiSteps.openANewTab();
73
73
 
74
74
  // Then I expect that inferred element to be enabled in the new tab,
75
- YasqeSteps.getActionButton(3).should('have.class', 'icon-inferred-on');
75
+ YasqeSteps.getActionButton(4).should('have.class', 'icon-inferred-on');
76
76
  // and the tooltip of element describes that "infer" element is enabled.
77
77
  YasqeSteps.getActionButtonTooltip(3).should('have.attr', 'yasgui-data-tooltip', 'Include inferred data in results: ON');
78
78
  });
@@ -85,7 +85,7 @@ describe('Include inferred statements', () => {
85
85
  YasguiSteps.getYasgui().should('be.visible');
86
86
 
87
87
  // Then I expect that "infer" element to be disabled by default,
88
- YasqeSteps.getActionButton(3).should('have.class', 'icon-inferred-off');
88
+ YasqeSteps.getActionButton(4).should('have.class', 'icon-inferred-off');
89
89
  // and the tooltip of element describes that "infer" element is disabled.
90
90
  YasqeSteps.getActionButtonTooltip(3).should('have.attr', 'yasgui-data-tooltip', 'Include inferred data in results: OFF');
91
91
 
@@ -93,7 +93,7 @@ describe('Include inferred statements', () => {
93
93
  YasguiSteps.openANewTab();
94
94
 
95
95
  // Then I expect that inferred element to be disabled in the new tab,
96
- YasqeSteps.getActionButton(3).should('have.class', 'icon-inferred-off');
96
+ YasqeSteps.getActionButton(4).should('have.class', 'icon-inferred-off');
97
97
  // and the tooltip of element describes that "infer" element is disabled.
98
98
  YasqeSteps.getActionButtonTooltip(3).should('have.attr', 'yasgui-data-tooltip', 'Include inferred data in results: OFF');
99
99
  });
@@ -37,13 +37,13 @@ describe('Expand results over owl:sameAs', () => {
37
37
 
38
38
  // Then I expect inferred button to be on.
39
39
  YasqeSteps.getActionButtonTooltip(3).should('have.attr', 'yasgui-data-tooltip', 'Include inferred data in results: ON');
40
- YasqeSteps.getActionButton(3).should('have.class', 'icon-inferred-on');
40
+ YasqeSteps.getActionButton(4).should('have.class', 'icon-inferred-on');
41
41
 
42
42
  // When I click on inferred button
43
- YasqeSteps.getActionButton(3).click({force: true});
43
+ YasqeSteps.getActionButton(4).click({force: true});
44
44
 
45
45
  // Then I expect inferred button to not be toggled.
46
46
  YasqeSteps.getActionButtonTooltip(3).should('have.attr', 'yasgui-data-tooltip', 'Include inferred data in results: ON');
47
- YasqeSteps.getActionButton(3).should('have.class', 'icon-inferred-on');
47
+ YasqeSteps.getActionButton(4).should('have.class', 'icon-inferred-on');
48
48
  });
49
49
  });
@@ -1,17 +1,19 @@
1
- import {SparqlEditorSteps} from "../../../../steps/sparql-editor-steps";
2
- import {YasqeSteps} from "../../../../steps/yasgui/yasqe-steps";
3
- import {YasrSteps} from "../../../../steps/yasgui/yasr-steps";
4
- import {QueryStubs} from "../../../../stubs/yasgui/query-stubs";
1
+ import {SparqlEditorSteps} from '../../../../steps/sparql-editor-steps';
2
+ import {YasqeSteps} from '../../../../steps/yasgui/yasqe-steps';
3
+ import {QueryStubs} from '../../../../stubs/yasgui/query-stubs';
4
+ import {GraphConfigStubs} from '../../../../stubs/graph-config-stubs.js';
5
+ import {BrowserStubs} from '../../../../stubs/browser-stubs.js';
6
+ import {VisualGraphSplitButtonSteps} from '../../../../steps/visual-graph-split-button-steps.js';
5
7
 
6
- describe('Visual graph button when user execute a CONSTRUCT query', () => {
8
+ describe('"Visualize" split button', () => {
7
9
  let repositoryId;
8
10
 
9
11
  beforeEach(() => {
10
- repositoryId = 'sparql-editor-' + Date.now();
12
+ repositoryId = 'yasr-vizualize-split-button' + Date.now();
11
13
  QueryStubs.stubQueryCountResponse();
12
14
  cy.createRepository({id: repositoryId});
13
15
  cy.presetRepository(repositoryId);
14
- // Given I visit a page with "ontotex-yasgu-web-component" in it.
16
+ // Given I visit a page with 'ontotex-yasgu-web-component' in it.
15
17
  SparqlEditorSteps.visitSparqlEditorPage();
16
18
  });
17
19
 
@@ -19,34 +21,86 @@ describe('Visual graph button when user execute a CONSTRUCT query', () => {
19
21
  cy.deleteRepository(repositoryId);
20
22
  });
21
23
 
22
- it('Should display a "Visual" graph button configured by user', () => {
23
- // When I visit a page with "ontotext-yasgui-web-component" on it,
24
- // and select a CONSTRUCT query.
25
- YasqeSteps.executeQuery();
26
-
27
- // Then I expect "Visual" button to not be visible.
28
- YasrSteps.getVisualButton().should('not.be.visible');
29
-
30
- // When I execute a CONSTRUCT query.
31
- YasqeSteps.pasteQuery(
32
- 'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>' +
33
- 'PREFIX onto: <http://www.ontotext.com/>' +
34
- 'CONSTRUCT {' +
35
- '?source rdf:type ?destination .' +
36
- '} WHERE {' +
37
- '?bag rdf:type ?source .' +
38
- '?flight rdf:type ?destination' +
39
- '}');
40
- YasqeSteps.executeQuery();
41
-
42
- // Then I expect "Visual" button to be visible.
43
- YasrSteps.getVisualButton().should('be.visible');
44
-
45
- // When I execute SELECT query again.
46
- YasqeSteps.pasteQuery('select * where {?s ?p ?o.}');
47
- YasqeSteps.executeQuery();
48
-
49
- // Then I expect "Visual" button to not be visible.
50
- YasrSteps.getVisualButton().should('not.be.visible');
24
+ it('should display "Visualize" split button when user execute a CONSTRUCT query', () => {
25
+ // WHEN: I visit a page with 'ontotext-yasgui-web-component' on it, and execute select query.
26
+ executeSelectQuery();
27
+ // THEN: I expect the 'Visualize' button to not be visible.
28
+ VisualGraphSplitButtonSteps.getVisualizeMainButton().should('not.be.visible');
29
+
30
+ // WHEN: I execute a CONSTRUCT query.
31
+ executeConstructQuery();
32
+ // THEN: I expect the 'Visualize' button to be visible.
33
+ VisualGraphSplitButtonSteps.getVisualizeMainButton().should('be.visible');
34
+
35
+ // WHEN: I execute SELECT query again.
36
+ executeSelectQuery();
37
+ // THEN: I expect the 'Visualize' button to not be visible.
38
+ VisualGraphSplitButtonSteps.getVisualizeMainButton().should('not.be.visible');
39
+ });
40
+
41
+ it('should inform user that there no created graph configurations', () => {
42
+ // GIVEN: There are no graph configurations.
43
+ GraphConfigStubs.stubGetEmptyGraphConfigs();
44
+ // AND: I visit a page with 'ontotext-yasgui-web-component' on it, and the 'Visualize' button is visible.
45
+ executeConstructQuery();
46
+
47
+ // WHEN: I open the dropdown.
48
+ VisualGraphSplitButtonSteps.toggleGraphConfigDropdown();
49
+ // THEN: I expect to see message that informs that there are no graph configurations.
50
+ VisualGraphSplitButtonSteps.getNoConfigurationsMessage().should('contain.text', 'No advanced graph configuration.');
51
+
52
+ // WHEN: I click on create link.
53
+ BrowserStubs.stubWindowOpen();
54
+ VisualGraphSplitButtonSteps.clickCreateGraphConfigLink();
55
+ // THEN: I expect to be navigated to graph configurations page.
56
+ cy.get(BrowserStubs.WINDOW_OPEN_ALIAS()).should('have.been.calledWithMatch', 'graphs-visualizations', '_blank', 'noopener,noreferrer');
57
+ });
58
+
59
+ it('should open graphs-visualizations view when click on main button', () => {
60
+ // GIVEN: I visit a page with 'ontotext-yasgui-web-component' on it, and the 'Visualize' button is visible.
61
+ executeConstructQuery();
62
+
63
+ // WHEN: I click on main button
64
+ VisualGraphSplitButtonSteps.clickOnVisualizeMainButton();
65
+ // THEN: I expect to be navigated to graphs-visualizations view.
66
+ cy.url().should('include', 'graphs-visualizations');
67
+ cy.getQueryParam('query').should('include', 'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>PREFIX onto: <http://www.ontotext.com/>CONSTRUCT {?source rdf:type ?destination .} WHERE {?bag rdf:type ?source .?flight rdf:type ?destination}');
68
+ cy.getQueryParam('config').should('not.exist');
69
+ });
70
+
71
+ it('should open graphs-visualizations view when select a graph configuration', () => {
72
+ // GIVEN: I visit a page with 'ontotext-yasgui-web-component' on it, and the 'Visualize' button is visible.
73
+ executeConstructQuery();
74
+ GraphConfigStubs.stubGetGraphConfigs();
75
+
76
+ // WHEN: I open the dropdown.
77
+ VisualGraphSplitButtonSteps.toggleGraphConfigDropdown();
78
+ // THEN: I expect to see all graph configurations.
79
+ VisualGraphSplitButtonSteps.getGraphConfigs().should('have.length', 3);
80
+
81
+ // WHEN: I select a graph configuration
82
+ VisualGraphSplitButtonSteps.selectGraphConfig();
83
+ // THEN: I expect to be navigated to graphs-visualizations view.
84
+ cy.url().should('include', 'graphs-visualizations');
85
+ cy.getQueryParam('query').should('include', 'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>PREFIX onto: <http://www.ontotext.com/>CONSTRUCT {?source rdf:type ?destination .} WHERE {?bag rdf:type ?source .?flight rdf:type ?destination}');
86
+ cy.getQueryParam('config').should('eq', 'de99fd5de7f94ef98f1875dff55fc1c9');
51
87
  });
52
88
  });
89
+
90
+ const executeSelectQuery = () => {
91
+ YasqeSteps.pasteQuery('select * where {?s ?p ?o.}');
92
+ YasqeSteps.executeQuery();
93
+ };
94
+
95
+ const executeConstructQuery = () => {
96
+ YasqeSteps.pasteQuery(
97
+ 'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>' +
98
+ 'PREFIX onto: <http://www.ontotext.com/>' +
99
+ 'CONSTRUCT {' +
100
+ '?source rdf:type ?destination .' +
101
+ '} WHERE {' +
102
+ '?bag rdf:type ?source .' +
103
+ '?flight rdf:type ?destination' +
104
+ '}');
105
+ YasqeSteps.executeQuery();
106
+ };
@@ -0,0 +1,80 @@
1
+ import {SparqlEditorSteps} from '../../../steps/sparql-editor-steps.js';
2
+ import {YasrSteps} from '../../../steps/yasgui/yasr-steps.js';
3
+ import {YasqeSteps} from '../../../steps/yasgui/yasqe-steps.js';
4
+
5
+ describe('YASR', () => {
6
+ let repositoryId;
7
+ let secondRepositoryId;
8
+
9
+ beforeEach(() => {
10
+ repositoryId = 'yasr-' + Date.now();
11
+ cy.createRepository({id: repositoryId});
12
+ cy.presetRepository(repositoryId);
13
+ });
14
+
15
+ afterEach(() => {
16
+ cy.deleteRepository(repositoryId);
17
+ cy.deleteRepository(secondRepositoryId);
18
+ });
19
+
20
+ it('should load YASR in fullscreen with plugin config from URL', () => {
21
+ // WHEN: I visit SPARQL Query & Update page with url parameters: embedded and pluginName
22
+ SparqlEditorSteps.visitSparqlEditorPageAndWaitForResults(getUrl(repositoryId, 'pivotTable', true));
23
+ // THEN: YASR is in fullscreen mode because the workbench is embedded.
24
+ YasrSteps.getYasr().should('have.class', 'yasr-fullscreen');
25
+ // AND: I expect the raw response plugin to be visible
26
+ YasrSteps.getPivotTablePlugin().should('be.visible');
27
+
28
+ // WHEN: I press the ESC key.
29
+ YasrSteps.typeEscapeKey();
30
+ // THEN: I see YASR results in fullscreen mode because Escape is disabled in this mode.
31
+ YasrSteps.getYasr().should('have.class', 'yasr-fullscreen');
32
+
33
+ // WHEN: I visit SPARQL Query & Update page with without embedded url parameter.
34
+ SparqlEditorSteps.visitSparqlEditorPageAndWaitForResults(getUrl(repositoryId, 'googleChart'));
35
+ // THEN: I expect yasr to be in non-fullscreen mode
36
+ YasrSteps.getYasr().should('not.have.class', 'yasr-fullscreen');
37
+ // AND: I expect Google Chart plugin to be visible
38
+ YasrSteps.getGoogleChartPlugin().should('be.visible');
39
+
40
+ // WHEN: I visit SPARQL Query & Update page with without embedded and pluginName url parameters.
41
+ SparqlEditorSteps.visitSparqlEditorPageAndWaitForResults(getUrl(repositoryId));
42
+ // THEN: I expect yasr to be in non-fullscreen mode
43
+ YasrSteps.getYasr().should('not.have.class', 'yasr-fullscreen');
44
+ // AND: I expect Google Chart plugin to be visible, because it was the last used plugin.
45
+ YasrSteps.getGoogleChartPlugin().should('be.visible');
46
+
47
+ // WHEN: I visit SPARQL Query & Update page with without embedded and pluginName url parameters.
48
+ // AND: There are no persisted yasr data.
49
+ cy.clearLocalStorage('yagui__graphdb-workbench-sparql-editor');
50
+ SparqlEditorSteps.visitSparqlEditorPageAndWaitForResults(getUrl(repositoryId));
51
+ // THEN: I expect yasr to be in non-fullscreen mode
52
+ YasrSteps.getYasr().should('not.have.class', 'yasr-fullscreen');
53
+ // AND: I expect the default plugin to be visible
54
+ YasrSteps.getExtendedTablePlugin().should('be.visible');
55
+ });
56
+
57
+ it('should trigger YASR fullscreen mode', () => {
58
+ // GIVEN: I open a page that contains "ontotext-yasgui-web-component".
59
+ SparqlEditorSteps.visitSparqlEditorPage();
60
+
61
+ // WHEN: I execute a query.
62
+ YasqeSteps.executeQuery();
63
+ // THEN: I should see YASR results in non-fullscreen mode.
64
+ YasrSteps.getYasr().should('not.have.class', 'yasr-fullscreen');
65
+
66
+ // WHEN: I toggle to fullscreen mode.
67
+ YasrSteps.toggleFullscreen();
68
+ // THEN: I should see YASR results in fullscreen mode.
69
+ YasrSteps.getYasr().should('have.class', 'yasr-fullscreen');
70
+
71
+ // WHEN: I press the ESC key.
72
+ YasrSteps.typeEscapeKey();
73
+ // THEN: I should see YASR results in non-fullscreen mode, because escape is enabled when workbench is not embedded.
74
+ YasrSteps.getYasr().should('not.have.class', 'yasr-fullscreen');
75
+ });
76
+ });
77
+
78
+ const getUrl = (repositoryId, pluginName, embedded = false) => {
79
+ return `repositoryId=${repositoryId}${pluginName ? ('&pluginName=' + pluginName) : ''}${embedded ? '&embedded' : ''}&query=SELECT * { ?s ?p ?o }&execute=true`;
80
+ }
@@ -0,0 +1,59 @@
1
+ [
2
+ {
3
+ "id": "de99fd5de7f94ef98f1875dff55fc1c9",
4
+ "name": "Graph Config 1",
5
+ "startMode": "search",
6
+ "owner": "admin",
7
+ "startQueryIncludeInferred": true,
8
+ "startQuerySameAs": true,
9
+ "startGraphQuery": "# CONSTRUCT or DESCRIBE query. The results will be rendered visually as a graph of triples.\nCONSTRUCT WHERE {\n\t?s ?p ?o\n} LIMIT 10",
10
+ "startIRI": null,
11
+ "startIRILabel": null,
12
+ "expandQuery": null,
13
+ "resourceQuery": null,
14
+ "predicateLabelQuery": null,
15
+ "resourcePropertiesQuery": null,
16
+ "shared": false,
17
+ "description": null,
18
+ "hint": null,
19
+ "repositoryId": "A_test"
20
+ },
21
+ {
22
+ "id": "94cab6579df445c68c454b2156013811",
23
+ "name": "Graph Config 1",
24
+ "startMode": "search",
25
+ "owner": "admin",
26
+ "startQueryIncludeInferred": true,
27
+ "startQuerySameAs": true,
28
+ "startGraphQuery": "# CONSTRUCT or DESCRIBE query. The results will be rendered visually as a graph of triples.\nCONSTRUCT WHERE {\n\t?s ?p ?o\n} LIMIT 10",
29
+ "startIRI": null,
30
+ "startIRILabel": null,
31
+ "expandQuery": null,
32
+ "resourceQuery": null,
33
+ "predicateLabelQuery": null,
34
+ "resourcePropertiesQuery": null,
35
+ "shared": false,
36
+ "description": null,
37
+ "hint": null,
38
+ "repositoryId": null
39
+ },
40
+ {
41
+ "id": "94cab6579df445c68c454b2156013661",
42
+ "name": "Graph Config 1",
43
+ "startMode": "query",
44
+ "owner": "admin",
45
+ "startQueryIncludeInferred": true,
46
+ "startQuerySameAs": true,
47
+ "startGraphQuery": "# CONSTRUCT or DESCRIBE query. The results will be rendered visually as a graph of triples.\nCONSTRUCT WHERE {\n\t?s ?p ?o\n} LIMIT 10",
48
+ "startIRI": null,
49
+ "startIRILabel": null,
50
+ "expandQuery": null,
51
+ "resourceQuery": null,
52
+ "predicateLabelQuery": null,
53
+ "resourcePropertiesQuery": null,
54
+ "shared": false,
55
+ "description": null,
56
+ "hint": null,
57
+ "repositoryId": null
58
+ }
59
+ ]
@@ -56,8 +56,13 @@
56
56
  "options": {
57
57
  "maxIrisPerCall": 15
58
58
  }
59
+ },
60
+ {
61
+ "guideBlockName": "set-context-window-size",
62
+ "options": {
63
+ "contextSize": 4096
64
+ }
59
65
  }
60
-
61
66
  ]
62
67
  }
63
68
  },