PHP code example of tr33m4n / codeception-module-percy
1. Go to this page and download the library: Download tr33m4n/codeception-module-percy 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/ */
tr33m4n / codeception-module-percy example snippets
class FirstCest
{
public function frontpageWorks(AcceptanceTester $I)
{
$I->amOnPage('/');
$I->takeAPercySnapshot('My snapshot name');
}
}
use Codeception\Module\Percy\Snapshot;
$I->takeAPercySnapshot('My snapshot name', [
Snapshot::WIDTHS => [1024, 768, 320], // Browser breakpoint widths
Snapshot::MIN_HEIGHT => 1080, // Minimum height of the resulting snapshot
Snapshot::PERCY_CSS => 'iframe { display: none; }', // Percy specific CSS
Snapshot::ENABLE_JAVASCRIPT => true // Enable/disable JavaScript
]);