javascript - Angular Protractor: No specs found -


while investigating protractor got following issue:

when ran following code, didn't find specs... tests not run

describe('my app', function() {      console.log('starting test suite "guest"');      browser.get('')         .then(function () {              it('should automatically redirect', function() {                 console.log('start test 1: automatic redirection of index');                 expect(browser.getlocationabsurl()).tomatch("/test");             });          });  }); 

the redirection has been done correctly, output is:

starting selenium standalone server... [launcher] running 1 instances of webdriver selenium standalone server started @ http://192.168.10.217:50382/wd/hub starting test suite "guest" started   no specs found finished in 0.004 seconds shutting down selenium standalone server. [launcher] 0 instance(s) of webdriver still running [launcher] chrome #1 passed 

i think protractor runs through file , finds end before .then promise callback function executed , doesn't find expects.

i might doing wrong... seemed way it

your test wrapped in promise gets resolved after phase of registering tests. should be:

describe('my app', function() {      console.log('starting test suite "guest"');      it('should automatically redirect', function() {         browser.get('')         .then(function () {                 console.log('start test 1: automatic redirection of index');                 expect(browser.getlocationabsurl()).tomatch("/test");         });     }); }); 

Comments