Skip to content

Commit

Permalink
fix after changing to textarea (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
ebrehault authored Aug 22, 2024
1 parent 09169c7 commit f4b19af
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
16 changes: 11 additions & 5 deletions cypress/e2e/3-widget/search.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
searchResultContainerSelector,
searchResultTitle,
suggestionResultSelector,
viewerSelector
viewerSelector,
} from '../selectors/widget-selectors';

describe('Search', () => {
Expand All @@ -21,15 +21,21 @@ describe('Search', () => {
});

it('should show suggestions and open preview from it', () => {
cy.get(nucliaSearchBarSelector).shadow().find('.sw-search-input input').type('Lamarr');
cy.get(nucliaSearchBarSelector).shadow().find('.sw-search-input textarea').type('Lamarr');
cy.get(nucliaSearchBarSelector).shadow().find(suggestionResultSelector).should('have.length', 2);
cy.get(nucliaSearchBarSelector).shadow().find(`${suggestionResultSelector}:first-child`).click();
cy.get(nucliaSearchResultsSelector).shadow().find('.sw-viewer .header-title').should('contain', 'Lamarr Lesson plan.pdf');
cy.get(nucliaSearchResultsSelector)
.shadow()
.find('.sw-viewer .header-title')
.should('contain', 'Lamarr Lesson plan.pdf');
closeViewer();
});

it('should display results', () => {
cy.get(nucliaSearchBarSelector).shadow().find(searchBarInputSelector).type(`${firstQuestion}\n`, { force: true });
cy.get(nucliaSearchBarSelector)
.shadow()
.find(searchBarInputSelector)
.type(`${firstQuestion}\n`, { force: true });
cy.get(nucliaSearchResultsSelector)
.shadow()
.find(`${searchResultContainerSelector} ${searchResultTitle}`, { timeout: 6000 })
Expand All @@ -51,4 +57,4 @@ describe('Search', () => {
});
});
});
});
});
4 changes: 2 additions & 2 deletions cypress/e2e/selectors/widget-selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ export const answerContainerSelector = '.answer-text';
export const answerCitationSelector = '.source .number';
export const answerSourceTitleSelector = '.source .result-title';
export const chatContainerSelector = '.sw-chat .chat-container';
export const chatInputSelector = '.sw-chat-input input';
export const chatInputSelector = '.sw-chat-input textarea';
export const chatQuestionSelector = '.question';

// Viewer selectors
export const viewerSelector = '.sw-viewer';
export const searchBarInputSelector = '.sw-search-input input';
export const searchBarInputSelector = '.sw-search-input textarea';
export const findInResourceInputSelector = '.find-bar-container input';
export const closeButton = '.header-actions button[aria-label="generic.close"]';

Expand Down

0 comments on commit f4b19af

Please sign in to comment.