Skip to content

[Testing:Forum] Add Live Chat End to End Testing#11818

Merged
bmcutler merged 131 commits intomainfrom
live_chat_roon_cypress
Jul 19, 2025
Merged

[Testing:Forum] Add Live Chat End to End Testing#11818
bmcutler merged 131 commits intomainfrom
live_chat_roon_cypress

Conversation

@martig7
Copy link
Copy Markdown
Contributor

@martig7 martig7 commented Jun 27, 2025

Why is this Change Important & Necessary?

Currently Live Chat has no testing. For future development and future developers, end to end testing is necessary.

What is the New Behavior?

Tests are now added at live_chat.spec.js

What steps should a reviewer take to reproduce or test the bug or new feature?

Tests can be run locally through Cypress at live_chat.spec.js

Automated Testing & Documentation

The current e2e documentation is sufficient.

Other information

In the future I would like to directly test the websocket elements of this feature.

bmcutler pushed a commit that referenced this pull request Jul 10, 2025
### Why is this Change Important & Necessary?
We want to see chatroom information in database so that professors can
check chatrooms even after they're deleted. Before deleting a chatroom
would delete it from db.

### What is the New Behavior?
Now a chatroom is kept in db, but a parameter labeled is_deleted is
switched from false to true, which prevents the chatroom from showing.

### What steps should a reviewer take to reproduce or test the bug or
new feature?
On main, create and delete a chat. Then, go to sql toolbox and query
SELECT * FROM chatrooms. That chatroom should not exist in db anymore.
Switch to this branch, and do the same. The chatroom should still show,
but with a new column labelled "is_deleted" set to true instead of
false.

### Automated Testing & Documentation
Deleting chats will be tested once #11818 is merged

---------

Co-authored-by: Alex Lavallee <73203142+lavalleeale@users.noreply.github.com>
@martig7 martig7 requested a review from jeffrey-cordero July 15, 2025 19:43
Copy link
Copy Markdown
Member

@IDzyre IDzyre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks decent to me, apart from a couple of redundant .should() statements.

If you really want to assert that it exists, you can split the statements, but that is redundant as well.

Comment on lines +139 to +143
cy.get('[data-testid="chatroom-name-entry"]').should('exist').type(title, { force: true });
cy.get('[data-testid="chatroom-description-entry"]').should('exist').type(description, { force: true });
if (!isAnon) {
cy.get('[data-testid="enable-disable-anon"]').should('exist').click();
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.should('exist')... is redundant, because if it doesn't exist, then it will fail anyway, and if it does exist, it will pass without the .should('exist').

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

@github-project-automation github-project-automation bot moved this from In Review to Work in Progress in Submitty Development Jul 17, 2025
@automateprojectmangement automateprojectmangement bot moved this from Work in Progress to In Review in Submitty Development Jul 18, 2025
Copy link
Copy Markdown
Contributor

@jeffrey-cordero jeffrey-cordero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Live Chat Cypress tests look good.

williamschen23 pushed a commit that referenced this pull request Jul 18, 2025
### Why is this Change Important & Necessary?
We want to see chatroom information in database so that professors can
check chatrooms even after they're deleted. Before deleting a chatroom
would delete it from db.

### What is the New Behavior?
Now a chatroom is kept in db, but a parameter labeled is_deleted is
switched from false to true, which prevents the chatroom from showing.

### What steps should a reviewer take to reproduce or test the bug or
new feature?
On main, create and delete a chat. Then, go to sql toolbox and query
SELECT * FROM chatrooms. That chatroom should not exist in db anymore.
Switch to this branch, and do the same. The chatroom should still show,
but with a new column labelled "is_deleted" set to true instead of
false.

### Automated Testing & Documentation
Deleting chats will be tested once #11818 is merged

---------

Co-authored-by: Alex Lavallee <73203142+lavalleeale@users.noreply.github.com>
Copy link
Copy Markdown
Member

@IDzyre IDzyre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests look good to me, didn't run them locally. There are a few things you could do differently, but what is here works, and it's not worth getting to the little things.

@github-project-automation github-project-automation bot moved this from In Review to Awaiting Maintainer Review in Submitty Development Jul 19, 2025
@IDzyre IDzyre moved this from Awaiting Maintainer Review to Ready to Merge in Submitty Development Jul 19, 2025
@bmcutler bmcutler merged commit 3481a69 into main Jul 19, 2025
25 checks passed
@bmcutler bmcutler deleted the live_chat_roon_cypress branch July 19, 2025 04:21
@github-project-automation github-project-automation bot moved this from Ready to Merge to Done in Submitty Development Jul 19, 2025
bmcutler pushed a commit that referenced this pull request Aug 15, 2025
### Why is this Change Important & Necessary?
Before, the way we handled chatroom toggles worked well for the standard
usage of chatrooms, with an instructor broadcasting chatroom enable and
a student receiving chatroom enabling, which then triggers a row insert.
This had the negative side effect of being difficult to update the
chatroom row style because we had to make changes in two places.
Additionally, since the templates were separate the output was
inconsistent depending on what role you had, causing buggy looking
chatroom rows.

### What is the New Behavior?
Now, a public template named ChatroomRow is added, which is rendered
using twig.js. When a chatroom is updated it will delete the row and
recreate it using the twig template.

### What steps should a reviewer take to reproduce or test the bug or
new feature?
Open two chatroom list pages logged in as instructor, create and start a
chatroom session. It should look buggy/not add the chatroom at all. On
this branch it should function as expected between two instructor
windows.

### Automated Testing & Documentation
This is now tested through #11818, and I added websocket enable and
disable tests, meaning that the websocket features of live chat would be
fully tested up to now.

### Other information
Potential TODO use vue instead of Twig.js

---------

Co-authored-by: Justin Manion <jmanion32@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants