graphdb-workbench-tests 3.4.0-TR8 → 3.4.0-TR9

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.
@@ -0,0 +1,49 @@
1
+ import {RepositoriesStubs} from '../../stubs/repositories/repositories-stubs.js';
2
+ import {GraphqlEndpointManagementSteps} from '../../steps/graphql/graphql-endpoint-management-steps.js';
3
+ import {NamespaceStubs} from '../../stubs/namespace-stubs.js';
4
+ import {CreateGraphqlEndpointSteps} from '../../steps/graphql/create-graphql-endpoint-steps.js';
5
+ import {GraphqlPlaygroundSteps} from '../../steps/graphql/graphql-playground-steps.js';
6
+
7
+ describe('Graphql: Remote Location', () => {
8
+ const REMOTE_REPOSITORY_ID = 'configurations';
9
+ const REMOTE_REPOSITORY_LOCATION = 'http://localhost:7202';
10
+
11
+ beforeEach(() => {
12
+ RepositoriesStubs.stubRepositories();
13
+ NamespaceStubs.stubGeneratedOntotextNamespacesResponse(REMOTE_REPOSITORY_ID);
14
+ cy.presetRepository(REMOTE_REPOSITORY_ID, REMOTE_REPOSITORY_LOCATION);
15
+ });
16
+
17
+ it('should inform users that GraphQL endpoints are not accessible when the selected repository is in a remote location', () => {
18
+ // GIVEN: The workbench is set up with a repository located in a remote location.
19
+
20
+ // WHEN: I visit the GraphQL endpoint management page.
21
+ GraphqlEndpointManagementSteps.visit();
22
+ // THEN: I expect the page content not to be visible.
23
+ GraphqlEndpointManagementSteps.getPageContainer().should('not.exist');
24
+ // AND: An info message is displayed to inform users to switch to a repository from the current location.
25
+ GraphqlEndpointManagementSteps.getRepositoryInRemoteLocation().should('contain.text', 'The selected repository is in a remote location, and its endpoints aren’t accessible here. Select a repository from the current location.');
26
+ });
27
+
28
+ it('should inform users that they cannot create a GraphQL endpoint when the selected repository is in a remote location', () => {
29
+ // GIVEN: The workbench is set up with a repository located in a remote location.
30
+
31
+ // WHEN: I visit the create GraphQL endpoint page.
32
+ CreateGraphqlEndpointSteps.visit();
33
+ // THEN: I expect the page content not to be visible.
34
+ CreateGraphqlEndpointSteps.getPageContainer().should('not.exist');
35
+ // AND: An info message is displayed to inform users to switch to a local repository.
36
+ CreateGraphqlEndpointSteps.getRepositoryInRemoteLocation().should('contain.text', 'Endpoints can only be created for repositories in the current location. Select a local repository to continue.');
37
+ });
38
+
39
+ it('should inform users that the GraphQL Playground is available only for local repositories', () => {
40
+ // GIVEN: The workbench is set up with a repository located in a remote location.
41
+
42
+ // WHEN: I visit the GraphQL Playground page.
43
+ GraphqlPlaygroundSteps.visit();
44
+ // THEN: I expect the page content not to be visible.
45
+ GraphqlPlaygroundSteps.getPageContainer().should('not.exist');
46
+ // AND: An info message is displayed to inform users to switch to a local repository.
47
+ GraphqlPlaygroundSteps.getRepositoryInRemoteLocation().should('contain.text', 'The active repository is in a remote location. Playground is only available for repositories in the current location.');
48
+ });
49
+ });
@@ -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,12 +1,12 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "3.4.0-TR8",
3
+ "version": "3.4.0-TR9",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "graphdb-workbench-tests",
9
- "version": "3.4.0-TR8",
9
+ "version": "3.4.0-TR9",
10
10
  "license": "Apache-2.0",
11
11
  "devDependencies": {
12
12
  "@bahmutov/cypress-code-coverage": "^2.7.2",
@@ -7606,9 +7606,9 @@
7606
7606
  }
7607
7607
  },
7608
7608
  "node_modules/mocha/node_modules/brace-expansion": {
7609
- "version": "5.0.5",
7610
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.5.tgz",
7611
- "integrity": "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==",
7609
+ "version": "5.0.6",
7610
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz",
7611
+ "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==",
7612
7612
  "dev": true,
7613
7613
  "license": "MIT",
7614
7614
  "peer": true,
@@ -8921,9 +8921,9 @@
8921
8921
  }
8922
8922
  },
8923
8923
  "node_modules/rimraf/node_modules/brace-expansion": {
8924
- "version": "5.0.5",
8925
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.5.tgz",
8926
- "integrity": "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==",
8924
+ "version": "5.0.6",
8925
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz",
8926
+ "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==",
8927
8927
  "dev": true,
8928
8928
  "license": "MIT",
8929
8929
  "dependencies": {
@@ -9794,9 +9794,9 @@
9794
9794
  }
9795
9795
  },
