☑ Meet EasyTesting.io, a project by Michael Bodnarchuk, author of Codeception. Simplify your browser testing experience with CaaS (Codeception as a service)!



Provides testing for projects integrated with Facebook API. Relies on Facebook’s tool Test User API.

To use this module with Composer you need "facebook/php-sdk4": "5.*" package.


Facebook Status for Codeception/Codeception


  • app_id required - Facebook application ID
  • secret required - Facebook application secret
  • test_user - Facebook test user parameters:
    • name - You can specify a name for the test user you create. The specified name will also be used in the email address assigned to the test user.
    • locale - You can specify a locale for the test user you create, the default is en_US. The list of supported locales is available at https://www.facebook.com/translations/FacebookLocales.xml
    • permissions - An array of permissions. Your app is granted these permissions for the new test user. The full list of permissions is available at https://developers.facebook.com/docs/authentication/permissions

Config example

        - Facebook:
            depends: PhpBrowser
            app_id: 412345678901234
            secret: ccb79c1b0fdff54e4f7c928bf233aea5
                name: FacebookGuy
                locale: uk_UA
                permissions: [email, publish_stream]

Test example:

$I = new ApiGuy($scenario);
$I->wantToTest('check-in to a place be published on the Facebook using API');
$accessToken = $I->grabFacebookTestUserAccessToken();
$I->haveHttpHeader('Auth', 'FacebookToken ' . $accessToken);
$I->amGoingTo('send request to the backend, so that it will publish on user\'s wall on Facebook');
$I = new WebGuy($scenario);
$I->wantToTest('log in to site using Facebook');
$I->haveFacebookTestUserAccount(); // create facebook test user
$I->haveTestUserLoggedInOnFacebook(); // so that facebook will not ask us for login and password
$fbUserFirstName = $I->grabFacebookTestUserFirstName();
$I->see('Welcome, Guest');
$I->click('Login with Facebook');
$I->see('Welcome, ' . $fbUserFirstName);

@since 1.6.3 @author [email protected]



Returns the test user access token.

  • return string


Returns the test user email.

  • return string


Returns the test user id.

  • return string


Returns URL for test user auto-login.

  • return string


Returns the test user name.

  • return string


not documented


Get facebook test user be created.

Please, note that the test user is created only at first invoke, unless $renew arguments is true.

  • param bool $renew true if the test user should be recreated


Get facebook test user be logged in on facebook. This is done by going to facebook.com

@throws ModuleConfigException


Please, note that you must have publish_actions permission to be able to publish to user’s feed.

  • param array $params


Please, note that you must have publish_actions permission to be able to publish to user’s feed.

  • param string $placeId Place identifier to be verified against user published posts


Please, note that you must have publish_actions permission to be able to publish to user’s feed.

  • param string $message published post to be verified against the actual post on facebook


Module reference is taken from the source code. Help us to improve documentation. Edit module reference
Let us help you take Codeception further. We offer a number of paid services that can help you and your organization get the most out of Codeception Enterprise. Software testing & test automation development and outsourcing. Request a quote for enterprise support or trainings