Skip to content

Commit

Permalink
Add comments and remove only
Browse files Browse the repository at this point in the history
Signed-off-by: Lin Wang <[email protected]>
  • Loading branch information
wanglam committed Jan 26, 2024
1 parent 4a31986 commit 9db1baa
Showing 1 changed file with 25 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,20 @@ if (Cypress.env('DASHBOARDS_ASSISTANT_ENABLED')) {
'home:newThemeModal:show',
'false'
);

// Open assistant flyout
cy.get('body').then(($body) => {
if ($body.find('.llm-chat-flyout').length === 0) {
/**
* Use cypress.get.click got CypressError(element detached from the DOM), like
* https://github.com/opensearch-project/opensearch-dashboards-functional-test/actions/runs/7663718989/job/20887600834
* use native js call instead.
**/
$body
.find('img[aria-label="toggle chat flyout icon"]')
.trigger('click');
}
});
});
after(() => {
if (restoreShowHome) {
Expand All @@ -37,20 +51,19 @@ if (Cypress.env('DASHBOARDS_ASSISTANT_ENABLED')) {
if (restoreNewThemeModal) {
restoreNewThemeModal();
}
});

// beforeEach(() => {
// // Open Chat assistant flyout
// cy.get('img[aria-label="toggle chat flyout icon"]').click();
// });

// afterEach(() => {
// // Close Chat assistant flyout
// cy.get('img[aria-label="toggle chat flyout icon"]').click();
// });
// Close assistant flyout
cy.get('body').then(($body) => {
if ($body.find('.llm-chat-flyout').length !== 0) {
$body
.find('img[aria-label="toggle chat flyout icon"]')
.trigger('click');
}
});
});

describe('panel operations', () => {
it.only('should toggle history list', () => {
it('should toggle history list', () => {
// Visit OSD
cy.visit(`${BASE_PATH}/app/home`);
// Common text to wait for to confirm page loaded, give up to 60 seconds for initial load
Expand All @@ -74,12 +87,6 @@ if (Cypress.env('DASHBOARDS_ASSISTANT_ENABLED')) {
cy.get('.llm-chat-flyout-body')
.contains('Conversations')
.should('not.be.visible');

cy.get('body').then(($body) => {
$body
.find('img[aria-label="toggle chat flyout icon"]')
.trigger('click');
});
});

it('should back to chat panel', () => {
Expand Down Expand Up @@ -109,7 +116,7 @@ if (Cypress.env('DASHBOARDS_ASSISTANT_ENABLED')) {
cy.get('.llm-chat-flyout button[aria-label="history"]').click();
});
});
describe.skip('history item operations', () => {
describe('history item operations', () => {
const conversations = [];

before(() => {
Expand Down

0 comments on commit 9db1baa

Please sign in to comment.