#{selenium 'Test the Mailer support'} open('@{Application.mail()}') assertTextPresent('OK') storeLastReceivedEmailBy('toto@localhost', 'email') store('javascript{/Subject:\s+(.*)/.exec(storedVars["email"])[1]}', 'subject') assertEquals('Yop', '$[subject]') open('@{Application.mail2()}') assertTextPresent('OK2') storeLastReceivedEmailBy('toto@localhost', 'email2') store('javascript{/Subject:\s+(.*)/.exec(storedVars["email2"])[1]}', 'subject2') assertEquals('Yop2', '$[subject2]') open('@{Application.mail3()}') assertTextPresent('OK3') storeLastReceivedEmailBy('toto@localhost', 'email3') store('javascript{/Subject:\s+(.*)/.exec(storedVars["email3"])[1]}', 'subject3') assertEquals('Yop3', '$[subject3]') open('@{Application.mail4()}') assertTextPresent('OK4') storeLastReceivedEmailBy('toto@localhost', 'email4') store('javascript{/Subject:\s+(.*)/.exec(storedVars["email4"])[1]}', 'subject4') assertEquals('Yop4', '$[subject4]') open('@{Application.mail5()}') assertTextPresent('OK5') storeLastReceivedEmailBy('test@localhost', 'email5') store('javascript{/Subject:\s+(.*)/.exec(storedVars["email5"])[1]}', 'subject5') assertEquals('test attachments', '$[subject5]') store('javascript{/name:\s+(.*)\s*/.exec(storedVars["email5"])[1]}', 'body') assertEquals('fond2.png', '$[body]') // show that // https://play.lighthouseapp.com/projects/57987/tickets/1572-playmvcmailer-setsubject-fails-on-messagesget-with // is fixed open('@{Application.mailwithpercentinsubject()}') assertTextPresent('OKPCT') open('@{Application.mailWithUrls()}') assertTextPresent('OK_mailWithUrls') storeLastReceivedEmailBy('mailWithUrls@localhost', 'mailWithUrls') //this regexp fails if text not present store('javascript{/.*(email with url to app:http:\/\/localhost:9003\/application\/showit).*/.exec(storedVars["mailWithUrls"])[1]}', 'body') open('@{Application.mailWithUrlsInJob()}') assertTextPresent('OK_mailWithUrlsInJob') storeLastReceivedEmailBy('mailWithUrlsJob@localhost', 'mailWithUrls') //this regexp fails if text not present store('javascript{/.*(email with url to app:http:\/\/my.externalhostname.com\/application\/showit).*/.exec(storedVars["mailWithUrls"])[1]}', 'body') #{/selenium}