Permalink
Browse files

ESDEV-4156 Update tearDown

We must ensure that the environment for the next test run is
fully prepared as next test in queue might not be able to
restore the original database.
  • Loading branch information...
1 parent 840f500 commit e25540f78bec7d76f70009445990da57178b6a05 @rezonanc-oxid rezonanc-oxid committed Jan 6, 2017
Showing with 13 additions and 3 deletions.
  1. +13 −3 tests/Acceptance/Frontend/ShopSetUpTest.php
@@ -26,6 +26,7 @@
use oxConnectionException;
use OxidEsales\EshopCommunity\Tests\Acceptance\FrontendTestCase;
use OxidEsales\TestingLibrary\ServiceCaller;
+use OxidEsales\TestingLibrary\TestConfig;
use oxRegistry;
/** Selenium tests for frontend navigation. */
@@ -34,11 +35,9 @@ class ShopSetUpTest extends FrontendTestCase
/** @var int How much more time wait for these tests. */
protected $_iWaitTimeMultiplier = 7;
- /**
- * Regenerate views after test.
- */
protected function tearDown()
{
+ $this->resetShop();
parent::tearDown();
$oServiceCaller = new ServiceCaller($this->getTestConfig());
@@ -274,4 +273,15 @@ protected function isPackage()
{
return file_exists($this->getTestConfig()->getShopPath() . '/pkg.info');
}
+
+ private function resetShop()
+ {
+ $testConfig = new TestConfig();
+ $serviceCaller = new ServiceCaller($testConfig);
+ $serviceCaller->setParameter('serial', $testConfig->getShopSerial());
+ $serviceCaller->setParameter('addDemoData', 1);
+ $serviceCaller->setParameter('turnOnVarnish', $testConfig->shouldEnableVarnish());
+ $serviceCaller->setParameter('setupPath', $testConfig->getShopSetupPath());
+ $serviceCaller->callService('ShopInstaller');
+ }
}

0 comments on commit e25540f

Please sign in to comment.