Skip to content

Commit

Permalink
test: update tests for sidecar integration
Browse files Browse the repository at this point in the history
Signed-off-by: tygao <[email protected]>
  • Loading branch information
raintygao committed Mar 19, 2024
1 parent f26ea2d commit 41b63b1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,11 @@ if (Cypress.env('DASHBOARDS_ASSISTANT_ENABLED')) {
});

it('trace page display correctly in fullscreen mode', () => {
cy.get(`.llm-chat-flyout-header`)
.find(`button[aria-label="fullScreen"]`)
.click({ force: true });
// switch to takeover mode for fullscreen
cy.get('[id="sidecarModeIcon"]').click();
cy.get(
'[data-test-subj="sidecar-mode-icon-menu-item-takeover"]'
).click();

// show close button
cy.get(`.llm-chat-flyout .llm-chat-flyout-body`).as('tracePage');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,12 @@ if (Cypress.env('DASHBOARDS_ASSISTANT_ENABLED')) {
cy.get('textarea[placeholder="Ask me anything..."]').should('exist');
});

it('should hide back button in fullscreen mode', () => {
cy.get('.llm-chat-flyout button[aria-label="fullScreen"]').click();
it('should hide back button in takeover fullscreen mode', () => {
//switch to takeover mode for fullscreen
cy.get('[id="sidecarModeIcon"]').click();
cy.get(
'[data-test-subj="sidecar-mode-icon-menu-item-takeover"]'
).click();
cy.get('.llm-chat-flyout button[aria-label="history"]').click();

cy.get('.llm-chat-flyout')
Expand All @@ -91,8 +95,9 @@ if (Cypress.env('DASHBOARDS_ASSISTANT_ENABLED')) {
.contains('Back', { timeout: 3000 })
.should('not.exist');

// Back to default mode
cy.get('.llm-chat-flyout button[aria-label="fullScreen"]').click();
// Switch to default docked right mode
cy.get('[id="sidecarModeIcon"]').click();
cy.get('[data-test-subj="sidecar-mode-icon-menu-item-right"]').click();
cy.get('.llm-chat-flyout button[aria-label="history"]').click();
});
});
Expand Down

0 comments on commit 41b63b1

Please sign in to comment.