attempt to diagnose travis-only e2e issues

This commit is contained in:
Art Lowel
2020-01-27 17:33:54 +01:00
parent ed11cb9f01
commit cab971211f
3 changed files with 25 additions and 20 deletions

View File

@@ -1,3 +1,4 @@
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();
});
});

View File

@@ -11,6 +11,6 @@ export class ProtractorPage {
}
getHomePageNewsText() {
return element(by.xpath('//ds-home-news')).getText();
return element(by.css('ds-home-news')).getText();
}
}

View File

@@ -11,15 +11,17 @@ 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) => {
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.navigateToSearch()
.then(() => page.getRandomScopeOption())
.then((scopeString: string) => {
page.navigateToSearchWithScopeParameter(scopeString);
page.getCurrentScope().then((s: string) => {
expect<string>(s).toEqual(scopeString);
@@ -28,8 +30,9 @@ describe('protractor SearchPage', () => {
});
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.navigateToSearch()
.then(() => page.getRandomScopeOption())
.then((scopeString: string) => {
page.setCurrentScope(scopeString);
page.submitSearchForm();
browser.wait(() => {