-
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.
# Conflicts: # CHANGELOG-7.2.md # source/Application/Model/Article.php # source/Core/ViewConfig.php # tests/Codeception/Acceptance/ProductDetailsPageCest.php
- Loading branch information
Showing
10 changed files
with
381 additions
and
30 deletions.
There are no files selected for viewing
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
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
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
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
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,49 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright © OXID eSales AG. All rights reserved. | ||
* See LICENSE file for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace OxidEsales\EshopCommunity\Migrations; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Doctrine\Migrations\AbstractMigration; | ||
|
||
final class Version20231128113123 extends AbstractMigration | ||
{ | ||
public function getDescription(): string | ||
{ | ||
return 'Add Low Stock Message'; | ||
} | ||
|
||
public function up(Schema $schema): void | ||
{ | ||
$this->addSql( | ||
'ALTER TABLE `oxarticles` ADD column `OXLOWSTOCKTEXT` VARCHAR(255) NOT NULL default "" COMMENT ' | ||
. '"Message, which is shown if the article is in low stock (multilanguage)" AFTER `OXSTOCKTEXT`' | ||
); | ||
$this->addSql( | ||
'ALTER TABLE `oxarticles` ADD column `OXLOWSTOCKTEXT_1` VARCHAR(255) NOT NULL default "" AFTER ' | ||
. '`OXSTOCKTEXT_3`' | ||
); | ||
$this->addSql( | ||
'ALTER TABLE `oxarticles` ADD column `OXLOWSTOCKTEXT_2` VARCHAR(255) NOT NULL default "" AFTER ' | ||
. '`OXLOWSTOCKTEXT_1`' | ||
); | ||
$this->addSql( | ||
'ALTER TABLE `oxarticles` ADD column `OXLOWSTOCKTEXT_3` VARCHAR(255) NOT NULL default "" AFTER ' | ||
. '`OXLOWSTOCKTEXT_2`' | ||
); | ||
$this->addSql( | ||
'ALTER TABLE `oxarticles` ADD column `OXLOWSTOCKACTIVE` TINYINT(1) AFTER ' | ||
. '`OXLOWSTOCKTEXT`' | ||
); | ||
} | ||
|
||
public function down(Schema $schema): void | ||
{ | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
tests/Codeception/Acceptance/Admin/MasterCoreStockSettingsCest.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,40 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright © OXID eSales AG. All rights reserved. | ||
* See LICENSE file for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Acceptance\Admin; | ||
|
||
use Codeception\Attribute\Group; | ||
use OxidEsales\EshopCommunity\Tests\Codeception\Support\AcceptanceTester; | ||
|
||
#[Group('admin', 'core', 'stock')] | ||
final class MasterCoreStockSettingsCest | ||
{ | ||
public function setActiveCategoryAtStart(AcceptanceTester $I): void | ||
{ | ||
$I->wantToTest('Activate and deactivate default stock message'); | ||
|
||
$adminPanel = $I->loginAdmin(); | ||
$coreSettings = $adminPanel->openCoreSettings(); | ||
$settingsTab = $coreSettings->openSettingsTab(); | ||
|
||
$I->amGoingTo('Check Low stock default message option'); | ||
$stockDropdown = $settingsTab->openStockSettings(); | ||
$stockDropdown->checkLowStockMessageOption(); | ||
$settingsTab->save(); | ||
|
||
$stockDropdown->seeLowStockMessageSelected(); | ||
|
||
$I->amGoingTo('Uncheck Low stock default message option'); | ||
$stockDropdown = $settingsTab->openStockSettings(); | ||
$stockDropdown->uncheckLowStockMessageOption(); | ||
$settingsTab->save(); | ||
|
||
$stockDropdown->dontSeeLowStockMessageSelected(); | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
tests/Codeception/Acceptance/Admin/ProductStockTestCest.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,48 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright © OXID eSales AG. All rights reserved. | ||
* See LICENSE file for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Acceptance\Admin; | ||
|
||
use Codeception\Attribute\Group; | ||
use OxidEsales\EshopCommunity\Tests\Codeception\Support\AcceptanceTester; | ||
|
||
#[Group('admin', 'product', 'stock')] | ||
final class ProductStockTestCest | ||
{ | ||
private string $productID = '1000'; | ||
|
||
public function setLowStockMessage(AcceptanceTester $I): void | ||
{ | ||
$I->wantToTest('Set low stock message for product'); | ||
|
||
$productsMainPage = $I->loginAdmin()->openProducts(); | ||
$productMainTab = $productsMainPage->find($productsMainPage->searchNumberInput, $this->productID); | ||
$stockTab = $productMainTab->openStockTab(); | ||
$lowStockMessage = 'This product is in low stock' . $this->productID; | ||
$remindAmount = 20.5; | ||
|
||
$I->amGoingTo('Set and activate low stock message'); | ||
|
||
$stockTab->checkLowStockMessageOption() | ||
->setRemindAmountValue($remindAmount) | ||
->setLowStockMessageValue($lowStockMessage) | ||
->save(); | ||
|
||
$stockTab->seeRemindAmountValue($remindAmount); | ||
$stockTab->seeLowStockMessageSelected(); | ||
$stockTab->seeLowStockMessageValue($lowStockMessage); | ||
|
||
$I->amGoingTo('Disable low stock message'); | ||
|
||
$stockTab->uncheckLowStockMessageOption() | ||
->save(); | ||
|
||
$stockTab->dontSeeLowStockMessageSelected(); | ||
} | ||
} |
Oops, something went wrong.