graphdb-workbench-tests 3.4.0-dynamic-guides-test → 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 (71) 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/navigation/navigation-guide.spec.js +64 -0
  7. package/e2e-legacy/guides/table-graph-explore/table-graph-explore-guide.spec.js +2 -1
  8. package/e2e-legacy/guides/ttyg/configure-agent/configure-agent-guide.spec.js +34 -26
  9. package/e2e-legacy/guides/ttyg/edit-agent/edit-ttyg-agent-guide.spec.js +1 -0
  10. package/e2e-legacy/guides/visual-graph/visual-graph-guide.spec.js +330 -124
  11. package/e2e-legacy/help/guides/guides-autostart.spec.js +36 -3
  12. package/e2e-legacy/help/guides/guides-confirm-cancel-dialog.js +83 -0
  13. package/e2e-legacy/home/cookie-policy/cookie-policy.spec.js +182 -0
  14. package/e2e-legacy/home/create-repository.spec.js +6 -0
  15. package/e2e-legacy/repository/attach-remote-location.spec.js +47 -12
  16. package/e2e-legacy/repository/url-with-repository-id-parameter.spec.js +1 -1
  17. package/e2e-legacy/resource/resource.spec.js +33 -13
  18. package/e2e-legacy/setup/aclmanagement/acl-management-with-selected repository.spec.js +44 -0
  19. package/e2e-legacy/sparql-editor/actions/execute-query.spec.js +2 -0
  20. package/e2e-legacy/sparql-editor/actions/expand-results-over-sameas.spec.js +8 -8
  21. package/e2e-legacy/sparql-editor/actions/include-inferred-statements.spec.js +4 -4
  22. package/e2e-legacy/sparql-editor/actions/inferred-sameas.spec.js +3 -3
  23. package/e2e-legacy/sparql-editor/yasr/toolbar/visual-graph-button.spec.js +90 -36
  24. package/e2e-legacy/sparql-editor/yasr/yasr.spec.js +80 -0
  25. package/e2e-legacy/ttyg/chat-panel.spec.js +9 -0
  26. package/e2e-legacy/ttyg/clone-agent.spec.js +22 -0
  27. package/e2e-legacy/ttyg/edit-agent.spec.js +17 -0
  28. package/e2e-security/setup/home/cookie-policy.spec.js +232 -6
  29. package/e2e-security/setup/users-and-access/turn-on-security-and-password-change.spec.js +72 -59
  30. package/fixtures/graph/graph-configurations.json +59 -0
  31. package/fixtures/guides/confirm-cancel-dialog/confirm-cancel-dialog-guide.json +15 -0
  32. package/fixtures/guides/navigation/navigation-guide.json +60 -0
  33. package/fixtures/guides/ttyg/configure-agent/configure-ttyg-agent-guide.json +6 -1
  34. package/fixtures/guides/visual-graph/visual-graph-config-guide.json +39 -0
  35. package/fixtures/ttyg/chats/explain-response-1.json +2 -48
  36. package/npm-shrinkwrap.json +32 -33
  37. package/package.json +1 -1
  38. package/steps/cookie-policy/cookie-consent-banner-steps.js +21 -0
  39. package/steps/cookie-policy/cookie-policy-modal.steps.js +56 -0
  40. package/steps/graphql/create-graphql-endpoint-steps.js +8 -0
  41. package/steps/graphql/graphql-endpoint-management-steps.js +8 -0
  42. package/steps/graphql/graphql-playground-steps.js +8 -0
  43. package/steps/guides/guide-dialog-steps.js +56 -2
  44. package/steps/guides/movies-guide-steps.js +2 -1
  45. package/steps/header-steps.js +13 -0
  46. package/steps/home-steps.js +4 -27
  47. package/steps/login-steps.js +1 -0
  48. package/steps/main-menu-steps.js +1 -0
  49. package/steps/repositories/attach-repository-steps.js +16 -0
  50. package/steps/repository-steps.js +24 -0
  51. package/steps/resource/resource-steps.js +0 -8
  52. package/steps/setup/acl-management-steps.js +12 -0
  53. package/steps/setup/settings-steps.js +1 -1
  54. package/steps/shared-modal-dialog-steps.js +45 -0
  55. package/steps/sparql-editor-steps.js +18 -4
  56. package/steps/ttyg/ttyg-agent-settings-modal.steps.js +1 -1
  57. package/steps/visual-graph-split-button-steps.js +45 -0
  58. package/steps/visual-graph-steps.js +69 -3
  59. package/steps/yasgui/yasr-steps.js +30 -6
  60. package/stubs/cluster/remote-location-stubs.js +4 -0
  61. package/stubs/graph-config-stubs.js +17 -0
  62. package/stubs/guides/guides-stubs.js +8 -0
  63. package/stubs/repositories/repositories-stubs.js +22 -0
  64. package/stubs/security-stubs.js +4 -0
  65. package/stubs/sparql-stubs.js +10 -0
  66. package/support/commands.js +1 -0
  67. package/support/e2e-security.js +1 -1
  68. package/support/repository-commands.js +22 -3
  69. package/support/settings-commands.js +18 -2
  70. package/support/url-commands.js +13 -0
  71. package/e2e-legacy/home/cookie-policy.spec.js +0 -108
@@ -0,0 +1,83 @@
1
+ import {GuideSteps} from "../../../steps/guides/guide-steps.js";
2
+ import {GuideDialogSteps} from "../../../steps/guides/guide-dialog-steps.js";
3
+ import {GuidesStubs} from "../../../stubs/guides/guides-stubs.js";
4
+
5
+ describe('Confirm cancel dialog', () => {
6
+ it('Should open confirm cancel dialog', () => {
7
+ GuidesStubs.stubWelcomGuide();
8
+ GuideSteps.visit();
9
+ GuideSteps.verifyGuidesListExists();
10
+ cy.wait('@getGuides');
11
+
12
+ // Given, I start a guide
13
+ GuideSteps.runFirstGuide();
14
+ GuideSteps.assertPageNotInteractive();
15
+ GuideDialogSteps.assertDialogWithTitleIsVisible(`Welcome to`);
16
+
17
+ // When, I try to cancel the guide
18
+ GuideDialogSteps.clickOnCancelButton();
19
+
20
+ // Then, I should see a confirm cancel dialog
21
+ GuideDialogSteps.getConfirmCancelDialog().should('be.visible');
22
+ GuideDialogSteps.getModalDialog().should('not.exist');
23
+
24
+ // When I press the cancel button
25
+ GuideDialogSteps.clickConfirmCancelDialogCancelButton();
26
+
27
+ // Then, I should see the guide dialog again as I didn't cancel it
28
+ GuideDialogSteps.getModalDialog().should('be.visible');
29
+ GuideDialogSteps.assertDialogWithTitleIsVisible(`Welcome to`);
30
+
31
+ // When I press the cancel dialog again
32
+ GuideDialogSteps.clickOnCancelButton();
33
+ GuideDialogSteps.getConfirmCancelDialog().should('be.visible');
34
+ GuideDialogSteps.getModalDialog().should('not.exist');
35
+
36
+ // And click on the close (X) icon button
37
+ GuideDialogSteps.clickOnConfirmCancelDialogCloseButton();
38
+
39
+ // Then, I should see the guide again as I didn't cancel it
40
+ GuideDialogSteps.getModalDialog().should('be.visible');
41
+ GuideDialogSteps.assertDialogWithTitleIsVisible(`Welcome to`);
42
+
43
+ // When I try to cancel it a third time
44
+ GuideDialogSteps.clickOnCancelButton();
45
+ GuideDialogSteps.getConfirmCancelDialog().should('be.visible');
46
+ GuideDialogSteps.getModalDialog().should('not.exist');
47
+
48
+ // And click on exit
49
+ GuideDialogSteps.clickConfirmCancelDialogExitButton();
50
+
51
+ // Then, I should see the guides list and no active guide as I canceled it
52
+ GuideDialogSteps.getModalDialog().should('not.exist');
53
+ GuideDialogSteps.getConfirmCancelDialog().should('not.exist');
54
+ });
55
+
56
+ it('Should disable autostart when don\'t show again is pressed', () => {
57
+ const guideName = 'star-wars';
58
+ // Given, I visit the home page with autostart guide parameter in URL
59
+ GuideSteps.autostartGuide(guideName);
60
+ // Then, I should see the guide
61
+ GuideSteps.assertPageNotInteractive();
62
+ GuideDialogSteps.assertDialogWithTitleIsVisible(`Welcome to`);
63
+
64
+ // When I try to cancel the dialog
65
+ GuideDialogSteps.clickOnCancelButton();
66
+
67
+ // Then, I should see a confirm cancel dialog with "Don't show again" button
68
+ GuideDialogSteps.getConfirmCancelDialog().should('be.visible');
69
+ GuideDialogSteps.getConfirmCancelDialogDontShowAgainButton().should('be.visible');
70
+
71
+ // When I click on the "don't show again" button
72
+ GuideDialogSteps.clickConfirmCancelDialogDontShowAgainButton();
73
+
74
+ // Then, the confirm cancel dialog should be closed and the guide should be canceled
75
+ GuideDialogSteps.getConfirmCancelDialog().should('not.exist');
76
+
77
+ // When I try to autostart it again
78
+ GuideSteps.autostartGuide(guideName);
79
+ // Then, I should not see the guide anymore. A disabled flag should be set to true in the storage,
80
+ // when the guide is completed via autostart, preventing the guide from autostarting again.
81
+ GuideDialogSteps.getModalDialog().should('not.exist');
82
+ });
83
+ });
@@ -0,0 +1,182 @@
1
+ import HomeSteps from '../../../steps/home-steps';
2
+ import {SecurityStubs} from '../../../stubs/security-stubs';
3
+ import {SettingsSteps} from '../../../steps/setup/settings-steps';
4
+ import {LicenseStubs} from '../../../stubs/license-stubs';
5
+ import {CookiePolicyModalSteps} from '../../../steps/cookie-policy/cookie-policy-modal.steps';
6
+ import {MainMenuSteps} from '../../../steps/main-menu-steps.js';
7
+ import {CookieConsentBannerSteps} from '../../../steps/cookie-policy/cookie-consent-banner-steps.js';
8
+
9
+ Cypress.env('set_default_user_data', false);
10
+
11
+ describe('Cookie policy', () => {
12
+ beforeEach(() => {
13
+ cy.setCookieConsent(undefined);
14
+ cy.viewport(1280, 1000);
15
+ LicenseStubs.stubFreeLicense();
16
+ });
17
+
18
+ afterEach(() => {
19
+ cy.setCookieConsent(undefined);
20
+ });
21
+
22
+ it('should have default state when security is OFF', () => {
23
+ // Given GDB security is OFF
24
+ // When I open home page
25
+ HomeSteps.visitInProdMode();
26
+ // Then I expect to see cookie consent banner
27
+ CookieConsentBannerSteps.getCookieConsentBanner().should('be.visible');
28
+ // When I click on the cookie policy link in the banner
29
+ CookieConsentBannerSteps.clickCookiePolicyLink();
30
+ // Then I see the cookie policy
31
+ CookiePolicyModalSteps.getDialogComponent().and('be.visible');
32
+ CookiePolicyModalSteps.getBody().should('be.visible');
33
+ // And I expect to see that analytic and third party cookies are allowed
34
+ CookiePolicyModalSteps.validateCookiePolicyDialog(true, true);
35
+ // When I close the cookie policy modal
36
+ CookiePolicyModalSteps.closeDialog();
37
+ // Then I expect the cookie policy modal to be closed
38
+ CookiePolicyModalSteps.getDialogComponent().should('not.exist');
39
+ // When I open my settings page
40
+ SettingsSteps.visitInProdMode();
41
+ // Then I expect to see cookie policy button in My settings widget
42
+ SettingsSteps.getCookiePolicyButton().and('be.visible');
43
+ // When I click on the cookie policy button in My settings widget
44
+ SettingsSteps.clickCookiePolicyLink();
45
+ // Then I see the cookie policy
46
+ CookiePolicyModalSteps.getDialogComponent().and('be.visible');
47
+ CookiePolicyModalSteps.getBody().should('be.visible');
48
+ // And I expect to see that analytic and third party cookies are allowed
49
+ CookiePolicyModalSteps.validateCookiePolicyDialog(true, true);
50
+ // When I close the cookie policy modal
51
+ CookiePolicyModalSteps.closeDialog();
52
+ // Then I expect the cookie policy modal to be closed
53
+ CookiePolicyModalSteps.getDialogComponent().should('not.exist');
54
+ });
55
+
56
+ it('should give consent for default cookie policy when security is OFF', () => {
57
+ // Given GDB security is OFF
58
+ // When I open home page
59
+ HomeSteps.visitInProdMode();
60
+ // Then I expect to see cookie consent banner
61
+ CookieConsentBannerSteps.getCookieConsentBanner().should('be.visible');
62
+ // When I click OK in the cookie consent banner
63
+ SecurityStubs.spyOnUserUpdate('admin');
64
+ CookieConsentBannerSteps.giveCookieConsent();
65
+ // Then I expect to save cookie consent in user settings
66
+ validateUserUpdateWithCookieConsent();
67
+ // And I expect the banner to be hidden
68
+ CookieConsentBannerSteps.getCookieConsentBanner().should('not.exist');
69
+ // And I expect GA tracking script to be added to the head
70
+ validateGATracking();
71
+ // When I open another page
72
+ MainMenuSteps.clickOnMenuImport();
73
+ cy.url().should('include', '/import');
74
+ // Then I expect the banner to be hidden
75
+ CookieConsentBannerSteps.getCookieConsentBanner().should('not.exist');
76
+ // When I reload the page
77
+ cy.reload();
78
+ // Then I expect the banner to be hidden
79
+ CookieConsentBannerSteps.getCookieConsentBanner().should('not.exist');
80
+ });
81
+
82
+ it('should update cookie policy and give consent when security is OFF', () => {
83
+ // Given GDB security is OFF
84
+ // When I open home page
85
+ HomeSteps.visitInProdMode();
86
+ // Then I expect to see cookie consent banner
87
+ CookieConsentBannerSteps.getCookieConsentBanner().should('be.visible');
88
+ // When I click on the cookie policy link in the banner
89
+ CookieConsentBannerSteps.clickCookiePolicyLink();
90
+ // Then I see the cookie policy
91
+ CookiePolicyModalSteps.getDialogComponent().should('be.visible');
92
+ CookiePolicyModalSteps.validateCookiePolicyDialog(true, true);
93
+ // When I toggle off the analytics cookie checkbox
94
+ CookiePolicyModalSteps.toggleStatisticCookies();
95
+ // And I close the dialog
96
+ CookiePolicyModalSteps.closeDialog();
97
+ CookiePolicyModalSteps.getDialog().should('not.exist');
98
+ // When I reopen the cookie policy dialog using the button in the banner
99
+ CookieConsentBannerSteps.clickCookiePolicyLink();
100
+ // And I expect to see that analytic cookies are not allowed and third party cookies are allowed
101
+ CookiePolicyModalSteps.validateCookiePolicyDialog(false, true);
102
+ // When I close the cookie policy dialog
103
+ CookiePolicyModalSteps.closeDialog();
104
+ // And I open my settings page
105
+ MainMenuSteps.clickOnMySettings();
106
+ // Then I expect to see cookie policy button in My settings widget
107
+ SettingsSteps.getCookiePolicyButton().and('be.visible');
108
+ // When I click on the cookie policy button in My settings widget
109
+ SettingsSteps.clickCookiePolicyLink();
110
+ // Then I see the cookie policy
111
+ CookiePolicyModalSteps.getDialogComponent().should('be.visible');
112
+ // And I expect to see that analytic cookies are not allowed and third party cookies are allowed
113
+ CookiePolicyModalSteps.validateCookiePolicyDialog(false, true);
114
+ // When I toggle off the third party cookies checkbox
115
+ CookiePolicyModalSteps.toggleThirdPartyCookies();
116
+ // And I close the cookie policy dialog
117
+ CookiePolicyModalSteps.closeDialog();
118
+ // When I reopen the cookie policy dialog using the button in my settings widget
119
+ SettingsSteps.clickCookiePolicyLink();
120
+ // And I expect to see that analytic cookies are not allowed and third party cookies are not allowed
121
+ CookiePolicyModalSteps.validateCookiePolicyDialog(false, false);
122
+ CookiePolicyModalSteps.closeDialog();
123
+ // When I reload the page
124
+ cy.reload();
125
+ // And I reopen the cookie policy dialog using the button in my settings widget
126
+ SettingsSteps.clickCookiePolicyLink();
127
+ // And I expect to see that analytic cookies are not allowed and third party cookies are not allowed
128
+ CookiePolicyModalSteps.validateCookiePolicyDialog(false, false);
129
+ // When I close the cookie policy dialog
130
+ CookiePolicyModalSteps.closeDialog();
131
+ // And I click OK in the cookie consent banner
132
+ CookieConsentBannerSteps.giveCookieConsent();
133
+ // Then I expect the banner to be hidden
134
+ CookieConsentBannerSteps.getCookieConsentBanner().should('not.exist');
135
+ // When I reload the page
136
+ cy.reload();
137
+ // Then I expect the banner to be hidden
138
+ CookieConsentBannerSteps.getCookieConsentBanner().should('not.exist');
139
+ });
140
+ });
141
+
142
+ function validateUserUpdateWithCookieConsent() {
143
+ cy.wait('@updateUser').then((xhr) => {
144
+ expect(xhr.request.body.appSettings).to.include({
145
+ DEFAULT_INFERENCE: true,
146
+ DEFAULT_VIS_GRAPH_SCHEMA: true,
147
+ DEFAULT_SAMEAS: true,
148
+ IGNORE_SHARED_QUERIES: false,
149
+ EXECUTE_COUNT: true
150
+ });
151
+
152
+ // Assert COOKIE_CONSENT properties, excluding updatedAt
153
+ expect(xhr.request.body.appSettings.COOKIE_CONSENT).to.include({
154
+ policyAccepted: true
155
+ });
156
+
157
+ // Assert that updatedAt is present, is a number, and is a reasonable timestamp
158
+ const updatedAt = xhr.request.body.appSettings.COOKIE_CONSENT.updatedAt;
159
+ expect(updatedAt).to.exist;
160
+ expect(updatedAt).to.be.a('number');
161
+
162
+ // Check that updatedAt is within 1 hour of the current time
163
+ const oneHourInMilliseconds = 60 * 60 * 1000;
164
+ const now = Date.now();
165
+ expect(updatedAt).to.be.within(now - oneHourInMilliseconds, now + oneHourInMilliseconds);
166
+ });
167
+ }
168
+
169
+ function validateGATracking() {
170
+ // Check if the GA tracking script is set correctly in the head
171
+ cy.document()
172
+ .get('head script')
173
+ .should("have.attr", "src")
174
+ .should('include', 'https://www.googletagmanager.com/gtm.js?id=GTM-WBP6C6Z4');
175
+
176
+ // Check if the installation ID cookie is set correctly
177
+ cy.getCookie('_wb').then((cookie) => {
178
+ expect(cookie).to.exist;
179
+ // Check the cookie structure: WB1.<installationId>.<timestamp>
180
+ expect(cookie.value).to.match(/^WB1\.[a-zA-Z0-9\-]+\.\d+$/);
181
+ });
182
+ }
@@ -1,10 +1,16 @@
1
1
  import HomeSteps from '../../steps/home-steps';
