graphdb-workbench-tests 4.0.0-TR20 → 4.0.0-TR21

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.
@@ -122,7 +122,7 @@ describe('Attach remote location', () => {
122
122
  RepositorySteps.getSparqlOntopicTable().should('not.exist');
123
123
  });
124
124
 
125
- it('should be able to create a remote location with encrypted password', () => {
125
+ it('should create a remote location with basic auth without an encrypt password flag', () => {
126
126
  // Given I have a running GDB instance and I am on the Repositories view
127
127
  RepositorySteps.visit();
128
128
  // When I start the location creation
@@ -130,28 +130,20 @@ describe('Attach remote location', () => {
130
130
  AttachRepositorySteps.enterURL(remoteLocationName);
131
131
  // And I select basic auth type
132
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');
133
+ // Then I should not see an option to encrypt the password
134
+ AttachRepositorySteps.getEncryptPasswordCheckbox().should('not.exist');
143
135
  // When I fill in username and password
144
136
  AttachRepositorySteps.enterUsername('locationadmin');
145
137
  AttachRepositorySteps.enterPassword('admin123');
146
138
  // And I save the location
147
139
  RemoteLocationStubs.spyRemoteLocationCreate();
148
140
  AttachRepositorySteps.attachRemoteLocation();
149
- // Then encrypt password flag should be sent
141
+ // Then the encrypt password flag should not be sent
150
142
  cy.wait('@add-remote-location')
151
143
  .its('request.body')
152
- .should('include', {
153
- encryptPassword: true,
154
- username: 'locationadmin'
144
+ .should((body) => {
145
+ expect(body).to.include({username: 'locationadmin'});
146
+ expect(body).not.to.have.property('encryptPassword');
155
147
  });
156
148
  });
157
149
 
@@ -0,0 +1,178 @@
1
+ import HomeSteps from '../../steps/home-steps.js';
2
+ import {RepositorySteps} from '../../steps/repository-steps.js';
3
+ import {RepositorySelectorSteps} from '../../steps/repository-selector-steps.js';
4
+ import {RepositoryPickerListSteps} from '../../steps/repository-picker-list-steps.js';
5
+ import {GraphNavigatorSteps} from '../../steps/graph-navigator-steps.js';
6
+ import {ModalDialogSteps} from '../../steps/modal-dialog-steps.js';
7
+ import ImportSteps from '../../steps/import/import-steps.js';
8
+ import {RepositoryErrorsWidgetSteps} from '../../steps/widgets/repository-errors-widget-steps.js';
9
+
10
+ const DEPRECATION_MESSAGE = 'FedX will be removed in GraphDB 13. Migrate to SPARQL 1.1 federation.';
11
+ const TOOLTIP_DEPRECATION_MESSAGE = 'FedX repositories are deprecated: Will be removed in GraphDB 13. Migrate to SPARQL 1.1 federation.';
12
+
13
+ describe('FedX deprecation', () => {
14
+ let repositoryId;
15
+ let fedxRepositoryId;
16
+
17
+ beforeEach(() => {
18
+ repositoryId = 'fedx-deprecation-member-' + Date.now();
19
+ fedxRepositoryId = 'fedx-deprecation-' + Date.now();
20
+ cy.createRepository({id: repositoryId});
21
+ cy.createRepository({
22
+ id: fedxRepositoryId,
23
+ type: 'fedx',
24
+ params: {
25
+ member: {
26
+ name: 'member',
27
+ label: 'FedX repo members',
28
+ value: [{store: 'ResolvableRepository', repositoryName: repositoryId, respectRights: 'true', writable: 'false'}],
29
+ },
30
+ },
31
+ });
32
+ });
33
+
34
+ afterEach(() => {
35
+ cy.deleteRepository(fedxRepositoryId);
36
+ cy.deleteRepository(repositoryId);
37
+ });
38
+
39
+ it('should mark FedX repositories as deprecated in the repositories list', () => {
40
+ // When I open the repositories list
41
+ RepositorySteps.visit();
42
+
43
+ // Then only the FedX repository is marked as deprecated
44
+ RepositorySteps.getRepositoryFedxDeprecatedTag(fedxRepositoryId).should('be.visible').and('have.text', 'Deprecated');
45
+ RepositorySteps.getRepositoryFedxDeprecatedTag(repositoryId).should('not.exist');
46
+ });
47
+
48
+ it('should show the deprecation message in the tooltip of a FedX repository in the repositories list', () => {
49
+ // Given I open the repositories list
50
+ RepositorySteps.visit();
51
+
52
+ // When I hover the FedX repository
53
+ RepositorySteps.hoverRepositoryInList(fedxRepositoryId);
54
+
55
+ // Then its tooltip shows the deprecation message
56
+ RepositorySteps.getRepositoryPopoverDeprecationMessage().should('be.visible').and('contain.text', TOOLTIP_DEPRECATION_MESSAGE);
57
+ });
58
+
59
+ it('should mark FedX repositories as deprecated in the repository selector', () => {
60
+ // Given I open the repository selector
61
+ HomeSteps.visit();
62
+ RepositorySelectorSteps.openRepositorySelectors();
63
+
64
+ // Then only the FedX repository is marked as deprecated
65
+ RepositorySelectorSteps.getRepositoryFedxDeprecatedTag(fedxRepositoryId).should('be.visible').and('have.text', 'Deprecated');
66
+ RepositorySelectorSteps.getRepositoryFedxDeprecatedTag(repositoryId).should('not.exist');
67
+ });
68
+
69
+ it('should show the deprecation message in the tooltip of a FedX repository in the repository selector', () => {
70
+ // Given I open the repository selector
71
+ HomeSteps.visit();
72
+ RepositorySelectorSteps.openRepositorySelectors();
73
+
74
+ // When I hover the FedX repository
75
+ RepositorySelectorSteps.hoverRepositoryItem(fedxRepositoryId);
76
+
77
+ // Then its tooltip shows the deprecation message
78
+ RepositorySelectorSteps.getRepositoryTooltipPart('deprecation').should('contain.text', TOOLTIP_DEPRECATION_MESSAGE);
79
+ });
80
+
81
+ it('should mark FedX repositories as deprecated in the repository picker', () => {
82
+ // Given no repository is selected, so the view shows the repository picker
83
+ GraphNavigatorSteps.visit();
84
+
85
+ // Then only the FedX repository is marked as deprecated
86
+ RepositoryPickerListSteps.getRepositoryFedxDeprecatedTag(fedxRepositoryId).should('be.visible').and('have.text', 'Deprecated');
87
+ RepositoryPickerListSteps.getRepositoryFedxDeprecatedTag(repositoryId).should('not.exist');
88
+ });
89
+
90
+ it('should show the deprecation message in the information of a FedX repository in the repository picker', () => {
91
+ // Given no repository is selected, so the view shows the repository picker
92
+ GraphNavigatorSteps.visit();
93
+
94
+ // When I move the keyboard focus to the FedX repository
95
+ RepositoryPickerListSteps.focusRepository(fedxRepositoryId);
96
+
97
+ // Then its information shows the deprecation message and a link to the migration documentation
98
+ RepositoryPickerListSteps.getRepositoryInfoPart('deprecation').should('contain.text', TOOLTIP_DEPRECATION_MESSAGE);
99
+ RepositoryPickerListSteps.getRepositoryInfoPart('fedx-migration-link').should('have.text', 'Learn more')
100
+ .and('have.attr', 'href').and('match', /\/sparql-federation\.html$/);
101
+ });
102
+
103
+ it('should mark FedX repositories as deprecated in the Import repository list', () => {
104
+ // When I open the Import view with no repository selected
105
+ ImportSteps.visit();
106
+
107
+ // Then only the FedX repository is marked as deprecated
108
+ RepositoryErrorsWidgetSteps.getRepositoryFedxDeprecatedTag(fedxRepositoryId).should('be.visible').and('have.text', 'Deprecated');
109
+ RepositoryErrorsWidgetSteps.getRepositoryFedxDeprecatedTag(repositoryId).should('not.exist');
110
+ });
111
+
112
+ it('should mark the FedX repository type as deprecated', () => {
113
+ // When I open the repository type chooser
114
+ RepositorySteps.visit();
115
+ RepositorySteps.createRepository();
116
+
117
+ // Then only the FedX type shows the deprecation message
118
+ RepositorySteps.getRepositoryTypeFedxDeprecationMessage('fedx').should('be.visible').and('have.text', 'Deprecated: Will be removed in GraphDB 13.');
119
+ RepositorySteps.getRepositoryTypeFedxDeprecationMessage('gdb').should('not.exist');
120
+ RepositorySteps.getRepositoryTypeFedxDeprecationMessage('ontop').should('not.exist');
121
+ });
122
+
123
+ it('should stay on the repository type chooser when the FedX creation is cancelled', () => {
124
+ // Given I open the repository type chooser
125
+ RepositorySteps.visit();
126
+ RepositorySteps.createRepository();
127
+
128
+ // When I choose the FedX type
129
+ RepositorySteps.chooseRepositoryType('fedx');
130
+
131
+ // Then a dialog asks me to confirm the creation of a deprecated repository
132
+ ModalDialogSteps.verifyDialogBody(DEPRECATION_MESSAGE);
133
+ ModalDialogSteps.verifyDialogBody('Create a FedX repository anyway?');
134
+ RepositorySteps.getFedxDeprecationDialogMigrationLink().should('have.text', 'Learn more in the GraphDB documentation')
135
+ .and('have.attr', 'href').and('match', /\/sparql-federation\.html$/);
136
+ ModalDialogSteps.getDialogBody().should('not.contain.text', '<br>');
137
+
138
+ // When I cancel
139
+ ModalDialogSteps.clickOnCancelButton();
140
+
141
+ // Then I stay on the repository type chooser
142
+ ModalDialogSteps.getDialog().should('not.exist');
143
+ cy.url().should('match', /\/repository\/create$/);
144
+ });
145
+
146
+ it('should show the deprecation warning when a FedX repository is created', () => {
147
+ // Given I open the repository type chooser
148
+ RepositorySteps.visit();
149
+ RepositorySteps.createRepository();
150
+
151
+ // When I choose the FedX type and confirm
152
+ RepositorySteps.chooseRepositoryType('fedx');
153
+ ModalDialogSteps.clickOnConfirmButton();
154
+
155
+ // Then the FedX create page shows the deprecation warning with a link to the migration guide
156
+ cy.url().should('include', '/repository/create/fedx');
157
+ RepositorySteps.getFedxDeprecationWarning().should('be.visible').and('contain.text', DEPRECATION_MESSAGE);
158
+ RepositorySteps.getFedxMigrationLink().should('have.attr', 'href').and('match', /\/sparql-federation\.html$/);
159
+ });
160
+
161
+ it('should show the deprecation warning when a FedX repository is edited', () => {
162
+ // When I edit the FedX repository
163
+ RepositorySteps.visitEditPage(fedxRepositoryId);
164
+
165
+ // Then the edit page shows the deprecation warning with a link to the migration guide
166
+ RepositorySteps.getFedxDeprecationWarning().should('be.visible').and('contain.text', DEPRECATION_MESSAGE);
167
+ RepositorySteps.getFedxMigrationLink().should('have.attr', 'href').and('match', /\/sparql-federation\.html$/);
168
+ });
169
+
170
+ it('should not show the deprecation warning when another repository is edited', () => {
171
+ // When I edit a GraphDB repository
172
+ RepositorySteps.visitEditPage(repositoryId);
173
+
174
+ // Then the edit page shows no deprecation warning
175
+ RepositorySteps.getRepositoryPage().should('be.visible');
176
+ RepositorySteps.getFedxDeprecationWarning().should('not.exist');
177
+ });
178
+ });
@@ -19,6 +19,8 @@ describe('License on logout', () => {
19
19
  cy.wait('@get-license');
20
20
  MainMenuSteps.clickOnMenuImport();
21
21
  ImportSteps.getView().should('be.visible');
22
+ // And the legacy workbench has loaded the license
23
+ cy.wait('@get-license');
22
24
  // And the license is not accessible without a session
23
25
  LicenseStubs.stubLicenseUnauthorized();
24
26
 
@@ -26,7 +28,7 @@ describe('License on logout', () => {
26
28
  LoginSteps.logout();
27
29
  LoginSteps.getLoginPage().should('be.visible');
28
30
  // And I log in again, which proves that the logout has been fully processed
29
- LicenseStubs.spyGetLicense();
31
+ LicenseStubs.spyGetLicenseFromServer();
30
32
  LoginSteps.loginWithUser('admin', 'root');
31
33
  cy.wait('@get-license');
32
34
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "4.0.0-TR20",
3
+ "version": "4.0.0-TR21",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "graphdb-workbench-tests",
9
- "version": "4.0.0-TR20",
9
+ "version": "4.0.0-TR21",
10
10
  "license": "Apache-2.0",
11
11
  "devDependencies": {
12
12
  "@bahmutov/cypress-code-coverage": "^2.7.2",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "4.0.0-TR20",
3
+ "version": "4.0.0-TR21",
4
4
  "description": "Cypress tests for GraphDB workbench",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -120,15 +120,7 @@ export class AttachRepositorySteps {
120
120
  AttachRepositorySteps.getPasswordInput().clear();
121
121
  }
122
122
 
123
- static getUnencryptedPasswordWarning() {
124
- return this.getRemoteLocationSettingsForm().find('.unencrypted-password-warning');
125
- }
126
-
127
- static getBackwardCompatibilityWarning() {
128
- return this.getRemoteLocationSettingsForm().find('.backward-compatibility-warning');
129
- }
130
-
131
- static encryptPassword() {
132
- this.getRemoteLocationSettingsForm().find('#encryptPassword').check();
123
+ static getEncryptPasswordCheckbox() {
124
+ return this.getRemoteLocationSettingsForm().find('#encryptPassword');
133
125
  }
134
126
  }
@@ -24,6 +24,10 @@ export class RepositoryPickerListSteps extends BaseSteps {
24
24
  return this.getRepositoryRow(repositoryId).find(this.buildTestIdAttr('repository-picker-repository-location'));
25
25
  }
26
26
 
27
+ static getRepositoryFedxDeprecatedTag(repositoryId) {
28
+ return this.getRepositoryRow(repositoryId).find(this.buildTestIdAttr('repository-picker-fedx-deprecated-tag'));
29
+ }
30
+
27
31
  static getSelectRepositoryButton(repositoryId) {
28
32
  return this.getRepositoryRow(repositoryId).find(this.buildTestIdAttr('repository-picker-select-btn'));
29
33
  }
@@ -32,6 +32,10 @@ export class RepositorySelectorSteps {
32
32
  RepositorySelectorSteps.getRepositoryItem(repositoryId).realHover();
33
33
  }
34
34
 
35
+ static getRepositoryFedxDeprecatedTag(repositoryId) {
36
+ return RepositorySelectorSteps.getRepositoryItem(repositoryId).getByTestId('repository-selector-fedx-deprecated-tag');
37
+ }
38
+
35
39
  static getRepositoryTooltip() {
36
40
  return cy.get('.onto-tooltip-box onto-repository-info');
37
41
  }
@@ -1,5 +1,6 @@
1
1
  import {REPOSITORIES_URL} from "../support/repository-commands";
2
2
  import {BaseSteps} from "./base-steps.js";
3
+ import {ModalDialogSteps} from "./modal-dialog-steps.js";
3
4
 
4
5
  export class RepositorySteps extends BaseSteps {
5
6
 
@@ -190,6 +191,40 @@ export class RepositorySteps extends BaseSteps {
190
191
 
191
192
  static createFedexRepositoryType() {
192
193
  RepositorySteps.chooseRepositoryType('fedx');
194
+ // FedX is deprecated, so its creation is confirmed in a dialog.
195
+ RepositorySteps.confirmModal();
196
+ }
197
+
198
+ static getRepositoryTypeFedxDeprecationMessage(type) {
199
+ return RepositorySteps.getRepositoryTypeButton(type).find(RepositorySteps.buildTestIdAttr('repository-type-fedx-deprecation-message'));
200
+ }
201
+
202
+ static getRepositoryFedxDeprecatedTag(repositoryId) {
203
+ return RepositorySteps.getRepositoryFromList(repositoryId).find(RepositorySteps.buildTestIdAttr('repository-fedx-deprecated-tag'));
204
+ }
205
+
206
+ static hoverRepositoryInList(repositoryId) {
207
+ // "mouseover" sets the repository of the popover, "mouseenter" opens it.
208
+ RepositorySteps.getRepositoryFromList(repositoryId).find(RepositorySteps.buildTestIdAttr('repository-popover-trigger'))
209
+ .trigger('mouseover')
210
+ .trigger('mouseenter');
211
+ }
212
+
213
+ static getRepositoryPopoverDeprecationMessage() {
214
+ return RepositorySteps.getByTestId('repository-info-popover').find(RepositorySteps.buildTestIdAttr('repository-deprecation-message'));
215
+ }
216
+
217
+ static getFedxDeprecationWarning() {
218
+ return RepositorySteps.getByTestId('repository-fedx-deprecation-warning');
219
+ }
220
+
221
+ static getFedxMigrationLink() {
222
+ return RepositorySteps.getByTestId('repository-fedx-migration-link');
223
+ }
224
+
225
+ static getFedxDeprecationDialogMigrationLink() {
226
+ // The link comes from a translation rendered as HTML, which cannot keep a data-test attribute.
227
+ return ModalDialogSteps.getDialogBody().find('a');
193
228
  }
194
229
 
195
230
  static getGDBRepositoryTypeButton() {
@@ -22,4 +22,13 @@ export class RepositoryErrorsWidgetSteps {
22
22
  static getRepositoryList() {
23
23
  return RepositoryErrorsWidgetSteps.getWidget().find('.repos .repository');
24
24
  }
25
+
26
+ static getRepositoryFedxDeprecatedTag(repositoryId) {
27
+ return RepositoryErrorsWidgetSteps.getWidget()
28
+ .getByTestId('core-errors-repository-id')
29
+ .contains(repositoryId)
30
+ // There is no test id command for closest(), so the row is selected by its data-test attribute.
31
+ .closest('[data-test="core-errors-repository"]')
32
+ .getByTestId('core-errors-fedx-deprecated-tag');
33
+ }
25
34
  }
@@ -4,6 +4,13 @@ export class LicenseStubs {
4
4
  cy.intercept('GET', '/rest/graphdb-settings/license').as('get-license');
5
5
  }
6
6
 
7
+ /**
8
+ * Spies on the license request and sends it to the server, bypassing the license stubs defined before.
9
+ */
10
+ static spyGetLicenseFromServer() {
11
+ cy.intercept('GET', '/rest/graphdb-settings/license', (req) => req.continue()).as('get-license');
12
+ }
13
+
7
14
  static stubLicenseUnauthorized() {
8
15
  cy.intercept('GET', '/rest/graphdb-settings/license', {statusCode: 401}).as('unauthorizedLicense');
9
16
  }