9796
9796
  "node_modules/systeminformation": {
9797
- "version": "5.31.1",
9798
- "resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.31.1.tgz",
9799
- "integrity": "sha512-6pRwxoGeV/roJYpsfcP6tN9mep6pPeCtXbUOCdVa0nme05Brwcwdge/fVNhIZn2wuUitAKZm4IYa7QjnRIa9zA==",
9797
+ "version": "5.31.6",
9798
+ "resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.31.6.tgz",
9799
+ "integrity": "sha512-Uv2b2uGGM6ns+26czgW2cYRabYdnswM0ddSOOlryHOaelzsmDSet1iM/NT7VOYxW8x/BW+HkY+b1Ve2pLTSGSA==",
9800
9800
  "dev": true,
9801
9801
  "license": "MIT",
9802
9802
  "os": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "3.4.0-TR8",
3
+ "version": "3.4.0-TR9",
4
4
  "description": "Cypress tests for GraphDB workbench",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -7,6 +7,14 @@ export class CreateGraphqlEndpointSteps {
7
7
  return cy.get('.create-graphql-endpoint-view');
8
8
  }
9
9
 
10
+ static getPageContainer() {
11
+ return CreateGraphqlEndpointSteps.getView().find('.content');
12
+ }
13
+
14
+ static getRepositoryInRemoteLocation() {
15
+ return CreateGraphqlEndpointSteps.getView().find('.unexpected-remote-repository-warning');
16
+ }
17
+
10
18
  static getSourceRepositorySelector() {
11
19
  return this.getView().find('.source-repository-selector');
12
20
  }
@@ -10,6 +10,14 @@ export class GraphqlEndpointManagementSteps {
10
10
  return cy.get('.graphql-endpoint-management-view');
11
11
  }
12
12
 
13
+ static getPageContainer() {
14
+ return GraphqlEndpointManagementSteps.getView().find('.endpoint-management-container');
15
+ }
16
+
17
+ static getRepositoryInRemoteLocation() {
18
+ return GraphqlEndpointManagementSteps.getView().find('.unexpected-remote-repository-warning');
19
+ }
20
+
13
21
  static getEndpointFilterField() {
14
22
  return this.getView().find('.endpoints-filter-field');
15
23
  }
@@ -10,6 +10,14 @@ export class GraphqlPlaygroundSteps {
10
10
  return cy.get('.graphql-playground-view');
11
11
  }
12
12
 
13
+ static getPageContainer() {
14
+ return GraphqlPlaygroundSteps.getView().find('.content');
15
+ }
16
+
17
+ static getRepositoryInRemoteLocation() {
18
+ return GraphqlPlaygroundSteps.getView().find('.unexpected-remote-repository-warning');
19
+ }
20
+
13
21
  static getNoSchemasAlert() {
14
22
  return this.getView().find('.no-endpoints-view');
15
23
  }
@@ -34,7 +34,8 @@ export class YasrSteps extends BaseSteps {
34
34
  }
35
35
 
36
36
  static getResults() {
37
- return YasrSteps.getYasr().find('.yasr_results tbody').find('tr');
37
+ this.getYasrResultsContainer().should('not.have.class', 'rendering_result')
38
+ return this.getYasrResultsContainer().find('tbody').find('tr');
38
39
  }
39
40
 
40
41
  static getResultTableHeader() {
@@ -114,6 +115,7 @@ export class YasrSteps extends BaseSteps {
114
115
  }
115
116
 
116
117
  static getNoDataElement() {
118
+ this.getYasrResultsContainer().should('not.have.class', 'rendering_result')
117
119
  return cy.get('.dataTables_empty');
118
120
  }
119
121
 
@@ -47,13 +47,13 @@ Cypress.Commands.add('deleteRepository', (id, secured = false) => {
47
47
  });
48
48
  });
49
49
 
50
- Cypress.Commands.add('presetRepository', (id) => {
51
- cy.setLocalStorage(PRESET_REPO, JSON.stringify({id: id, location: ''}));
50
+ Cypress.Commands.add('presetRepository', (id, location = '') => {
51
+ cy.setLocalStorage(PRESET_REPO, JSON.stringify({id: id, location}));
52
52
  cy.waitUntil(() =>
53
53
  cy.getLocalStorage(PRESET_REPO)
54
54
  .then((preset) => {
55
55
  const presetRepo = JSON.parse(preset);
56
- return presetRepo && presetRepo.id === id
56
+ return presetRepo && presetRepo.id === id && presetRepo.location === location;
57
57
  }));
58
58
  cy.log('Pre-set repository:', id);
59
59
  });