mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
attempt to diagnose travis-only e2e issues
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import { by, element } from 'protractor';
|
||||||
import { ProtractorPage } from './app.po';
|
import { ProtractorPage } from './app.po';
|
||||||
|
|
||||||
describe('protractor App', () => {
|
describe('protractor App', () => {
|
||||||
@@ -13,7 +14,8 @@ describe('protractor App', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should contain a news section', () => {
|
it('should contain a news section', () => {
|
||||||
page.navigateTo();
|
page.navigateTo()
|
||||||
|
.then(() => element(by.css('.main-content')).getAttribute('innerHTML').then((v) => process.stdout.write(v)));
|
||||||
expect<any>(page.getHomePageNewsText()).toBeDefined();
|
expect<any>(page.getHomePageNewsText()).toBeDefined();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -11,6 +11,6 @@ export class ProtractorPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getHomePageNewsText() {
|
getHomePageNewsText() {
|
||||||
return element(by.xpath('//ds-home-news')).getText();
|
return element(by.css('ds-home-news')).getText();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -11,33 +11,36 @@ describe('protractor SearchPage', () => {
|
|||||||
|
|
||||||
it('should contain query value when navigating to page with query parameter', () => {
|
it('should contain query value when navigating to page with query parameter', () => {
|
||||||
const queryString = 'Interesting query string';
|
const queryString = 'Interesting query string';
|
||||||
page.navigateToSearchWithQueryParameter(queryString);
|
page.navigateToSearchWithQueryParameter(queryString)
|
||||||
page.getCurrentQuery().then((query: string) => {
|
.then(() => page.getCurrentQuery())
|
||||||
expect<string>(query).toEqual(queryString);
|
.then((query: string) => {
|
||||||
});
|
expect<string>(query).toEqual(queryString);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have right scope selected when navigating to page with scope parameter', () => {
|
it('should have right scope selected when navigating to page with scope parameter', () => {
|
||||||
const scope: promise.Promise<string> = page.getRandomScopeOption();
|
page.navigateToSearch()
|
||||||
scope.then((scopeString: string) => {
|
.then(() => page.getRandomScopeOption())
|
||||||
page.navigateToSearchWithScopeParameter(scopeString);
|
.then((scopeString: string) => {
|
||||||
page.getCurrentScope().then((s: string) => {
|
page.navigateToSearchWithScopeParameter(scopeString);
|
||||||
expect<string>(s).toEqual(scopeString);
|
page.getCurrentScope().then((s: string) => {
|
||||||
|
expect<string>(s).toEqual(scopeString);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should redirect to the correct url when scope was set and submit button was triggered', () => {
|
it('should redirect to the correct url when scope was set and submit button was triggered', () => {
|
||||||
const scope: promise.Promise<string> = page.getRandomScopeOption();
|
page.navigateToSearch()
|
||||||
scope.then((scopeString: string) => {
|
.then(() => page.getRandomScopeOption())
|
||||||
page.setCurrentScope(scopeString);
|
.then((scopeString: string) => {
|
||||||
page.submitSearchForm();
|
page.setCurrentScope(scopeString);
|
||||||
browser.wait(() => {
|
page.submitSearchForm();
|
||||||
return browser.getCurrentUrl().then((url: string) => {
|
browser.wait(() => {
|
||||||
return url.indexOf('scope=' + encodeURI(scopeString)) !== -1;
|
return browser.getCurrentUrl().then((url: string) => {
|
||||||
|
return url.indexOf('scope=' + encodeURI(scopeString)) !== -1;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should redirect to the correct url when query was set and submit button was triggered', () => {
|
it('should redirect to the correct url when query was set and submit button was triggered', () => {
|
||||||
|
Reference in New Issue
Block a user