PHP code example of nathanmac / im-codeception-module

1. Go to this page and download the library: Download nathanmac/im-codeception-module library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nathanmac / im-codeception-module example snippets



$I = new IMGuy($scenario);
$I->wantTo('grab the recent messages on the IM server and run some tests');

$message = $I->grabLastInstantMessage();
$I->seeInLastInstantMessageFrom('Tester');
$I->dontSeeInLastInstantMessageFrom('Codeception');
$I->seeInLastInstantMessageContent('Testing has been completed with no issues.');
$I->dontSeeInLastInstantMessageContent('Random Message not there');
$I->seeInLastInstantMessageColor('yello');
$I->dontSeeInLastInstantMessageColor('red');
$date = $I->grabLastInstantMessageDate();
$I->seeInLastInstantMessageDate('2014-10-21T16:41:48.657455+00:00');
$I->dontSeeInLastInstantMessageDate('2015-10-21T16:41:48.657455+00:00');

$I->sendInstantMessage("Testing has been completed with no issues.", array('color' => 'yellow', 'notify' => true));


$I->sendInstantMessage('Testing message to be send to IM service.', array('color' => 'red', 'notify' => true);


$messages = $I->grabLastInstantMessage();


$from = $I>grabLastInstantMessageFrom();


$I->seeInLastInstantMessageFrom('Codeception');


$I->dontSeeInLastInstantMessageFrom('Codeception');


$content = $I->grabLastInstantMessageContent();


$I->seeInLastInstantMessageContent('Hello this is the messages I am expecting to see.');


$I->dontSeeInLastInstantMessageContent('Hello this is the messages I am not expecting to see.');


$color = $I->grabLastInstantMessageColor();


$I->seeInLastInstantMessageColor('red');


$I->dontSeeInLastInstantMessageColor('red');


$date = $I->grabLastInstantMessageDate();


$I->seeInLastInstantMessageDate('2014-10-13T16:30:48.657455+00:00');


$I->dontSeeInLastInstantMessageDate('2015-11-13T16:30:48.657455+00:00');