0
我測試發送憑據的API一個登錄頁面,如果失敗或「[email protected]」成功返回無論是「錯誤」。如果響應是成功的,我希望它重定向到另一頁。到目前爲止,這是我寫的,有人可以幫我解決這個問題?因爲現在它顯示請求的結果。離子量角器測試,使得GET請求
描述( '登錄按鈕點擊',()的函數 { 變種的用戶名,密碼,loginbutton
beforeEach(function(){
browser.get('#/loginPage');
username= element(by.id('username'));
password= element(by.id('password'));
loginButton= element(by.id('loginButton'));
});
it('should validate the credentials for a successful login and display the recommended view', function() {
//
username.sendKeys('[email protected]');
password.sendKeys('abc12345');
loginButton.click().then(function()
{
browser.get('http://website.com/api/[email protected]&password=abc12345')
expect(browser.driver.getCurrentUrl()).toMatch('/menu.recommendedJobs')
},10000)
})