0

I'am facing an issue which has been posted and discussed more time here in SO. The point is that the most of the posting are a kind of not up to date.

As I'am using Angular 5 and the actual Jasmine:

"jasmine-core": "~2.6.2", "jasmine-spec-reporter": "~4.1.0",

I have been trying nearly all the provided hints and solutions, but none of them was really helpful... therefore I think it could be an issue which has to do with the Jasmine version or something similar.

I'am facing the following error when trying to run an E2E test:

- Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.

The background of my test is that I'am trying to retrieve a confirmation email for a registration process from a user inbox.

I can connect to emailBox and read the number of Emails in Inbox etc.:

`[connection] Connected to host
<= '* OK Gimap ready for requests from 87.128.111.201 t28mb25299495wrb'
=> 'A0 CAPABILITY'
<= '* CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 XYZZY SASL-IR AUTH=XOAUTH2 AUTH=PLAIN AUTH=PLAIN-CLIENTTOKEN AUTH=OAUTHBEARER AUTH=XOAUTH'
<= 'A0 OK Thats all she wrote! t28mb25299495wrb'
=> 'A1 LOGIN "myTestEmail@gmail.com" "myPassword"'
<= '* CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE ENABLE MOVE CONDSTORE ESEARCH UTF8=ACCEPT LIST-EXTENDED LIST-STATUS LITERAL- SPECIAL-USE APPENDLIMIT=35651584'
<= 'A1 OK myTestEmail@gmail.com authenticated (Success)'
=> 'A2 NAMESPACE'
<= '* NAMESPACE (("" "/")) NIL NIL'
<= 'A2 OK Success'
=> 'A3 LIST "" ""'
<= '* LIST (\\Noselect) "/" "/"'
<= 'A3 OK Success'
=> 'A4 SELECT "INBOX" (CONDSTORE)'
<= '* FLAGS (\\Answered \\Flagged \\Draft \\Deleted \\Seen $NotPhishing $Phishing)'
<= '* OK [PERMANENTFLAGS (\\Answered \\Flagged \\Draft \\Deleted \\Seen $NotPhishing $Phishing \\*)] Flags permitted.'
<= '* OK [UIDVALIDITY 1] UIDs valid.'
<= '* 200 EXISTS'
<= '* 0 RECENT'
<= '* OK [UIDNEXT 291] Predicted next UID.'
<= '* OK [HIGHESTMODSEQ 21808]'
<= 'A4 OK [READ-WRITE] INBOX selected. (Success)'
imapConnected
=> 'IDLE IDLE'
<= '+ idling'
....
....
Still waiting for an email...
<= '* 201 EXISTS'
=> DONE
<= 'IDLE OK IDLE terminated (Success)'
=> 'A5 UID SEARCH UNSEEN FLAGGED'
<= '* SEARCH'
<= 'A5 OK SEARCH completed (Success)'
=> 'IDLE IDLE'
<= '+ idling'`

but what I can't get is the email content including the link in it, and this is the stage where I'am stuck. For this I'am trying to invoke a function getLastEmail():

it("should retrieve email content and login with a registration code sent to an email", function () {
  browser.controlFlow().wait(browser.params.getLastEmail()).then(function (email) {
            expect(email['subject']).toEqual("New Registration Code");
            expect(email['headers']).toEqual("myTestEmail@gmail.com");

            console.log('EMAIL CONTENT: ' + email['text']);

         });
 }); 

And this is exactly the function which can't be invoked and where the process break and throws the error above.

I actually following this posting which is quite helpful.

Any idea how to fix this and work around it? I might also be something wrong with my code... in this case I would post it here.

k.vincent
  • 3,743
  • 8
  • 37
  • 74
  • Seems like your test isn't finishing. If you see your console log, could you try using this : `it("should ...", function (done) {`, and add this under your console log : `done();` ? Otherwise, sorry, I can't help you, I don't know what you're doing so I can't really write a test for you :/ –  Feb 13 '18 at 09:15
  • @trichetriche: I have been trying the hint with `done()` but unfortunately it didn't help. As I said I'am trying to get the email and its content from inbox. User registers, an Email is sent to the user with a confirmation link. After that I want to retrieve this confirmation email, read get its content and extract the link from it. – k.vincent Feb 13 '18 at 09:29

0 Answers0