how to set $interval instead of timeout in Protractor Tests #1929
Description
I am working on iOS Hybrid app automation using appium and Protractor. I am using the timeout in my config.js file but getting the errors: Below are my config.js and spec.js file.
Kindly advise on how to use $interval instead of timeout.
Config.js:
exports.config = { allScriptsTimeout: 30000 , getPageTimeout: 30000 , ignoreSynchronization: true , seleniumAddress: 'http://localhost:4723/wd/hub',
specs: ['PageObjectSpec.js'],
capabilities: {
browserName: 'iOS' ,
'appium-version':'1.3.4',
platformName:'iOS' ,
platformVersion: 7.1 ,
deviceName:'iPhone' ,
autoWebview:true ,
},
baseUrl: 'http://localhost:8000',
jasmineNodeOpts: {showColors: true, defaultTimeoutInterval:60000} ,
onPrepare: function() {
browser.manage().timeouts().setScriptTimeout(60000);
},
};
Spec.js file::
'use strict';
describe('Abbvie app test', function()
{
var userName = browser.element(by.model('credentials.username'));
var passwd = browser.element(by.model('credentials.password'));
var signin = browser.element(by.buttonText('Sign In'));
it('Login Page test', function()
{
userName.click();
//userName.sendKeys(name)
passwd.click();
//passwd.sendKeys(pass)
signin.click();
}, 60000);
});
**Protractor Log:**Using the selenium server at
http://localhost:4723/wd/hub
[launcher] Running 1 instances of WebDriver
A Jasmine spec timed out. Resetting the WebDriver Control Flow.
The last active task was:
Protractor.waitForAngular()
at [object Object].webdriver.WebDriver.schedule (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:345:15)
at [object Object].Protractor.executeAsyncScript_ (/usr/local/lib/node_modules/protractor/lib/protractor.js:251:26)
at [object Object].Protractor.waitForAngular (/usr/local/lib/node_modules/protractor/lib/protractor.js:274:15)
at [object Object].getWebElements (/usr/local/lib/node_modules/protractor/lib/element.js:136:19)
at [object Object].getWebElements (/usr/local/lib/node_modules/protractor/lib/element.js:669:31)
at [object Object].ElementArrayFinder.applyAction_ (/usr/local/lib/node_modules/protractor/lib/element.js:391:28)
at [object Object].self.(anonymous function) as click
at [object Object].self.(anonymous function) as click
at [object Object]. (/Users/qualcomm/Desktop/ProtractorTest/PageObjectSpec.js:13:11)
F
Failures:
- Abbvie app test Login Page test
Message:
timeout: timed out after 60000 msec waiting for spec to complete
Stacktrace:
undefined
Finished in 65.404 seconds
1 test, 1 assertion, 1 failure
[launcher] 0 instance(s) of WebDriver still running
[launcher] iOS #1 failed 1 test(s)
[launcher] overall: 1 failed spec(s)
[launcher] Process exited with error code 1