Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
c70b18b2
Commit
c70b18b2
authored
Aug 11, 2024
by
Jun Siang Cheah
Browse files
tests: change how cypress detects chat messages
parent
af6420e0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
cypress/e2e/chat.cy.ts
cypress/e2e/chat.cy.ts
+12
-9
No files found.
cypress/e2e/chat.cy.ts
View file @
c70b18b2
...
@@ -38,9 +38,10 @@ describe('Settings', () => {
...
@@ -38,9 +38,10 @@ describe('Settings', () => {
// User's message should be visible
// User's message should be visible
cy
.
get
(
'
.chat-user
'
).
should
(
'
exist
'
);
cy
.
get
(
'
.chat-user
'
).
should
(
'
exist
'
);
// Wait for the response
// Wait for the response
cy
.
get
(
'
.chat-assistant
'
,
{
timeout
:
120
_000
})
// .chat-assistant is created after the first token is received
// .chat-assistant is created after the first token is received
.
find
(
'
div[aria-label="Generation Info"]
'
,
{
timeout
:
120
_000
})
// Generation Info is created after the stop token is received
cy
.
get
(
'
.chat-assistant
'
,
{
timeout
:
10
_000
}).
should
(
'
exist
'
);
.
should
(
'
exist
'
);
// Generation Info is created after the stop token is received
cy
.
get
(
'
div[aria-label="Generation Info"]
'
,
{
timeout
:
120
_000
}).
should
(
'
exist
'
);
});
});
it
(
'
user can share chat
'
,
()
=>
{
it
(
'
user can share chat
'
,
()
=>
{
...
@@ -57,9 +58,10 @@ describe('Settings', () => {
...
@@ -57,9 +58,10 @@ describe('Settings', () => {
// User's message should be visible
// User's message should be visible
cy
.
get
(
'
.chat-user
'
).
should
(
'
exist
'
);
cy
.
get
(
'
.chat-user
'
).
should
(
'
exist
'
);
// Wait for the response
// Wait for the response
cy
.
get
(
'
.chat-assistant
'
,
{
timeout
:
120
_000
})
// .chat-assistant is created after the first token is received
// .chat-assistant is created after the first token is received
.
find
(
'
div[aria-label="Generation Info"]
'
,
{
timeout
:
120
_000
})
// Generation Info is created after the stop token is received
cy
.
get
(
'
.chat-assistant
'
,
{
timeout
:
10
_000
}).
should
(
'
exist
'
);
.
should
(
'
exist
'
);
// Generation Info is created after the stop token is received
cy
.
get
(
'
div[aria-label="Generation Info"]
'
,
{
timeout
:
120
_000
}).
should
(
'
exist
'
);
// spy on requests
// spy on requests
const
spy
=
cy
.
spy
();
const
spy
=
cy
.
spy
();
cy
.
intercept
(
'
GET
'
,
'
/api/v1/chats/*
'
,
spy
);
cy
.
intercept
(
'
GET
'
,
'
/api/v1/chats/*
'
,
spy
);
...
@@ -89,9 +91,10 @@ describe('Settings', () => {
...
@@ -89,9 +91,10 @@ describe('Settings', () => {
// User's message should be visible
// User's message should be visible
cy
.
get
(
'
.chat-user
'
).
should
(
'
exist
'
);
cy
.
get
(
'
.chat-user
'
).
should
(
'
exist
'
);
// Wait for the response
// Wait for the response
cy
.
get
(
'
.chat-assistant
'
,
{
timeout
:
120
_000
})
// .chat-assistant is created after the first token is received
// .chat-assistant is created after the first token is received
.
find
(
'
div[aria-label="Generation Info"]
'
,
{
timeout
:
120
_000
})
// Generation Info is created after the stop token is received
cy
.
get
(
'
.chat-assistant
'
,
{
timeout
:
10
_000
}).
should
(
'
exist
'
);
.
should
(
'
exist
'
);
// Generation Info is created after the stop token is received
cy
.
get
(
'
div[aria-label="Generation Info"]
'
,
{
timeout
:
120
_000
}).
should
(
'
exist
'
);
// Click on the generate image button
// Click on the generate image button
cy
.
get
(
'
[aria-label="Generate Image"]
'
).
click
();
cy
.
get
(
'
[aria-label="Generate Image"]
'
).
click
();
// Wait for image to be visible
// Wait for image to be visible
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment