Esempio n. 1
0
 /**
  * Send an actual email using local credentials and then assert that the email was received
  * by using imap_search
  */
 public function testLiveEmail()
 {
     TestingAuxLib::setConstant('X2_DEBUG_EMAIL', 'false');
     $contact = $this->contacts('testAnyone');
     $liveDeliveryTestCreds = $this->credentials('liveDeliveryTest');
     $this->openX2('contacts/' . $contact->id);
     sleep(1);
     $this->click("dom=document.querySelector ('.page-title .email')");
     $subject = 'functional test email ' . time();
     $this->select("css=#InlineEmail_credId", 'value=' . $liveDeliveryTestCreds->id);
     $this->type("name=InlineEmail[subject]", $subject);
     $this->type("name=InlineEmail[to]", $liveDeliveryTestCreds->auth->email);
     $this->storeEval("window.\$('#email-message').val ('test')", 'placeholder');
     sleep(2);
     $this->click("dom=document.querySelector('#send-email-button')");
     sleep(2);
     $this->assertEmailSuccess();
     TestingAuxLib::assertEmailReceived($this, $liveDeliveryTestCreds, $subject, 3);
 }