Skip to content

Commit

Permalink
Wait for chat-input to toggle in chat_profile E2E test (#1468)
Browse files Browse the repository at this point in the history
Increase reliability of test while increasing performance.

---------

Co-authored-by: Mathijs de Bruin <[email protected]>
  • Loading branch information
jfperusse-bhvr and dokterbob authored Nov 7, 2024
1 parent fcf51c7 commit aa146db
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cypress/e2e/chat_profiles/spec.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ describe('Chat profiles', () => {
cy.get('[data-test="select-item:GPT-4"]').click();
cy.get('#confirm').click();

cy.wait(1000);
cy.get('#chat-input').should('have.attr', 'disabled');
cy.get('#chat-input').should('not.have.attr', 'disabled');
cy.get('#starter-ask-for-help').should('exist').click();

cy.get('.step')
Expand Down Expand Up @@ -78,7 +79,9 @@ describe('Chat profiles', () => {
cy.get('#chat-profile-selector').parent().click();

// Force hover over GPT-4 profile to show description
cy.get('[data-test="select-item:GPT-4"]').trigger('mouseover', { force: true });
cy.get('[data-test="select-item:GPT-4"]').trigger('mouseover', {
force: true
});

// Wait for the popover to appear and check its content
cy.get('#chat-profile-description').within(() => {
Expand Down Expand Up @@ -111,6 +114,8 @@ describe('Chat profiles', () => {

// Select GPT-4 profile
cy.get('[data-test="select-item:GPT-4"]').click();
cy.get('#chat-input').should('have.attr', 'disabled');
cy.get('#chat-input').should('not.have.attr', 'disabled');

// Verify the profile has been changed
submitMessage('hello');
Expand All @@ -121,6 +126,5 @@ describe('Chat profiles', () => {
'contain',
'starting chat with admin using the GPT-4 chat profile'
);

});
});

0 comments on commit aa146db

Please sign in to comment.