graphdb-workbench-tests 4.0.0-TR22 → 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.
@@ -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');
@@ -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');
@@ -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
  });
@@ -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
+ ]
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "4.0.0-TR22",
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-TR22",
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "4.0.0-TR22",
3
+ "version": "4.0.0-TR23",
4
4
  "description": "Cypress tests for GraphDB workbench",
5
5
  "type": "module",
6
6
  "scripts": {