-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
OXDEV-8235 Add test for dynamic image generation
1 parent
842b523
commit c7b06dc
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
tests/Codeception/Acceptance/DynamicImageGenartionCest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
} | ||
} |
Binary file added
BIN
+973 Bytes
tests/Codeception/Support/Data/out/pictures/master/product/1/test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.