2
+ import {RepositoriesStubs} from "../../stubs/repositories/repositories-stubs.js";
2
3
 
3
4
  describe('Create repository', () => {
4
5
 
5
6
  beforeEach(() => {
6
7
  cy.viewport(1280, 1000);
7
8
  HomeSteps.visitAndWaitLoader();
9
+ RepositoriesStubs.spyGetRepositories();
10
+ cy.wait('@getRepositories');
11
+ // Due to the ongoing migration, there are currently 2 requests to get repositories on init (one from the legacy and one from the new workbench).
12
+ // This will be removed once migration is complete (or at least the repository part of it)
13
+ cy.wait('@getRepositories');
8
14
  });
9
15
 
10
16
  it('Test create and select new repository via home page', () => {
@@ -2,13 +2,21 @@ import {RepositorySteps} from "../../steps/repository-steps";
2
2
  import {AttachRepositorySteps} from "../../steps/repositories/attach-repository-steps";
3
3
  import {ModalDialogSteps} from "../../steps/modal-dialog-steps";
4
4
  import {RepositoriesStubs} from "../../stubs/repositories/repositories-stubs";
5
+ import {RemoteLocationStubs} from '../../stubs/cluster/remote-location-stubs.js';
5
6
 
6
7
  describe('Attach remote location', () => {
8
+ let remoteLocationName;
9
+
10
+ beforeEach(() => {
11
+ remoteLocationName = 'http://location-' + Date.now();
12
+ });
13
+
14
+ afterEach(() => {
15
+ cy.deleteRemoteLocation(remoteLocationName);
16
+ })
7
17
 
8
18
  it('Should create and delete remote instance', () => {
9
- cy.visit('/repository');
10
- RepositorySteps.waitLoader();
11
- RepositorySteps.waitUntilRepositoriesPageIsLoaded();
19
+ RepositorySteps.visit();
12
20
 
13
21
  // When I open the "Attach a remote instance" dialog.
14
22
  AttachRepositorySteps.openAttachRemoteLocationDialog();
@@ -114,12 +122,43 @@ describe('Attach remote location', () => {
114
122
  RepositorySteps.getSparqlOntopicTable().should('not.exist');
115
123
  });
116
124
 
125
+ it('should be able to create a remote location with encrypted password', () => {
126
+ // Given I have a running GDB instance and I am on the Repositories view
127
+ RepositorySteps.visit();
128
+ // When I start the location creation
129
+ AttachRepositorySteps.openAttachRemoteLocationDialog();
130
+ AttachRepositorySteps.enterURL(remoteLocationName);
131
+ // And I select basic auth type
132
+ AttachRepositorySteps.selectBasicRadioBtn();
133
+ // Then I expect to see a security warning
134
+ AttachRepositorySteps.getUnencryptedPasswordWarning().should('be.visible');
135
+ // And I should not see the warning for the backward compatibility issues when encrypting the password
136
+ AttachRepositorySteps.getBackwardCompatibilityWarning().should('not.exist');
137
+ // When I select to encrypt the password
138
+ AttachRepositorySteps.encryptPassword();
139
+ // Then I should see the backward compatibility warning
140
+ AttachRepositorySteps.getBackwardCompatibilityWarning().should('be.visible');
141
+ // And the unencrypted password warning should not be visible
142
+ AttachRepositorySteps.getUnencryptedPasswordWarning().should('not.exist');
143
+ // When I fill in username and password
144
+ AttachRepositorySteps.enterUsername('locationadmin');
145
+ AttachRepositorySteps.enterPassword('admin123');
146
+ // And I save the location
147
+ RemoteLocationStubs.spyRemoteLocationCreate();
148
+ AttachRepositorySteps.attachRemoteLocation();
149
+ // Then encrypt password flag should be sent
150
+ cy.wait('@add-remote-location')
151
+ .its('request.body')
152
+ .should('include', {
153
+ encryptPassword: true,
154
+ username: 'locationadmin'
155
+ });
156
+ });
157
+
117
158
  it('Should render different location types in separate tables: error, location with and without repositories', () => {
118
159
  RepositoriesStubs.stubRepositories();
119
160
  RepositoriesStubs.stubLocations();
120
- cy.visit('/repository');
121
- RepositorySteps.waitLoader();
122
- RepositorySteps.waitUntilRepositoriesPageIsLoaded();
161
+ RepositorySteps.visit();
123
162
  cy.wait('@get-all-repositories');
124
163
 
125
164
  // When I open the Repositories view that contains all possible kind of locations.
@@ -137,9 +176,7 @@ describe('Attach remote location', () => {
137
176
  });
138
177
 
139
178
  it('Should be able to open edit remote location dialog', () => {
140
- cy.visit('/repository');
141
- RepositorySteps.waitLoader();
142
- RepositorySteps.waitUntilRepositoriesPageIsLoaded();
179
+ RepositorySteps.visit();
143
180
 
144
181
  const locationId = 'http://local';
145
182
  addRemoteSPARQLLocation(locationId, 'username', 'password');
@@ -161,9 +198,7 @@ describe('Attach remote location', () => {
161
198
  });
162
199
 
163
200
  it('Should create and delete SPARQL endpoint instance', () => {
164
- cy.visit('/repository');
165
- RepositorySteps.waitLoader();
166
- RepositorySteps.waitUntilRepositoriesPageIsLoaded();
201
+ RepositorySteps.visit();
167
202
 
168
203
  const locationId = 'http://endpoint/repo/ex';
169
204
  addRemoteSPARQLLocation(locationId, 'username', 'password');
@@ -171,7 +171,7 @@ describe('URL with Repository ID parameter', () => {
171
171
  // Given I am on the 404 page which is in the new workbench
172
172
  ErrorPageSteps.visit404();
173
173
  ErrorPageSteps.get404Page().should('be.visible');
174
- cy.url().should('not.include', 'repositoryId=');
174
+ cy.url().should('include', `repositoryId=${repositoryId}`);
175
175
  // When I navigate to some legacy page
176
176
  MainMenuSteps.clickOnSparqlMenu();
177
177
  // Then repositoryId parameter should be preserved in the URL
@@ -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');