mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00

Squashed: 66021: Expandable search form in header 66021: Adjustment small screens 66021: search icon now pressable and css partially moved to bootstrap classes 66021: start testing of header search box; TODO fix e2e 66021: E2E Tests 66021: Header search box now with angular animation and bootstrap > css; e2e fix 66021: feedback 2019-12-19 style changes 66021: Fix navbar search tests Patch: add opacity to header search animation Change the input style 66021: expandable search navbar - tests 66021: Expandable search form in header Small fix after rebasing upstream/master
47 lines
1.3 KiB
TypeScript
47 lines
1.3 KiB
TypeScript
import { ProtractorPage } from './search-navbar.po';
|
|
import { browser } from 'protractor';
|
|
|
|
describe('protractor SearchNavbar', () => {
|
|
let page: ProtractorPage;
|
|
let queryString: string;
|
|
|
|
beforeEach(() => {
|
|
page = new ProtractorPage();
|
|
queryString = 'the test query';
|
|
});
|
|
|
|
it('should go to search page with correct query if submitted (from home)', () => {
|
|
page.navigateToHome();
|
|
return checkIfSearchWorks();
|
|
});
|
|
|
|
it('should go to search page with correct query if submitted (from search)', () => {
|
|
page.navigateToSearch();
|
|
return checkIfSearchWorks();
|
|
});
|
|
|
|
it('check if can submit search box with pressing button', () => {
|
|
page.navigateToHome();
|
|
page.expandAndFocusSearchBox();
|
|
page.setCurrentQuery(queryString);
|
|
page.submitNavbarSearchForm();
|
|
browser.wait(() => {
|
|
return browser.getCurrentUrl().then((url: string) => {
|
|
return url.indexOf('query=' + encodeURI(queryString)) !== -1;
|
|
});
|
|
});
|
|
});
|
|
|
|
function checkIfSearchWorks(): boolean {
|
|
page.setCurrentQuery(queryString);
|
|
page.submitByPressingEnter();
|
|
browser.wait(() => {
|
|
return browser.getCurrentUrl().then((url: string) => {
|
|
return url.indexOf('query=' + encodeURI(queryString)) !== -1;
|
|
});
|
|
});
|
|
return false;
|
|
}
|
|
|
|
});
|