graphdb-workbench-tests 4.0.0-TR13 → 4.0.0-TR14

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.
@@ -64,6 +64,18 @@ describe('Graph Navigator', () => {
64
64
  GraphNavigatorSteps.getElement(SEED_RESOURCE_LABEL).should('exist');
65
65
  });
66
66
 
67
+ it('should show an error toast, when a graph request fails', () => {
68
+ // Given the repository's SPARQL requests fail.
69
+ cy.intercept('POST', `/repositories/${repositoryId}`, {statusCode: 500}).as('graphRequest');
70
+
71
+ // When I open the Graph Navigator view with a start resource.
72
+ GraphNavigatorSteps.visit(SEED_RESOURCE_ENCODED);
73
+ cy.wait('@graphRequest');
74
+
75
+ // Then I expect an error toast about the graph data.
76
+ ToasterSteps.getToasterMessage().should('contain', 'Could not load the graph data.');
77
+ });
78
+
67
79
  it('should seed the canvas with the graph computed from a CONSTRUCT query', () => {
68
80
  // Given I open the Graph Navigator view with a CONSTRUCT query, as sent from the SPARQL editor.
69
81
  GraphNavigatorSteps.visitWithQuery(CONSTRUCT_QUERY);
@@ -287,7 +287,7 @@ describe('Ontop repositories', () => {
287
287
 
288
288
  // WHEN: I log in as a user with maintenance permission
289
289
  cy.loginAs(REPOSITORY_MAINTAINER_USERNAME, PASSWORD);
290
- RepositorySteps.visit(false);
290
+ RepositorySteps.visit();
291
291
 
292
292
  // THEN: The repository is visible because the user can maintain it
293
293
  RepositorySteps.getRepositoryFromList(repositoryId).should('exist');
@@ -312,7 +312,7 @@ describe('Ontop repositories', () => {
312
312
  ModalDialogSteps.clickOnConfirmButton();
313
313
 
314
314
  // THEN: The changes are persisted
315
- RepositorySteps.visit(false);
315
+ RepositorySteps.visit();
316
316
  RepositorySteps.getRepositoryFromList(repositoryId).should('exist');
317
317
  RepositorySteps.editRepository(repositoryId);
318
318
  cy.wait('@getJDBCProperties');
@@ -348,7 +348,7 @@ describe('Ontop repositories', () => {
348
348
  ModalDialogSteps.clickOnConfirmButton();
349
349
 
350
350
  // THEN: The OBDA file changes are persisted
351
- RepositorySteps.visit(false);
351
+ RepositorySteps.visit();
352
352
  RepositorySteps.getRepositoryFromList(repositoryId).should('exist');
353
353
  RepositorySteps.editRepository(repositoryId);
354
354
  cy.wait('@getJDBCProperties');
@@ -2,7 +2,7 @@ import {ConnectorsSteps} from "../../../steps/setup/connectors-steps";
2
2
  import HomeSteps from "../../../steps/home-steps";
3
3
  import {MainMenuSteps} from "../../../steps/main-menu-steps";
4
4
 
5
- const expectedButtons = ['elasticsearch', 'opensearch', 'solr', 'lucene', 'kafka', 'chatgpt-retrieval'];
5
+ const expectedButtons = ['elasticsearch', 'opensearch', 'lucene', 'kafka', 'chatgpt-retrieval'];
6
6
 
7
7
  function verifyConnectorsPage() {
8
8
  expectedButtons.forEach(buttonId => {
@@ -18,7 +18,7 @@ describe('User and Access', () => {
18
18
  const DEFAULT_ADMIN_PASSWORD = 'root';
19
19
 
20
20
  context('User and access management', () => {
21
- const user = 'user';
21
+ const user = 'user' + Date.now();
22
22
  let repoName;
23
23
 
24
24
  before(() => {
@@ -428,7 +428,7 @@ describe('User and Access', () => {
428
428
  let repositoryId1;
429
429
  let repositoryId2;
430
430
  let repositoryId3;
431
- const graphqlUser = 'graphqlUser';
431
+ const graphqlUser = 'graphqlUser' + Date.now();
432
432
 
433
433
  beforeEach(() => {
434
434
  RepositoriesStubs.spyGetRepositories();
@@ -649,7 +649,7 @@ describe('User and Access', () => {
649
649
  let writeRepositoryId;
650
650
  let graphQLOnlyRepositoryId;
651
651
  let maintainedRepositoryId;
652
- const maintainerUser = 'maintainerUser';
652
+ const maintainerUser = 'maintainerUser' + Date.now();
653
653
 
654
654
  beforeEach(() => {
655
655
  RepositoriesStubs.spyGetRepositories();
@@ -705,7 +705,7 @@ describe('User and Access', () => {
705
705
  // Wait for the login to complete, otherwise visiting another page aborts it.
706
706
  cy.url().should('not.include', '/login');
707
707
  // And navigate to the repository list view.
708
- RepositorySteps.visit(false);
708
+ RepositorySteps.visit();
709
709
 
710
710
  // Then I should see all repositories for which the user has at least read permission.
711
711
  RepositorySteps.getRepositories().should('have.length', 4);
@@ -766,7 +766,7 @@ describe('User and Access', () => {
766
766
  LoginSteps.loginWithUser(maintainerUser, PASSWORD);
767
767
  // Wait for the login to complete, otherwise visiting another page aborts it.
768
768
  cy.url().should('not.include', '/login');
769
- RepositorySteps.visit(false);
769
+ RepositorySteps.visit();
770
770
 
771
771
  // When the user opens the edit page of the repository they can maintain.
772
772
  RepositorySteps.getEditRepositoryButton(maintainedRepositoryId).should('be.visible');
@@ -230,7 +230,7 @@ describe('TTYG chat list', () => {
230
230
  HomeSteps.visit();
231
231
  cy.wait('@get-chat');
232
232
  // and came back to the ttyg page
233
- TTYGViewSteps.visit(false);
233
+ TTYGViewSteps.visit();
234
234
 
235
235
  // Then I expect to last used chat be selected.
236
236
  TTYGViewSteps.getChatFromGroup(0, 2).should('have.class', 'selected');
@@ -61,7 +61,7 @@ describe('TTYG create chat', () => {
61
61
  // and returns to the TTYG page
62
62
  TTYGStubs.stubChatsListGet("/ttyg/chats/create/get-chats-after-create.json");
63
63
  TTYGStubs.stubAgentGet();
64
- TTYGViewSteps.visit(false);
64
+ TTYGViewSteps.visit();
65
65
  cy.wait('@get-chat-list');
66
66
  // Then I expect newly created chat be selected.
67
67
  TTYGViewSteps.getChatFromGroup(0, 0).should('contain', 'New chat of Han Solo is a character');
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "Elasticsearch": "http://www.ontotext.com/connectors/elasticsearch#",
3
3
  "OpenSearch": "http://www.ontotext.com/connectors/opensearch#",
4
- "Solr": "http://www.ontotext.com/connectors/solr#",
5
4
  "Lucene": "http://www.ontotext.com/connectors/lucene#",
6
5
  "Kafka": "http://www.ontotext.com/connectors/kafka#",
7
6
  "ChatGPT Retrieval": "http://www.ontotext.com/connectors/retrieval#"
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "4.0.0-TR13",
3
+ "version": "4.0.0-TR14",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "graphdb-workbench-tests",
9
- "version": "4.0.0-TR13",
9
+ "version": "4.0.0-TR14",
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-TR13",
3
+ "version": "4.0.0-TR14",
4
4
  "description": "Cypress tests for GraphDB workbench",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -3,17 +3,14 @@ import {BaseSteps} from "./base-steps.js";
3
3
 
4
4
  export class RepositorySteps extends BaseSteps {
5
5
 
6
- static visit(waitPageLoaded = true) {
6
+ static visit() {
7
7
  cy.intercept('/rest/locations').as('getLocations');
8
8
  cy.intercept(REPOSITORIES_URL + '/all').as('getRepositories');
9
9
  cy.visit('/repository');
10
- if (waitPageLoaded) {
11
- RepositorySteps.waitLoader();
12
- }
10
+ RepositorySteps.waitUntilRepositoriesPageIsLoaded();
11
+ // Consumes the initial locations request, so a later cy.wait('@getLocations') in a test matches the next one.
12
+ // It must stay after the page-loaded check, which has a longer timeout than cy.wait for the request to start.
13
13
  cy.wait('@getLocations');
14
- if (waitPageLoaded) {
15
- RepositorySteps.waitUntilRepositoriesPageIsLoaded();
16
- }
17
14
  }
18
15
 
19
16
  static visitEditPage(repositoryId) {
@@ -36,9 +33,12 @@ export class RepositorySteps extends BaseSteps {
36
33
  return cy.get('#wb-repositories-addRepositoryLink');
37
34
  }
38
35
 
36
+ // The page loader is hidden once the locations are loaded, regardless of the user's role.
39
37
  static waitUntilRepositoriesPageIsLoaded() {
40
- RepositorySteps.getRepositoriesDropdown().should('not.be.disabled');
41
- RepositorySteps.getCreateRepositoryButton().should('be.visible').and('not.be.disabled');
38
+ RepositorySteps.getRepositoriesPage()
39
+ .should('be.visible')
40
+ .find('.ot-loader-new-content')
41
+ .should('not.be.visible');
42
42
  }
43
43
 
44
44
  static getRepositoriesDropdown() {
@@ -1,21 +1,8 @@
1
1
  import {BaseSteps} from "../base-steps";
2
- import {DeprecationSteps} from '../deprecation-banner/deprecation-banner-steps.js';
3
2
 
4
3
  export class TTYGViewSteps extends BaseSteps {
5
- /**
6
- * Visits the TTYG page and closes the Solr deprecation banner by default.
7
- *
8
- * @param {boolean} closeSolrBanner Whether to close the banner. Set to `false`
9
- * when revisiting the page after the banner has already been closed.
10
- */
11
- static visit(closeSolrBanner = true) {
4
+ static visit() {
12
5
  cy.visit('/ttyg');
13
- // Temporary workaround until the Solr deprecation banner is removed.
14
- // The banner changes the page layout, causing tests to fail randomly.
15
- // This quick fix prevents GraphDB build failures and should be deleted together with the banner.
16
- if (closeSolrBanner) {
17
- DeprecationSteps.closeBanner();
18
- }
19
6
  }
20
7
 
21
8
  static getTtygView() {
@@ -50,7 +50,6 @@ export class LicenseStubs {
50
50
  "productType": "enterprise",
51
51
  "licenseCapabilities": [
52
52
  "Lucene connector",
53
- "Solr connector",
54
53
  "Elasticsearch connector",
55
54
  "OpenSearch connector",
56
55
  "Kafka connector",
@@ -114,7 +113,6 @@ export class LicenseStubs {
114
113
  "OpenSearch connector",
115
114
  "Lucene connector",
116
115
  "Kafka connector",
117
- "Solr connector",
118
116
  "Cluster",
119
117
  "Elasticsearch connector"
120
118
  ],
@@ -140,7 +138,6 @@ export class LicenseStubs {
140
138
  "OpenSearch connector",
141
139
  "Lucene connector",
142
140
  "Kafka connector",
143
- "Solr connector",
144
141
  "Cluster",
145
142
  "Elasticsearch connector"
146
143
  ],
@@ -1,137 +0,0 @@
1
- import HomeSteps from '../../../steps/home-steps.js';
2
- import {DeprecationSteps} from '../../../steps/deprecation-steps.js';
3
- import {LoginSteps} from '../../../steps/login-steps.js';
4
- import {GuidesStubs} from '../../../stubs/guides/guides-stubs.js';
5
- import {GuideSteps} from '../../../steps/guides/guide-steps.js';
6
- import {GuideDialogSteps} from '../../../steps/guides/guide-dialog-steps.js';
7
-
8
- describe('Solr deprecation banner', () => {
9
- context('Security disabled', () => {
10
- it('should keep the Solr deprecation banner hidden after the anonymous user dismisses it', () => {
11
- // GIVEN: I have opened the application with security disabled.
12
- HomeSteps.visit();
13
-
14
- // THEN: I expect the Solr deprecation banner to be visible.
15
- DeprecationSteps.getDeprecationBanner()
16
- .should('be.visible')
17
- .should('contain.text', 'The Solr connector is deprecated and will be removed in GraphDB 12');
18
-
19
- // WHEN: I dismiss the Solr deprecation banner.
20
- DeprecationSteps.closeBanner();
21
- // THEN: I expect the Solr deprecation banner to be hidden.
22
- DeprecationSteps.getDeprecationBanner().should('not.exist');
23
-
24
- // WHEN: I reload the application.
25
- HomeSteps.visit();
26
- // THEN: I expect the Solr deprecation banner to remain hidden.
27
- DeprecationSteps.getDeprecationBanner().should('not.exist');
28
- });
29
- });
30
-
31
- context('Security enabled', () => {
32
- const PASSWORD = 'root';
33
- const USER_USERNAME = 'username';
34
-
35
- beforeEach(() => {
36
- cy.createUser({
37
- username: USER_USERNAME,
38
- password: PASSWORD
39
- });
40
-
41
- cy.switchOnSecurity()
42
- .then(() => cy.loginAsAdmin())
43
- .then(() => cy.switchOnFreeAccess(true));
44
- });
45
-
46
- afterEach(() => {
47
- cy.loginAsAdmin()
48
- .then(() => {
49
- cy.deleteUser(USER_USERNAME, true);
50
- cy.switchOffFreeAccess(true);
51
- cy.switchOffSecurity(true);
52
- });
53
- });
54
-
55
- it('should persist separate Solr banner states for anonymous and logged-in users', () => {
56
- // GIVEN: Security and free access are enabled, and no user is logged in.
57
- HomeSteps.visit();
58
-
59
- // THEN: I expect the Solr deprecation banner to be visible for the anonymous user.
60
- DeprecationSteps.getDeprecationBanner()
61
- .should('be.visible')
62
- .should('contain.text', 'The Solr connector is deprecated and will be removed in GraphDB 12');
63
-
64
- // WHEN: The anonymous user dismisses the banner.
65
- DeprecationSteps.closeBanner();
66
- // THEN: I expect the banner to be hidden for the anonymous user.
67
- DeprecationSteps.getDeprecationBanner().should('not.exist');
68
-
69
- // WHEN: I log in as a user who has not dismissed the banner.
70
- cy.loginAs(USER_USERNAME, PASSWORD);
71
- HomeSteps.visit();
72
-
73
- // THEN: I expect the banner to be visible for the logged-in user.
74
- DeprecationSteps.getDeprecationBanner()
75
- .should('be.visible')
76
- .should('contain.text', 'The Solr connector is deprecated and will be removed in GraphDB 12');
77
-
78
- // WHEN: The logged-in user dismisses the banner.
79
- DeprecationSteps.closeBanner();
80
- // THEN: I expect the banner to be hidden for the logged-in user.
81
- DeprecationSteps.getDeprecationBanner().should('not.exist');
82
-
83
- // WHEN: The user logs out.
84
- LoginSteps.logout();
85
- // THEN: I expect the banner to remain hidden because the anonymous user has already dismissed it.
86
- DeprecationSteps.getDeprecationBanner().should('not.exist');
87
-
88
- // WHEN: I log in as the administrator, who has not dismissed the banner.
89
- cy.loginAs('admin', 'root');
90
- HomeSteps.visit();
91
- // THEN: I expect the banner to be visible for the administrator.
92
- DeprecationSteps.getDeprecationBanner()
93
- .should('be.visible')
94
- .should('contain.text', 'The Solr connector is deprecated and will be removed in GraphDB 12');
95
-
96
- // WHEN: The administrator logs out.
97
- LoginSteps.logout();
98
- // THEN: I expect the banner to remain hidden because the anonymous user has already dismissed it.
99
- DeprecationSteps.getDeprecationBanner().should('not.exist');
100
-
101
- // WHEN: I log in again as the user who previously dismissed the banner.
102
- cy.loginAs(USER_USERNAME, PASSWORD);
103
- HomeSteps.visit();
104
- // THEN: I expect the banner to remain hidden for the logged-in user.
105
- DeprecationSteps.getDeprecationBanner().should('not.exist');
106
- });
107
- });
108
-
109
- context('User guides', () => {
110
- it('should hide the Solr deprecation banner while a guide is running', () => {
111
- // GIVEN: The guides are loaded and ready to be started.
112
- GuidesStubs.stubMainMenuGuide();
113
- GuideSteps.visit();
114
- GuideSteps.verifyGuidesListExists();
115
- cy.wait('@getGuides');
116
-
117
- // WHEN: I am on an application page, and the Solr deprecation banner has not been dismissed by the current user.
118
- // THEN: I expect the Solr deprecation banner to be visible because it has not been dismissed by the current user.
119
- DeprecationSteps.getDeprecationBanner()
120
- .should('be.visible')
121
- .should('contain.text', 'The Solr connector is deprecated and will be removed in GraphDB 12');
122
-
123
- // WHEN: I start a guide.
124
- GuideSteps.runFirstGuide();
125
- // THEN: I expect the Solr deprecation banner to be hidden while the guide is running.
126
- DeprecationSteps.getDeprecationBanner().should('not.exist');
127
-
128
- // WHEN: I cancel the guide.
129
- GuideDialogSteps.clickOnCancelButton();
130
- GuideDialogSteps.clickConfirmCancelDialogExitButton();
131
- // THEN: I expect the Solr deprecation banner to be visible again.
132
- DeprecationSteps.getDeprecationBanner()
133
- .should('be.visible')
134
- .should('contain.text', 'The Solr connector is deprecated and will be removed in GraphDB 12');
135
- });
136
- });
137
- });
@@ -1,13 +0,0 @@
1
- export class DeprecationSteps {
2
- static getDeprecationBanner() {
3
- return cy.get('onto-deprecation-banner');
4
- }
5
-
6
- static getCloseButton() {
7
- return DeprecationSteps.getDeprecationBanner().find('.close-button');
8
- }
9
-
10
- static closeBanner() {
11
- DeprecationSteps.getCloseButton().click();
12
- }
13
- }
@@ -1,13 +0,0 @@
1
- export class DeprecationSteps {
2
- static getDeprecationBanner() {
3
- return cy.get('onto-deprecation-banner');
4
- }
5
-
6
- static getCloseButton() {
7
- return DeprecationSteps.getDeprecationBanner().find('.close-button');
8
- }
9
-
10
- static closeBanner() {
11
- DeprecationSteps.getCloseButton().click();
12
- }
13
- }