graphdb-workbench-tests 3.2.0-TR1 → 3.2.0-TR3

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/cypress.config.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { defineConfig } from 'cypress';
2
2
  import setupPlugins from './plugins/index.js';
3
+ import webpackPreprocessor from '@cypress/webpack-preprocessor';
3
4
 
4
5
  export default defineConfig({
5
6
  projectId: 'v35btb',
@@ -21,10 +22,43 @@ export default defineConfig({
21
22
  // We've imported your old cypress plugins here.
22
23
  // You may want to clean this up later by importing these.
23
24
  setupNodeEvents(on, config) {
25
+ on('file:preprocessor', webpackPreprocessor({
26
+ webpackOptions: {
27
+ resolve: {
28
+ extensions: ['.js', '.json'],
29
+ modules: ['node_modules', '.'],
30
+ fullySpecified: false,
31
+ alias: {
32
+ path: 'path-browserify'
33
+ },
34
+ fallback: {
35
+ // Provide empty mocks for Node.js core modules
36
+ path: false,
37
+ fs: false,
38
+ os: false,
39
+ crypto: false,
40
+ util: false,
41
+ buffer: false,
42
+ stream: false
43
+ }
44
+ },
45
+ module: {
46
+ rules: [
47
+ {
48
+ test: /\.js$/,
49
+ resolve: {
50
+ fullySpecified: false
51
+ }
52
+ }
53
+ ]
54
+ },
55
+ target: 'web',
56
+ }
57
+ }));
24
58
  return setupPlugins(on, config);
25
59
  },
26
60
  baseUrl: 'http://localhost:9000',
27
- specPattern: './**/*.{js,jsx,ts,tsx}',
61
+ specPattern: './**/*.js',
28
62
  supportFile: 'support/e2e.js',
29
63
  reporter: "cypress-multi-reporters",
30
64
  reporterOptions: {
@@ -190,6 +190,36 @@ describe('Ttyg ChatPanel', () => {
190
190
  .and('contain', 'completion tokens');
191
191
  });
192
192
 
193
+ it('Should abort question', () => {
194
+ // When I type a question
195
+ ChatPanelSteps.getQuestionInputElement()
196
+ .should('be.visible')
197
+ .and('not.have.attr', 'disabled');
198
+ ChatPanelSteps.getQuestionInputElement()
199
+ .type('Who is Han Solo?');
200
+
201
+ // Then I expect the "Ask" button be active
202
+ ChatPanelSteps.getAskButtonElement().should('be.enabled');
203
+
204
+ // When I click on "Ask" button
205
+ TTYGStubs.stubAnswerQuestionWithDelay();
206
+ TTYGStubs.stubCancelQuestion();
207
+ ChatPanelSteps.askQuestion();
208
+ // Then the Cancel button should become visible and the Ask button should be hidden
209
+ ChatPanelSteps.getAskButtonElement().should('not.exist');
210
+ ChatPanelSteps.getCancelButton().should('be.visible');
211
+ // When I cancel the question
212
+ ChatPanelSteps.cancelQuestion();
213
+ // Then the Cancel button should be replaced with the Ask button
214
+ ChatPanelSteps.getCancelButton().should('not.exist');
215
+ ChatPanelSteps.getAskButtonElement().should('be.visible');
216
+ // Then the default Agent response should be visible
217
+ ChatPanelSteps.getAssistantAnswer(2).invoke('text').then((text) => {
218
+ expect(text.trim()).to.equal('Request cancelled by the user.');
219
+ });
220
+ ChatPanelSteps.getAssistantIcon(2).should('not.exist');
221
+ });
222
+
193
223
  // Can't test this on CI
194
224
  it.skip('Should copy an answer when click on copy button', () => {
195
225
  // When I click on copy button
@@ -47,9 +47,10 @@ describe('TTYG create chat', () => {
47
47
  ChatPanelSteps.getAskButtonElement().should('be.enabled');
48
48
 
49
49
  // When I click on "Ask" button.
50
- TTYGStubs.stubCrateNewChat();
50
+ TTYGStubs.stubCreateNewChat();
51
51
  ChatPanelSteps.getAskButtonElement().scrollIntoView().click();
52
52
  cy.wait('@create-chat');
53
+ cy.wait('@ask-first-chat-question');
53
54
 
54
55
  // Then I expect new chat to be created in a new group "Today" and be selected
55
56
  TTYGViewSteps.getChatGroup(0).should('contain', 'Today');
@@ -0,0 +1,12 @@
1
+ {
2
+ "id": "thread_YHVy625Ir8TJkUuwy94l46Om",
3
+ "name": "New chat",
4
+ "messages": [],
5
+ "timestamp": 1756128759,
6
+ "continueRunId": null,
7
+ "usage": {
8
+ "completionTokens": 0,
9
+ "promptTokens": 0,
10
+ "totalTokens": 0
11
+ }
12
+ }
@@ -0,0 +1 @@
1
+ {"runStatus":"cancelled","message":"Request cancelled by the user."}
@@ -1,16 +1,12 @@
1
1
  {
2
- "id": "thread_new_created_chat",
3
- "name": "New chat of Han Solo is a character",
4
- "timestamp": "creationDate",
5
- "messages": [
6
- {
7
- "id": "msg_Bn07kVDCYT1qmgu1G7Zw0KNeс_",
8
- "conversationId": "thread_new_created_chat",
9
- "role": "assistant",
10
- "agentId": "asst_gAPcrHQQ9ZIxD5eXWH2BNFfo",
11
- "message": "Han Solo is a character...",
12
- "timestamp": "creationDate",
13
- "name": null
14
- }
15
- ]
2
+ "id": null,
3
+ "conversationId": "thread_new_created_chat",
4
+ "agentId": null,
5
+ "role": null,
6
+ "message": null,
7
+ "timestamp": 0,
8
+ "name": "New chat",
9
+ "usage": null,
10
+ "isTerminalState": false,
11
+ "terminalStatusCode": null
16
12
  }
@@ -0,0 +1,29 @@
1
+ {
2
+ "id": "thread_tpv1izmd9bIjxkhUiCd5x2Xz",
3
+ "name": "Hello! How can I assist you today?",
4
+ "messages": [
5
+ {
6
+ "id": "msg_drDW9OTkPkY0oGoXSdPD5qEx",
7
+ "conversationId": "thread_tpv1izmd9bIjxkhUiCd5x2Xz",
8
+ "agentId": "asst_0llP8yAJlFY2yCWrz8Ovfzjs",
9
+ "role": "assistant",
10
+ "message": "Hello! How can I assist you today?",
11
+ "timestamp": 1756129125,
12
+ "name": null,
13
+ "usage": {
14
+ "completionTokens": 11,
15
+ "promptTokens": 374,
16
+ "totalTokens": 385
17
+ },
18
+ "isTerminalState": false,
19
+ "terminalStatusCode": null
20
+ }
21
+ ],
22
+ "timestamp": 1756129125,
23
+ "continueRunId": null,
24
+ "usage": {
25
+ "completionTokens": 11,
26
+ "promptTokens": 374,
27
+ "totalTokens": 385
28
+ }
29
+ }