graphdb-workbench-tests 4.0.0-TR20 → 4.0.0-TR22
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.
- package/e2e-legacy/repository/attach-remote-location.spec.js +7 -15
- package/e2e-legacy/repository/fedx-deprecation.spec.js +178 -0
- package/e2e-legacy/sparql-editor/actions/expand-results-over-sameas.spec.js +8 -8
- package/e2e-legacy/sparql-editor/actions/include-inferred-statements.spec.js +4 -4
- package/e2e-legacy/sparql-editor/actions/inferred-sameas.spec.js +2 -2
- package/e2e-legacy/ttyg/chat-template-injection.spec.js +49 -0
- package/e2e-security/repository/url-with-repository-id-parameter.spec.js +17 -0
- package/e2e-security/setup/license/license-logout.spec.js +3 -1
- package/fixtures/ttyg/chats/get-chat-with-template-injection.json +27 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/steps/repositories/attach-repository-steps.js +2 -10
- package/steps/repository-picker-list-steps.js +4 -0
- package/steps/repository-selector-steps.js +4 -0
- package/steps/repository-steps.js +35 -0
- package/steps/ttyg/chat-panel-steps.js +4 -0
- package/steps/widgets/repository-errors-widget-steps.js +9 -0
- package/steps/yasgui/yasqe-steps.js +2 -6
- package/stubs/license-stubs.js +7 -0
- package/stubs/ttyg/ttyg-stubs.js +3 -2
|
@@ -122,7 +122,7 @@ describe('Attach remote location', () => {
|
|
|
122
122
|
RepositorySteps.getSparqlOntopicTable().should('not.exist');
|
|
123
123
|
});
|
|
124
124
|
|
|
125
|
-
it('should
|
|
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
|
|
134
|
-
AttachRepositorySteps.
|
|
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(
|
|
153
|
-
|
|
154
|
-
|
|
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
|
+
});
|
|
@@ -60,7 +60,7 @@ describe('Expand results over owl:sameAs', () => {
|
|
|
60
60
|
// Then I expect that "sameAs" element to be enabled by default
|
|
61
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
|
-
YasqeSteps.getActionButtonTooltip(
|
|
63
|
+
YasqeSteps.getActionButtonTooltip(5).should('have.attr', 'yasgui-data-tooltip', 'Expand results over owl:sameAs: ON');
|
|
64
64
|
|
|
65
65
|
// When I open a new Tab.
|
|
66
66
|
YasguiSteps.openANewTab();
|
|
@@ -68,7 +68,7 @@ describe('Expand results over owl:sameAs', () => {
|
|
|
68
68
|
// Then I expect that "sameAs" element to be enabled in the new tab.
|
|
69
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
|
-
YasqeSteps.getActionButtonTooltip(
|
|
71
|
+
YasqeSteps.getActionButtonTooltip(5).should('have.attr', 'yasgui-data-tooltip', 'Expand results over owl:sameAs: ON');
|
|
72
72
|
});
|
|
73
73
|
|
|
74
74
|
it('should not be enabled when infer is true and sameAs is false in user settings',() => {
|
|
@@ -81,7 +81,7 @@ describe('Expand results over owl:sameAs', () => {
|
|
|
81
81
|
// Then I expect that "sameAs" element to be disabled by default
|
|
82
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
|
-
YasqeSteps.getActionButtonTooltip(
|
|
84
|
+
YasqeSteps.getActionButtonTooltip(5).should('have.attr', 'yasgui-data-tooltip', 'Expand results over owl:sameAs: OFF');
|
|
85
85
|
|
|
86
86
|
// When I open a new Tab.
|
|
87
87
|
YasguiSteps.openANewTab();
|
|
@@ -89,7 +89,7 @@ describe('Expand results over owl:sameAs', () => {
|
|
|
89
89
|
// Then I expect that "sameAs" element to be disabled in the new tab.
|
|
90
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
|
-
YasqeSteps.getActionButtonTooltip(
|
|
92
|
+
YasqeSteps.getActionButtonTooltip(5).should('have.attr', 'yasgui-data-tooltip', 'Expand results over owl:sameAs: OFF');
|
|
93
93
|
});
|
|
94
94
|
|
|
95
95
|
it('should not be enabled when infer is false and sameAs is true in user settings', () => {
|
|
@@ -100,7 +100,7 @@ describe('Expand results over owl:sameAs', () => {
|
|
|
100
100
|
YasguiSteps.getYasgui().should('be.visible');
|
|
101
101
|
|
|
102
102
|
// Then I expect that "sameAs" element to be disabled by default
|
|
103
|
-
YasqeSteps.getActionButtonTooltip(
|
|
103
|
+
YasqeSteps.getActionButtonTooltip(5).should('have.attr', 'yasgui-data-tooltip', 'Requires \'Include Inferred\'!');
|
|
104
104
|
// and the tooltip of element describes that "infer" is required.
|
|
105
105
|
YasqeSteps.getActionButton(5).should('have.class', 'icon-same-as-off');
|
|
106
106
|
|
|
@@ -110,7 +110,7 @@ describe('Expand results over owl:sameAs', () => {
|
|
|
110
110
|
// Then I expect that "sameAs" element to be disabled in the new tab,
|
|
111
111
|
YasqeSteps.getActionButton(5).should('have.class', 'icon-same-as-off');
|
|
112
112
|
// and the tooltip of element describes that "infer" is required.
|
|
113
|
-
YasqeSteps.getActionButtonTooltip(
|
|
113
|
+
YasqeSteps.getActionButtonTooltip(5).should('have.attr', 'yasgui-data-tooltip', 'Requires \'Include Inferred\'!');
|
|
114
114
|
});
|
|
115
115
|
|
|
116
116
|
it('should not be enabled when infer is false and sameAs is false in user settings', () => {
|
|
@@ -123,7 +123,7 @@ describe('Expand results over owl:sameAs', () => {
|
|
|
123
123
|
// Then I expect that "sameAs" element to be disabled by default,
|
|
124
124
|
YasqeSteps.getActionButton(5).should('have.class', 'icon-same-as-off');
|
|
125
125
|
// and the tooltip of element describes that "infer" is required.
|
|
126
|
-
YasqeSteps.getActionButtonTooltip(
|
|
126
|
+
YasqeSteps.getActionButtonTooltip(5).should('have.attr', 'yasgui-data-tooltip', 'Requires \'Include Inferred\'!');
|
|
127
127
|
|
|
128
128
|
// When I open a new Tab.
|
|
129
129
|
YasguiSteps.openANewTab();
|
|
@@ -131,6 +131,6 @@ describe('Expand results over owl:sameAs', () => {
|
|
|
131
131
|
// Then I expect that "sameAs" element to be disabled in the new tab,
|
|
132
132
|
YasqeSteps.getActionButton(5).should('have.class', 'icon-same-as-off');
|
|
133
133
|
// and the tooltip of element describes that "infer" is required.
|
|
134
|
-
YasqeSteps.getActionButtonTooltip(
|
|
134
|
+
YasqeSteps.getActionButtonTooltip(5).should('have.attr', 'yasgui-data-tooltip', 'Requires \'Include Inferred\'!');
|
|
135
135
|
});
|
|
136
136
|
});
|
|
@@ -66,7 +66,7 @@ describe('Include inferred statements', () => {
|
|
|
66
66
|
// Then I expect that "infer" element to be enabled by default,
|
|
67
67
|
YasqeSteps.getActionButton(4).should('have.class', 'icon-inferred-on');
|
|
68
68
|
// and the tooltip of element describes that "infer" functionality is enabled.
|
|
69
|
-
YasqeSteps.getActionButtonTooltip(
|
|
69
|
+
YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Include inferred data in results: ON');
|
|
70
70
|
|
|
71
71
|
// When I open a new Tab.
|
|
72
72
|
YasguiSteps.openANewTab();
|
|
@@ -74,7 +74,7 @@ describe('Include inferred statements', () => {
|
|
|
74
74
|
// Then I expect that inferred element to be enabled in the new tab,
|
|
75
75
|
YasqeSteps.getActionButton(4).should('have.class', 'icon-inferred-on');
|
|
76
76
|
// and the tooltip of element describes that "infer" element is enabled.
|
|
77
|
-
YasqeSteps.getActionButtonTooltip(
|
|
77
|
+
YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Include inferred data in results: ON');
|
|
78
78
|
});
|
|
79
79
|
|
|
80
80
|
it('should not be enabled when user settings is set to false.', () => {
|
|
@@ -87,7 +87,7 @@ describe('Include inferred statements', () => {
|
|
|
87
87
|
// Then I expect that "infer" element to be disabled by default,
|
|
88
88
|
YasqeSteps.getActionButton(4).should('have.class', 'icon-inferred-off');
|
|
89
89
|
// and the tooltip of element describes that "infer" element is disabled.
|
|
90
|
-
YasqeSteps.getActionButtonTooltip(
|
|
90
|
+
YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Include inferred data in results: OFF');
|
|
91
91
|
|
|
92
92
|
// When I open a new Tab.
|
|
93
93
|
YasguiSteps.openANewTab();
|
|
@@ -95,6 +95,6 @@ describe('Include inferred statements', () => {
|
|
|
95
95
|
// Then I expect that inferred element to be disabled in the new tab,
|
|
96
96
|
YasqeSteps.getActionButton(4).should('have.class', 'icon-inferred-off');
|
|
97
97
|
// and the tooltip of element describes that "infer" element is disabled.
|
|
98
|
-
YasqeSteps.getActionButtonTooltip(
|
|
98
|
+
YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Include inferred data in results: OFF');
|
|
99
99
|
});
|
|
100
100
|
});
|
|
@@ -36,14 +36,14 @@ describe('Expand results over owl:sameAs', () => {
|
|
|
36
36
|
SparqlEditorSteps.visitSparqlEditorPage();
|
|
37
37
|
|
|
38
38
|
// Then I expect inferred button to be on.
|
|
39
|
-
YasqeSteps.getActionButtonTooltip(
|
|
39
|
+
YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Include inferred data in results: ON');
|
|
40
40
|
YasqeSteps.getActionButton(4).should('have.class', 'icon-inferred-on');
|
|
41
41
|
|
|
42
42
|
// When I click on inferred button
|
|
43
43
|
YasqeSteps.getActionButton(4).click({force: true});
|
|
44
44
|
|
|
45
45
|
// Then I expect inferred button to not be toggled.
|
|
46
|
-
YasqeSteps.getActionButtonTooltip(
|
|
46
|
+
YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Include inferred data in results: ON');
|
|
47
47
|
YasqeSteps.getActionButton(4).should('have.class', 'icon-inferred-on');
|
|
48
48
|
});
|
|
49
49
|
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {RepositoriesStubs} from '../../stubs/repositories/repositories-stubs';
|
|
2
|
+
import {TTYGStubs} from '../../stubs/ttyg/ttyg-stubs';
|
|
3
|
+
import {TTYGViewSteps} from '../../steps/ttyg/ttyg-view-steps';
|
|
4
|
+
import {ChatPanelSteps} from '../../steps/ttyg/chat-panel-steps';
|
|
5
|
+
import {BrowserStubs} from '../../stubs/browser-stubs.js';
|
|
6
|
+
|
|
7
|
+
const EXPRESSION = '{{7*7}}';
|
|
8
|
+
const QUERY = `SELECT ?s WHERE { ?s rdfs:label "${EXPRESSION}" }`;
|
|
9
|
+
|
|
10
|
+
describe('Ttyg chat template injection', () => {
|
|
11
|
+
|
|
12
|
+
beforeEach(() => {
|
|
13
|
+
RepositoriesStubs.stubRepositories(0, '/repositories/get-ttyg-repositories.json');
|
|
14
|
+
RepositoriesStubs.stubBaseEndpoints('starwars');
|
|
15
|
+
cy.presetRepository('starwars');
|
|
16
|
+
TTYGStubs.stubChatsListGet();
|
|
17
|
+
TTYGStubs.stubAgentListGet();
|
|
18
|
+
// Given a chat whose question and answer contain an AngularJS expression
|
|
19
|
+
TTYGStubs.stubChatGet(0, '/ttyg/chats/get-chat-with-template-injection.json');
|
|
20
|
+
|
|
21
|
+
TTYGViewSteps.visit();
|
|
22
|
+
cy.wait('@get-chat-list');
|
|
23
|
+
cy.wait('@get-agent-list');
|
|
24
|
+
cy.wait('@get-chat');
|
|
25
|
+
cy.wait('@get-all-repositories');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('should show AngularJS expressions in the chat literally', () => {
|
|
29
|
+
// Then I expect the expression in the question to be shown as it is, not evaluated
|
|
30
|
+
ChatPanelSteps.getChatDetailQuestionElement(0).should('contain', `What is ${EXPRESSION}?`);
|
|
31
|
+
// And the expression in the answer text and in its SPARQL code block to be shown as it is
|
|
32
|
+
ChatPanelSteps.getAssistantAnswer(0)
|
|
33
|
+
.should('contain', `The answer is ${EXPRESSION}.`)
|
|
34
|
+
.and('contain', QUERY)
|
|
35
|
+
.and('not.contain', '49');
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('should open the SPARQL query of an answer with its AngularJS expression unchanged', () => {
|
|
39
|
+
// Given the browser does not open new windows
|
|
40
|
+
BrowserStubs.stubWindowOpen();
|
|
41
|
+
|
|
42
|
+
// When I open the SPARQL query of the answer in the SPARQL editor
|
|
43
|
+
ChatPanelSteps.openInSparqlEditor(0);
|
|
44
|
+
|
|
45
|
+
// Then I expect the query to be opened with the expression unchanged
|
|
46
|
+
cy.get(BrowserStubs.WINDOW_OPEN_ALIAS())
|
|
47
|
+
.should('have.been.calledWith', `sparql?query=${encodeURIComponent(QUERY)}&execute=false`);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
@@ -2,6 +2,7 @@ import {RepositorySelectorSteps} from '../../steps/repository-selector-steps.js'
|
|
|
2
2
|
import {LoginSteps} from '../../steps/login-steps.js';
|
|
3
3
|
import {UserAndAccessSteps} from '../../steps/setup/user-and-access-steps.js';
|
|
4
4
|
import HomeSteps from '../../steps/home-steps.js';
|
|
5
|
+
import {GraphNavigatorSteps} from '../../steps/graph-navigator-steps.js';
|
|
5
6
|
|
|
6
7
|
describe('URL with Repository ID parameter', () => {
|
|
7
8
|
let repositoryId;
|
|
@@ -39,6 +40,22 @@ describe('URL with Repository ID parameter', () => {
|
|
|
39
40
|
cy.url().should('include', 'repositoryId=' + repositoryId);
|
|
40
41
|
RepositorySelectorSteps.getSelectedRepository().should('contain', repositoryId);
|
|
41
42
|
});
|
|
43
|
+
|
|
44
|
+
it('should open a page of the new Workbench with repositoryId in url after login', () => {
|
|
45
|
+
// Given security is on
|
|
46
|
+
cy.switchOnSecurity();
|
|
47
|
+
// When I open a page of the new Workbench, which loads its code only when it is opened
|
|
48
|
+
GraphNavigatorSteps.visit();
|
|
49
|
+
// Then the login page should be shown
|
|
50
|
+
LoginSteps.getLoginPage().should('be.visible');
|
|
51
|
+
// When I log in with user admin
|
|
52
|
+
LoginSteps.loginWithUser('admin', 'root');
|
|
53
|
+
// Then the page should open with only the repositoryId parameter in the URL
|
|
54
|
+
GraphNavigatorSteps.verifyUrl();
|
|
55
|
+
GraphNavigatorSteps.verifyOnlyRepositoryParam(repositoryId);
|
|
56
|
+
// And the repository should be selected in the selector
|
|
57
|
+
RepositorySelectorSteps.getSelectedRepository().should('contain', repositoryId);
|
|
58
|
+
});
|
|
42
59
|
});
|
|
43
60
|
|
|
44
61
|
function enableSecurity(repositoryId) {
|
|
@@ -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.
|
|
31
|
+
LicenseStubs.spyGetLicenseFromServer();
|
|
30
32
|
LoginSteps.loginWithUser('admin', 'root');
|
|
31
33
|
cy.wait('@get-license');
|
|
32
34
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"thread_jdQBvbkaU6JPoO48oQaL76dC": {
|
|
3
|
+
"id": "thread_jdQBvbkaU6JPoO48oQaL76dC",
|
|
4
|
+
"name": "Template injection",
|
|
5
|
+
"messages": [
|
|
6
|
+
{
|
|
7
|
+
"id": "msg_template_injection_question",
|
|
8
|
+
"conversationId": "thread_jdQBvbkaU6JPoO48oQaL76dC",
|
|
9
|
+
"agentId": null,
|
|
10
|
+
"role": "user",
|
|
11
|
+
"message": "What is {{7*7}}?",
|
|
12
|
+
"timestamp": "1725875323",
|
|
13
|
+
"name": null
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"id": "msg_template_injection_answer",
|
|
17
|
+
"conversationId": "thread_jdQBvbkaU6JPoO48oQaL76dC",
|
|
18
|
+
"agentId": "asst_gAPcrHQQ9ZIxD5eXWH2BNFfo",
|
|
19
|
+
"role": "assistant",
|
|
20
|
+
"message": "The answer is {{7*7}}.\n\n```sparql\nSELECT ?s WHERE { ?s rdfs:label \"{{7*7}}\" }\n```",
|
|
21
|
+
"timestamp": "1725875332",
|
|
22
|
+
"name": null
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"timestamp": "1725875483"
|
|
26
|
+
}
|
|
27
|
+
}
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphdb-workbench-tests",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-TR22",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "graphdb-workbench-tests",
|
|
9
|
-
"version": "4.0.0-
|
|
9
|
+
"version": "4.0.0-TR22",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@bahmutov/cypress-code-coverage": "^2.7.2",
|
package/package.json
CHANGED
|
@@ -120,15 +120,7 @@ export class AttachRepositorySteps {
|
|
|
120
120
|
AttachRepositorySteps.getPasswordInput().clear();
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
static
|
|
124
|
-
return this.getRemoteLocationSettingsForm().find('
|
|
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() {
|
|
@@ -86,6 +86,10 @@ export class ChatPanelSteps extends BaseSteps {
|
|
|
86
86
|
return ChatPanelSteps.getCopyToClipboardElements().eq(index);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
static openInSparqlEditor(index = 0) {
|
|
90
|
+
ChatPanelSteps.getOpenInSparqlEditorElement(index).find(ChatPanelSteps.buildTestIdAttr('open-in-sparql-editor-btn')).click();
|
|
91
|
+
}
|
|
92
|
+
|
|
89
93
|
static getCancelButton() {
|
|
90
94
|
return ChatPanelSteps.getChatPanel().find('.cancel-ask-button');
|
|
91
95
|
}
|
|
@@ -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
|
}
|
|
@@ -205,12 +205,8 @@ export class YasqeSteps {
|
|
|
205
205
|
return YasqeSteps.getEditor().find('.yasqe_buttons');
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
static
|
|
209
|
-
return YasqeSteps.
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
static getActionButtonTooltip(index) {
|
|
213
|
-
return YasqeSteps.getActionButtonsTooltips().eq(index);
|
|
208
|
+
static getActionButtonTooltip(buttonIndex) {
|
|
209
|
+
return YasqeSteps.getActionButton(buttonIndex).closest('yasgui-tooltip');
|
|
214
210
|
}
|
|
215
211
|
|
|
216
212
|
static getActionButtons() {
|
package/stubs/license-stubs.js
CHANGED
|
@@ -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
|
}
|
package/stubs/ttyg/ttyg-stubs.js
CHANGED
|
@@ -29,9 +29,10 @@ export class TTYGStubs extends Stubs {
|
|
|
29
29
|
* Loads the specified <code>fixture</code> and updates the chatId in the fixture with the actual ID passed in the endpoint call.
|
|
30
30
|
*
|
|
31
31
|
* @param {number} delay - Optional delay in milliseconds before responding with the fixture.
|
|
32
|
+
* @param {string} fixture - Optional fixture with the chats, keyed by chat ID.
|
|
32
33
|
*/
|
|
33
|
-
static stubChatGet(delay = 0) {
|
|
34
|
-
cy.fixture(
|
|
34
|
+
static stubChatGet(delay = 0, fixture = '/ttyg/chats/get-chat.json') {
|
|
35
|
+
cy.fixture(fixture).then((body) => {
|
|
35
36
|
cy.intercept({
|
|
36
37
|
method: 'GET',
|
|
37
38
|
url: '/rest/chat/conversations/*'
|