量角器测试超时,因为angular 2应用程序SPA未调用异步回调

量角器测试超时,因为angular 2应用程序SPA未调用异步回调,angular,protractor,jasmine2.0,Angular,Protractor,Jasmine2.0,我们正在使用angular cli构建SPA,我们要验证登录页面上的控件(用户名、密码和登录),但在登录/重定向到另一个组件后,我会收到错误消息 错误:超时-在超时内未调用异步回调 由jasmine指定。默认超时时间间隔。“ 对于任何类型的操作,如单击注销按钮或验证用户标签。我们只有一个app.com.html,可以使用重定向另一个.com.html 这是我的样本规范代码 beforeAll(() => { loginPage = new LoginPage(); loginPage.na

我们正在使用angular cli构建SPA,我们要验证登录页面上的控件(用户名、密码和登录),但在登录/重定向到另一个组件后,我会收到错误消息

错误:超时-在超时内未调用异步回调 由jasmine指定。默认超时时间间隔。“

对于任何类型的操作,如单击注销按钮或验证用户标签。我们只有一个app.com.html,可以使用
重定向另一个.com.html

这是我的样本规范代码

beforeAll(() => {
loginPage = new LoginPage();
loginPage.navigateTo();
expect(browser.getCurrentUrl()).toMatch('/');
loginPage.login(testData.validAgentID, testData.validDeviceID);
browser.waitForAngular();
userPage = new UserPage();
// browser.angularAppRoot('sp-app');
});
beforeEach(() => {
//
});
it('should be able to see Logout button at the bottom', function (done) {
expect(userPage.getLogoutButton().getText()).toEqual('logout'); Failing
done();
});

it('should be able to see Logout button at the bottom', () => {
expect(userPage.getLogoutButton().getText()).toEqual('logout'); Failing
});

it('should be able to see Logout button at the bottom', () => {
userPage.getLogoutButton().getText().then((txt)=> {
expect(txt).toEqual('logout');   Failing
});
});

beforeAll(() => {
loginPage = new LoginPage();
loginPage.navigateTo();
expect(browser.getCurrentUrl()).toMatch('/');
browser.waitForAngular();
userPage = new UserPage();
// browser.angularAppRoot('sp-app');
});
beforeEach(() => {
//
});
it('should be able to verify title', () => {
expect(userPage.getTitle.getText()).toEqual('My App');   This is working fine
});

Tried all possible options to make my verification 

"@angular/cli": "^1.0.0-beta.32.3",
"@angular/compiler-cli": "^2.3.1",
"@types/jasmine": "^2.5.38",
"@types/jasminewd2": "^2.0.1",
"protractor": "^5.1.1",

您能否清理帖子的格式并提供userPage.getLogoutButton()代码?让我从一个基本建议开始。。您是否尝试增加Jasmine超时设置值,看看这是否有帮助
defaultTimeoutInterval:120000
@adityareddy,我已经设置了30秒的defaultTimeoutInterval.config。请查找注销代码getLogoutButton(){return元素(by.id('btnLogout');//return this.logOutButtonElement;}您能清理post的格式并提供userPage.getLogoutButton()吗代码?让我从一个基本建议开始。。您是否尝试增加Jasmine超时设置值,看看这是否有帮助
defaultTimeoutInterval:120000
@adityareddy,我已设置了30秒的defaultTimeoutInterval.config。请查找注销代码getLogoutButton(){return元素(by.id('btnLogout'));//返回此.logOutButtonElement;}