graphdb-workbench-tests 4.0.0-TR21 → 4.0.0-TR23
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/import/import-user-data-file-upload.spec.js +36 -1
- 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-list.spec.js +15 -0
- package/e2e-legacy/ttyg/chat-panel.spec.js +14 -0
- package/e2e-legacy/ttyg/chat-template-injection.spec.js +49 -0
- package/e2e-legacy/ttyg/delete-agent.spec.js +14 -0
- package/e2e-security/repository/url-with-repository-id-parameter.spec.js +17 -0
- package/fixtures/ttyg/agent/get-agent-list-with-html-in-names.json +77 -0
- package/fixtures/ttyg/chats/get-chat-list-with-html-in-name.json +22 -0
- 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/ttyg/chat-panel-steps.js +4 -0
- package/steps/yasgui/yasqe-steps.js +2 -6
- package/stubs/ttyg/ttyg-stubs.js +3 -2
|
@@ -2,6 +2,7 @@ import {ImportSettingsDialogSteps} from "../../steps/import/import-settings-dial
|
|
|
2
2
|
import {ImportUserDataSteps} from "../../steps/import/import-user-data-steps";
|
|
3
3
|
import {FileOverwriteDialogSteps} from "../../steps/import/file-overwrite-dialog-steps";
|
|
4
4
|
import {HeaderSteps} from '../../steps/header-steps.js';
|
|
5
|
+
import {ModalDialogSteps} from '../../steps/modal-dialog-steps.js';
|
|
5
6
|
|
|
6
7
|
const bnodes = `_:node0 <http://purl.org/dc/elements/1.1/title> "A new book" ;
|
|
7
8
|
\t<http://purl.org/dc/elements/1.1/creator> "A.N.Other" .`;
|
|
@@ -14,12 +15,15 @@ const jsonld = JSON.stringify({
|
|
|
14
15
|
"ab:email": "richard491@hotmail.com"
|
|
15
16
|
});
|
|
16
17
|
|
|
18
|
+
const htmlFileName = '<img src="x" class="injected-html">bnodes.ttl';
|
|
19
|
+
|
|
17
20
|
describe('Import user data: File upload', () => {
|
|
18
21
|
let repositoryId;
|
|
19
22
|
const testFiles = [
|
|
20
23
|
'bnodes.ttl',
|
|
21
24
|
'jsonld.jsonld',
|
|
22
|
-
'invalid-format.json'
|
|
25
|
+
'invalid-format.json',
|
|
26
|
+
htmlFileName
|
|
23
27
|
];
|
|
24
28
|
|
|
25
29
|
beforeEach(() => {
|
|
@@ -221,6 +225,37 @@ describe('Import user data: File upload', () => {
|
|
|
221
225
|
ImportUserDataSteps.checkImportedResourceByIndex(0, 'bnodes.ttl');
|
|
222
226
|
});
|
|
223
227
|
|
|
228
|
+
it('should show HTML in the duplicated file name as text in the file override confirmation dialog', () => {
|
|
229
|
+
// Given I have uploaded a file which name contains HTML
|
|
230
|
+
const file = ImportUserDataSteps.createFile(htmlFileName, bnodes);
|
|
231
|
+
ImportUserDataSteps.selectFile(file);
|
|
232
|
+
ImportSettingsDialogSteps.getDialog().should('be.visible');
|
|
233
|
+
ImportSettingsDialogSteps.import();
|
|
234
|
+
ImportUserDataSteps.getResources().should('have.length', 1);
|
|
235
|
+
// When I upload a file with the same name
|
|
236
|
+
ImportUserDataSteps.selectFile(file);
|
|
237
|
+
// Then I expect the file name to be displayed as text in the file override confirmation dialog
|
|
238
|
+
FileOverwriteDialogSteps.getDialog().should('be.visible');
|
|
239
|
+
FileOverwriteDialogSteps.getDialogBody().should('contain.text', htmlFileName);
|
|
240
|
+
FileOverwriteDialogSteps.getDialogBody().invoke('html').should('not.contain', '<img');
|
|
241
|
+
FileOverwriteDialogSteps.cancel();
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
it('should show HTML in the file name as text in the remove file dialog', () => {
|
|
245
|
+
// Given I have uploaded a file which name contains HTML
|
|
246
|
+
const file = ImportUserDataSteps.createFile(htmlFileName, bnodes);
|
|
247
|
+
ImportUserDataSteps.selectFile(file);
|
|
248
|
+
ImportSettingsDialogSteps.getDialog().should('be.visible');
|
|
249
|
+
ImportSettingsDialogSteps.import();
|
|
250
|
+
ImportUserDataSteps.getResources().should('have.length', 1);
|
|
251
|
+
// When I remove the file
|
|
252
|
+
ImportUserDataSteps.deleteUploadedFile(0);
|
|
253
|
+
// Then I expect the file name to be displayed as text in the remove file dialog
|
|
254
|
+
ModalDialogSteps.getDialogBody().should('contain.text', htmlFileName);
|
|
255
|
+
ModalDialogSteps.getDialogBody().invoke('html').should('not.contain', '<img');
|
|
256
|
+
ModalDialogSteps.clickOnCancelButton();
|
|
257
|
+
});
|
|
258
|
+
|
|
224
259
|
it('Should be able to upload file with same name and preserve the existing file', () => {
|
|
225
260
|
// Given I have uploaded a file
|
|
226
261
|
ImportUserDataSteps.getResourcesTable().should('be.hidden');
|
|
@@ -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
|
});
|
|
@@ -259,6 +259,21 @@ describe('TTYG chat list', () => {
|
|
|
259
259
|
// Then I expect the chat to be removed from the chat list
|
|
260
260
|
TTYGViewSteps.getChatFromGroup(0, 2).should('not.exist');
|
|
261
261
|
});
|
|
262
|
+
|
|
263
|
+
it('should show HTML in the chat name as text in the delete chat dialog', () => {
|
|
264
|
+
// Given a chat name contains HTML
|
|
265
|
+
TTYGStubs.stubChatsListGet('/ttyg/chats/get-chat-list-with-html-in-name.json');
|
|
266
|
+
TTYGStubs.stubChatGet();
|
|
267
|
+
TTYGStubs.stubAgentListGet();
|
|
268
|
+
TTYGViewSteps.visit();
|
|
269
|
+
cy.wait('@get-chat-list');
|
|
270
|
+
// When I select the delete action from the chat action menu
|
|
271
|
+
TTYGViewSteps.triggerDeleteChatActionMenu(1, 0);
|
|
272
|
+
// Then I expect the chat name to be displayed as text
|
|
273
|
+
ModalDialogSteps.getDialogBody().should('contain.text', '<img src="x" class="injected-html">Test chat 4');
|
|
274
|
+
ModalDialogSteps.getDialogBody().invoke('html').should('not.contain', '<img');
|
|
275
|
+
ModalDialogSteps.clickOnCancelButton();
|
|
276
|
+
});
|
|
262
277
|
});
|
|
263
278
|
|
|
264
279
|
/**
|
|
@@ -115,6 +115,20 @@ describe('Ttyg ChatPanel', () => {
|
|
|
115
115
|
ChatPanelSteps.getAgentInfoMessage(1).contains('Agent changed to Databricks-biomarkers');
|
|
116
116
|
});
|
|
117
117
|
|
|
118
|
+
it('should show HTML in the agent name as text in the agent changed info message', () => {
|
|
119
|
+
// Given an agent name contains HTML
|
|
120
|
+
TTYGStubs.stubAgentListGet('/ttyg/agent/get-agent-list-with-html-in-names.json');
|
|
121
|
+
TTYGViewSteps.visit();
|
|
122
|
+
cy.wait('@get-agent-list');
|
|
123
|
+
|
|
124
|
+
// When I select a chat that has answers using different agents
|
|
125
|
+
TTYGViewSteps.selectChat(0, 1);
|
|
126
|
+
|
|
127
|
+
// Then I expect the agent name to be displayed as text
|
|
128
|
+
ChatPanelSteps.getAgentInfoMessage(0).should('contain.text', '<img src="x" class="injected-html">agent-2');
|
|
129
|
+
ChatPanelSteps.getAgentInfoMessage(0).invoke('html').should('not.contain', '<img');
|
|
130
|
+
});
|
|
131
|
+
|
|
118
132
|
it('Should select last used agent when change the selected chat', () => {
|
|
119
133
|
// Then I expect the last used agent to be selected.
|
|
120
134
|
TTYGViewSteps.getAgentsMenuToggleButton().contains('agent-1');
|
|
@@ -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
|
+
});
|
|
@@ -47,4 +47,18 @@ describe('TTYG delete agent', () => {
|
|
|
47
47
|
{name: 'Databricks-biomarkers', repositoryId: 'biomarkers', isRepositoryDeleted: false}
|
|
48
48
|
]);
|
|
49
49
|
});
|
|
50
|
+
|
|
51
|
+
it('should show HTML in the agent name as text in the delete agent dialog', () => {
|
|
52
|
+
// Given an agent name contains HTML
|
|
53
|
+
TTYGStubs.stubChatsListGetNoResults();
|
|
54
|
+
TTYGStubs.stubAgentListGet('/ttyg/agent/get-agent-list-with-html-in-names.json');
|
|
55
|
+
TTYGViewSteps.visit();
|
|
56
|
+
TTYGViewSteps.expandAgentsSidebar();
|
|
57
|
+
// When I select the delete agent action
|
|
58
|
+
TTYGViewSteps.triggerDeleteAgentActionMenu(0);
|
|
59
|
+
// Then I expect the agent name to be displayed as text
|
|
60
|
+
ModalDialogSteps.getDialogBody().should('contain.text', '<img src="x" class="injected-html">agent-1');
|
|
61
|
+
ModalDialogSteps.getDialogBody().invoke('html').should('not.contain', '<img');
|
|
62
|
+
ModalDialogSteps.cancel();
|
|
63
|
+
});
|
|
50
64
|
});
|
|
@@ -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) {
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "asst_gAPcrHQQ9ZIxD5eXWH2BNFfo",
|
|
4
|
+
"name": "<img src=\"x\" class=\"injected-html\">agent-1",
|
|
5
|
+
"model": "gpt-4o",
|
|
6
|
+
"temperature": 0.0,
|
|
7
|
+
"topP": 0.0,
|
|
8
|
+
"seed": null,
|
|
9
|
+
"repositoryId": "starwars",
|
|
10
|
+
"instructions": {
|
|
11
|
+
"systemInstruction": "",
|
|
12
|
+
"userInstruction": ""
|
|
13
|
+
},
|
|
14
|
+
"assistantExtractionMethods": [
|
|
15
|
+
{
|
|
16
|
+
"method": "fts_search",
|
|
17
|
+
"maxNumberOfTriplesPerCall": 44
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"id": "asst_qMyCpCBmqxV9I2B8UoMfFzc5",
|
|
23
|
+
"name": "<img src=\"x\" class=\"injected-html\">agent-2",
|
|
24
|
+
"model": "gpt-4o",
|
|
25
|
+
"temperature": 0.0,
|
|
26
|
+
"topP": 0.0,
|
|
27
|
+
"seed": null,
|
|
28
|
+
"repositoryId": "Not existing repo",
|
|
29
|
+
"instructions": {
|
|
30
|
+
"systemInstruction": "string\n\nstring",
|
|
31
|
+
"userInstruction": "string"
|
|
32
|
+
},
|
|
33
|
+
"assistantExtractionMethods": [
|
|
34
|
+
{
|
|
35
|
+
"method": "fts_search"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"id": "asst_Cr0RxobrY07WpOvvyQilEWMI",
|
|
41
|
+
"name": "Databricks-general-unbiased",
|
|
42
|
+
"model": "gpt-4o-2024-08-06",
|
|
43
|
+
"temperature": 1.0,
|
|
44
|
+
"topP": 1.0,
|
|
45
|
+
"seed": null,
|
|
46
|
+
"repositoryId": "starwars",
|
|
47
|
+
"instructions": {
|
|
48
|
+
"systemInstruction": "You are helpful assistant in discovering information regarding diagnostic biomarkers.",
|
|
49
|
+
"userInstruction": null
|
|
50
|
+
},
|
|
51
|
+
"assistantExtractionMethods": [
|
|
52
|
+
{
|
|
53
|
+
"method": "fts_search",
|
|
54
|
+
"maxNumberOfTriplesPerCall": 44
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"id": "asst_5GxNYTdaOh7Tl6lLl6Pya2aH",
|
|
60
|
+
"name": "Databricks-biomarkers",
|
|
61
|
+
"model": "gpt-3.5-turbo-0125",
|
|
62
|
+
"temperature": 1.0,
|
|
63
|
+
"topP": 1.0,
|
|
64
|
+
"seed": null,
|
|
65
|
+
"repositoryId": "biomarkers",
|
|
66
|
+
"instructions": {
|
|
67
|
+
"systemInstruction": "You're a helpful assistant in discovering new diagnostic biomarkers for given diseases. I'll submit a set of publication abstracts discussing given disease and your task is to find in the abstracts any potential new biomarkers which are not yet listed in the appropriate databases. Each abstract is preceded by identifier - its PubMed id called for short PMID. \n\nReturn the set of biomarkers listed one per row, each marker followed by the | and PMID of the respective abstract if was mentioned in.\n\nExample: \nInput: 36418457\t[Amyotrophic lateral sclerosis (ALS) is a genetically and phenotypically heterogeneous disease results in the loss of motor neurons. Mounting information points to involvement of other systems including cognitive impairment. However, neither the valid biomarker for diagnosis nor effective therapeutic intervention is available for ALS. The present study is aimed at identifying potentially genetic biomarker that improves the diagnosis and treatment of ALS patients based on the data of the Gene Expression Omnibus. We retrieved datasets and conducted a weighted gene co-expression network analysis (WGCNA) to identify ALS-related co-expression genes. Functional enrichment analysis was performed to determine the features and pathways of the main modules. We then constructed an ALS-related model using the least absolute shrinkage and selection operator (LASSO) regression analysis and verified the model by the receiver operating characteristic (ROC) curve. Besides we screened the non-preserved gene modules in FTD and ALS-mimic disorders to distinct ALS-related genes from disorders with overlapping genes and features. Altogether, 4198 common genes between datasets with the most variation were analyzed and 16 distinct modules were identified through WGCNA. Blue module had the most correlation with ALS and functionally enriched in pathways of neurodegeneration-multiple diseases', 'amyotrophic lateral sclerosis', and 'endocytosis' KEGG terms. Further, some of other modules related to ALS were enriched in 'autophagy' and 'amyotrophic lateral sclerosis'. The 30 top of hub genes were recruited to a LASSO regression model and 5 genes (BCLAF1, GNA13, ARL6IP5, ARGLU1, and YPEL5) were identified as potentially diagnostic ALS biomarkers with validating of the ROC curve and AUC value.]\n\nYour response: BCLAF1|36418457\nGNA13|36418457\nARL6IP5|36418457\nARGLU1|36418457\nYPEL5|36418457",
|
|
68
|
+
"userInstruction": null
|
|
69
|
+
},
|
|
70
|
+
"assistantExtractionMethods": [
|
|
71
|
+
{
|
|
72
|
+
"method": "fts_search",
|
|
73
|
+
"maxNumberOfTriplesPerCall": 44
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
]
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "thread_jdQBvbkaU6JPoO48oFbC54dA",
|
|
4
|
+
"name": "Very long chat name which does not fit in the sidebar",
|
|
5
|
+
"timestamp": 1725235200
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"id": "thread_jdQBvbkaU6JPoO48oQaL76dB",
|
|
9
|
+
"name": "Test chat 2",
|
|
10
|
+
"timestamp": 1725238800
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"id": "thread_jdQBvbkaU6JPoO48oQaL76dC",
|
|
14
|
+
"name": "Test chat 3",
|
|
15
|
+
"timestamp": 1725242400
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"id": "thread_jdQBvbkaU6JPoO48oFbC54dD",
|
|
19
|
+
"name": "<img src=\"x\" class=\"injected-html\">Test chat 4",
|
|
20
|
+
"timestamp": 1697331600
|
|
21
|
+
}
|
|
22
|
+
]
|
|
@@ -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-TR23",
|
|
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-TR23",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@bahmutov/cypress-code-coverage": "^2.7.2",
|
package/package.json
CHANGED
|
@@ -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
|
}
|
|
@@ -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/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/*'
|