The e2e test should go to the specific page and check URL out.
app.e2e-spec.ts
import { AppPageObject } from './app.po';
describe('Subscriptions', () => {
let main: AppPageObject;
beforeEach(() => {
main = new AppPageObject();
});
it('should work', () => {
main.navigateToSubscriptions().then(() => {
main.getUrl().then(url => {
expect(url).toContain('account/subscriptions');
});
});
});
});
app.po.ts
import { browser, element, by } from 'protractor';
export class AppPageObject {
navigateToSubscriptions() {
return browser.get('/account/subscriptions');
}
getUrl() {
return browser.getCurrentUrl();
}
}
This is my page url:
This is an error:
Expected 'http://localhost:49152/#/home' to contain 'account/subscriptions'.
It should be easy. What am I doing wrong?