79327: Follow up fixes to test

This commit is contained in:
Yana De Pauw
2021-05-20 10:45:14 +02:00
parent 926dd46627
commit 579f98d027
2 changed files with 7 additions and 7 deletions

View File

@@ -1,5 +1,6 @@
import { ProtractorPage } from './item-statistics.po'; import { ProtractorPage } from './item-statistics.po';
import { browser } from 'protractor'; import { browser } from 'protractor';
import { UIURLCombiner } from '../../../src/app/core/url-combiner/ui-url-combiner';
describe('protractor Item statics', () => { describe('protractor Item statics', () => {
let page: ProtractorPage; let page: ProtractorPage;
@@ -16,7 +17,9 @@ describe('protractor Item statics', () => {
it('should redirect to the entity page when navigating to an item page', () => { it('should redirect to the entity page when navigating to an item page', () => {
page.navigateToItemPage(); page.navigateToItemPage();
expect(browser.getCurrentUrl()).toEqual('http://localhost:4000' + page.ENTITYPAGE); expect(browser.getCurrentUrl()).toEqual(new UIURLCombiner(page.ENTITYPAGE).toString());
expect(browser.getCurrentUrl()).not.toEqual(new UIURLCombiner(page.ITEMSTATISTICSPAGE).toString());
expect(browser.getCurrentUrl()).not.toEqual(new UIURLCombiner(page.ITEMPAGE).toString());
}); });
it('should contain element ds-item-statistics-page when navigating when navigating to an item statistics page', () => { it('should contain element ds-item-statistics-page when navigating when navigating to an item statistics page', () => {
@@ -26,6 +29,8 @@ describe('protractor Item statics', () => {
}); });
it('should contain the item statistics page url when navigating to an item statistics page', () => { it('should contain the item statistics page url when navigating to an item statistics page', () => {
page.navigateToItemStatisticsPage(); page.navigateToItemStatisticsPage();
expect(browser.getCurrentUrl()).toEqual('http://localhost:4000' + page.ITEMSTATISTICSPAGE); expect(browser.getCurrentUrl()).toEqual(new UIURLCombiner(page.ITEMSTATISTICSPAGE).toString());
expect(browser.getCurrentUrl()).not.toEqual(new UIURLCombiner(page.ENTITYPAGE).toString());
expect(browser.getCurrentUrl()).not.toEqual(new UIURLCombiner(page.ITEMPAGE).toString());
}); });
}); });

View File

@@ -15,9 +15,4 @@ export class ProtractorPage {
elementTagExists(tag: string) { elementTagExists(tag: string) {
return element(by.tagName(tag)).isPresent(); return element(by.tagName(tag)).isPresent();
} }
verifyCurrentUrl(url) {
browser.getCurrentUrl().then((currentUrl) => currentUrl === url );
}
} }