2017-01-09 42 views
0

當我執行1個spec文件時,出現以上錯誤消息below.i已將所有腳本超時設置爲300000.在執行conf.js時,發出錯誤消息'異步回調未在jasmine.DEFAULT_TIMEOUT_INTERVAL指定的超時時間內調用'

//Scenario 8: Verify Alert message when the user enter the unregistered email Id and other fields. 
it('Verify Alert message when New user registered itself for the first time',function() { 
    FuncLib.ButtonClick('Close'); //Close the error message displayed in previous scenario 
    Registration.Email.clear(); //Clear valid E-mail Id 
    Registration.Password.clear(); //Clear Password 
    Registration.ConfirmPassword.clear(); //Clear Confirm Password 
    Registration.Firstname.clear(); //clear Firstname Password 
    Registration.Lastname.clear(); //clear Lastname Password 
    Registration.Phonenumber.clear(); //clear phonenumber 
    browser.sleep(500); 
    Registration.Email.sendKeys('[email protected]'); //Enter valid E-mail Id 
    Registration.Password.sendKeys('Hello1'); //Enter Password 
    Registration.ConfirmPassword.sendKeys('Hello1'); //Enter wrong Confirm Password 
    Registration.Firstname.sendKeys('candy'); //Enter Firstname Password 
    Registration.Lastname.sendKeys('smith'); //Enter Lastname Password 
    Registration.Phonenumber.sendKeys('9191919106'); //Enter phone number. 
    expect(Registration.Checkbox.isPresent()).toBe(true); // Terms and condition checkbox should display 
    Registration.Checkbox.click(); // select the Terms and condition checkbox 
    Registration.Checkbox.click(); // select the Terms and condition checkbox 
    browser.sleep(200); 
     expect(Registration.RegisterButton.isPresent()).toBe(true); 
     Registration.RegisterButton.click(); //click Register button 
     browser.sleep(200); 
      browser.driver.wait(function() { // Wait for the current URL to change to Home page 
       return browser.driver.getCurrentUrl().then(function(url) { 
        return (/home/).test(url); 
       }); 
      }); 
      expect(browser.getCurrentUrl()).toEqual(Registration.HomeURL); 
      console.log('When New user registered itself for the first time:'); 
       expect(Registration.AlertMsg.getText()).toEqual(Registration.msg6); 
       Registration.AlertMsg.getText().then(function(text) { 
       console.log(' When New user registered itself for the first time:'); //Jasmine expect statement : compare actual and expected value 
       }); 
});    
+0

該格式不是很有幫助。你可以嘗試調用最後完成的茉莉花功能(完成){.... Registration.AlertMsg.getText()。然後(函數(文本){完成()' –

回答

2

這是由於茉莉花默認超時。您可以使用以下代碼在conf.js文件中增加它:

jasmineNodeOpts: { 
    showColors: true, 
    includeStackTrace: true, 
    defaultTimeoutInterval: 1440000//Increase the default jasmine time 
            //interval. 
}, 
+0

你好suresh,我試過後設置defaultTimeoutInterval:1440000.但它不起作用。如果你有任何其他解決方案比plz分享給我。 – user7132782

相關問題