Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OXDEV-8235 Add test for dynamic image generation
Browse files Browse the repository at this point in the history
liulka-oxid committed Apr 9, 2024
1 parent 842b523 commit c7b06dc
Showing 2 changed files with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions tests/Codeception/Acceptance/DynamicImageGenartionCest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

/**
* Copyright © OXID eSales AG. All rights reserved.
* See LICENSE file for license details.
*/

declare(strict_types=1);

namespace Acceptance;

use Codeception\Attribute\Group;
use OxidEsales\EshopCommunity\Tests\Codeception\Support\AcceptanceTester;

#[Group('images')]
final class DynamicImageGenartionCest
{
private string $pathToGeneratedImages = '/out/pictures/generated/product/1/500_500_75';

public function fetchGeneratedImages(AcceptanceTester $I): void
{
$I->wantToTest('availability of dynamically generated images');

$I->amGoingTo('fetch a generated image for an existing product picture');
$existingImageFixture = 'test.png';
$I->amOnPage("$this->pathToGeneratedImages/$existingImageFixture");
$this->dontSeeAnyErrorsOnPage($I);

$I->amGoingTo('check that a missing product picture will be replaced with a placeholder image');
$someMissingImage = 'some-missing-image.png';
$I->amOnPage("$this->pathToGeneratedImages/$someMissingImage");
$this->dontSeeAnyErrorsOnPage($I);
}

private function dontSeeAnyErrorsOnPage(AcceptanceTester $I): void
{
$I->dontSee('Error');
$I->dontSee('Not found');
$I->dontSee('404');
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c7b06dc

Please sign in to comment.