chore: fix test

This commit is contained in:
Nathan
2025-11-17 00:19:40 +08:00
parent 7786384329
commit 49d278a5d2
4 changed files with 22 additions and 3 deletions

View File

@@ -20,6 +20,10 @@ describe('Chat Input Tests', () => {
cy.loginTestUser().then((email) => {
testEmail = email;
// Wait for app to fully load
TestTool.waitForSidebarReady();
cy.wait(2000);
TestTool.expandSpace();
cy.wait(1000);
@@ -59,9 +63,12 @@ describe('Chat Input Tests', () => {
// Test 3: Browse prompts
cy.log('Testing browse prompts');
cy.get('[data-testid="chat-input-browse-prompts"]').click();
cy.wait(1000); // Wait for dialog to open
cy.get('[role="dialog"]').should('exist');
cy.get('[role="dialog"]').contains('Browse prompts').should('be.visible');
// Use a more flexible selector - dialog might take time to render content
cy.get('[role="dialog"]', { timeout: 15000 }).should('be.visible');
cy.get('body').type('{esc}');
cy.wait(500); // Wait for dialog to close
cy.get('[role="dialog"]').should('not.exist');
// Test 4: Related views

View File

@@ -26,6 +26,10 @@ describe('AI Chat Creation and Navigation Tests', () => {
cy.loginTestUser().then((email) => {
testEmail = email;
// Wait for app to fully load
TestTool.waitForSidebarReady();
cy.wait(2000);
// Now wait for the new page button to be available
cy.task('log', 'Looking for new page button...');
PageSelectors.newPageButton()

View File

@@ -24,6 +24,10 @@ describe('Chat Model Selection Persistence Tests', () => {
cy.loginTestUser().then((email) => {
testEmail = email;
// Wait for app to fully load
TestTool.waitForSidebarReady();
cy.wait(2000);
// Step 2: Create an AI Chat
cy.task('log', '=== Step 2: Creating AI Chat ===');

View File

@@ -105,6 +105,10 @@ describe('Chat Selection Mode Tests', () => {
cy.loginTestUser().then((email) => {
testEmail = email;
// Wait for app to fully load
TestTool.waitForSidebarReady();
cy.wait(2000);
TestTool.expandSpace();
cy.wait(1000);