Protractor: expires after 10,000 ms, waiting for the specification to complete

I have several translator tests, and sometimes I get an error message:

Message:
     timeout: timed out after 10000 msec waiting for spec to complete
   Stacktrace:
     undefined

This can happen randomly on some tests. I usually test on BrowserStack, and it shows an error once in 3-5 builds. But lately I tried SauceLabs and almost everyone (everyone!), But not all tests fail with this error. SauceLabs is probably just much slower, so I get the error more often ...

So here are the questions:

  • Is there a way in Protractor / Selenium to change the test run time? It should also be changed to BrowserStack / Saucelabs.
  • Why do I often get an error? Is there something wrong with my trials? Most of them do not seem complicated or lengthy. Again, on a local machine, this is almost always fine.

:

   it('should check that login gives error on empty or incorrect email', function () {
      p.get('/#/login');
      p.findElement(protractor.By.css('button[type="submit"]')).click();
      expect(p.findElement(protractor.By.css('.alert-danger')).getText()).toEqual('E-mailadres is niet geldig');
      p.findElement(protractor.By.model('user.email')).sendKeys('test-1xtc.vc');
      p.findElement(protractor.By.css('button[type="submit"]')).click();
      expect(p.findElement(protractor.By.css('.alert-danger')).getText()).toEqual('E-mailadres is niet geldig');
      p.findElement(protractor.By.model('user.email')).clear();
    });

AngularJS, 2.20, 0.20.1

+4
5

Protractor/Selenium ?

:) allScriptsTimeout Protractor ( )

defaultTimeoutInterval jasmineNodeOpts ( Protractor referenceConf.js)

? - ? . , .

, . .

+3

angularjs? - - $interval $timeout? , $interval $timeout "count" 1, (https://docs.angularjs.org/api/ng/service/ $ # ). , .

+2

, config, .

getPageTimeout : 100000 //in millis, i.e., 100 secs
+1

saucelabs 90 , . conf.js, idleTimeout, .

idleTimeout = 90; // equals 90 seconds

  exports.config = {
  //Includes test sub-sub-foldersbefore any tests in sub folders 
  specs: ['tests/*/*/*.js', 'tests/*/*.js', ],


  // use jasmine 2
  framework: 'jasmine2',
  capabilities :  {
                browserName: "chrome",
                // this takes seconds so 120 would be 120 seconds.
                idleTimeout = 120;
            },
},

, spec, spec , , saucelabs idleTimeout , saucelabs. saucelabs , DEFAULT_TIMEOUT_INTERVAL , .

// this takes in miliseconds so 1000 = 1 second
jasmine.DEFAULT_TIMEOUT_INTERVAL = 120000;
0

- , .. it . , - (it) - , .

: - , : it(description, testFn, timeout_in_millis)

it('description of test case', function() {
   /*your test 
               steps
                    here*/
},120000);//120 seconds timeout for this spec

0
source

Source: https://habr.com/ru/post/1534245/


All Articles