Skip to content
Snippets Groups Projects
Commit cab97121 authored by Art Lowel's avatar Art Lowel
Browse files

attempt to diagnose travis-only e2e issues

parent ed11cb9f
Branches
Tags
No related merge requests found
import { by, element } from 'protractor';
import { ProtractorPage } from './app.po';
describe('protractor App', () => {
......@@ -13,7 +14,8 @@ describe('protractor App', () => {
});
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();
});
});
......@@ -11,6 +11,6 @@ export class ProtractorPage {
}
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', () => {
const queryString = 'Interesting query string';
page.navigateToSearchWithQueryParameter(queryString);
page.getCurrentQuery().then((query: string) => {
expect<string>(query).toEqual(queryString);
});
page.navigateToSearchWithQueryParameter(queryString)
.then(() => page.getCurrentQuery())
.then((query: string) => {
expect<string>(query).toEqual(queryString);
});
});
it('should have right scope selected when navigating to page with scope parameter', () => {
const scope: promise.Promise<string> = page.getRandomScopeOption();
scope.then((scopeString: string) => {
page.navigateToSearchWithScopeParameter(scopeString);
page.getCurrentScope().then((s: string) => {
expect<string>(s).toEqual(scopeString);
page.navigateToSearch()
.then(() => page.getRandomScopeOption())
.then((scopeString: string) => {
page.navigateToSearchWithScopeParameter(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', () => {
const scope: promise.Promise<string> = page.getRandomScopeOption();
scope.then((scopeString: string) => {
page.setCurrentScope(scopeString);
page.submitSearchForm();
browser.wait(() => {
return browser.getCurrentUrl().then((url: string) => {
return url.indexOf('scope=' + encodeURI(scopeString)) !== -1;
page.navigateToSearch()
.then(() => page.getRandomScopeOption())
.then((scopeString: string) => {
page.setCurrentScope(scopeString);
page.submitSearchForm();
browser.wait(() => {
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', () => {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment