【发布时间】:2018-04-03 09:21:50
【问题描述】:
e2e 测试应转到特定页面并检查 URL。
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();
}
}
这是我的页面网址:
这是一个错误:
预期“http://localhost:49152/#/home”包含“帐户/订阅”。
应该很容易。我做错了什么?
【问题讨论】:
标签: angular typescript protractor e2e-testing endly