Skip to content

Commit

Permalink
OXDEV-8234 Update directory structure by Codeception 5 recommendation
Browse files Browse the repository at this point in the history
  • Loading branch information
RahatHameed committed May 15, 2024
1 parent c47c64f commit 41360e9
Show file tree
Hide file tree
Showing 16 changed files with 41 additions and 53 deletions.
13 changes: 8 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@
"phpunit/phpunit": "^10.4",
"oxid-esales/oxideshop-ce": "dev-b-7.1.x",
"mikey179/vfsstream": "~1.6.8",
"codeception/module-rest": "*",
"codeception/module-phpbrowser": "*",
"codeception/module-db": "*",
"codeception/codeception": "^5.0",
"oxid-esales/codeception-modules": "dev-b-7.1.x"
"codeception/module-asserts": "*",
"codeception/module-db": "*",
"codeception/module-filesystem": "*",
"codeception/module-webdriver": "*",
"oxid-esales/codeception-modules": "dev-b-7.1.x",
"oxid-esales/codeception-page-objects": "dev-b-7.1.x",
"webmozart/path-util": "*"
},
"autoload": {
"psr-4": {
Expand All @@ -38,7 +41,7 @@

"tests-codeception": [
"Composer\\Config::disableProcessTimeout",
"MODULE_IDS=oe_graphql_base SHOP_ROOT_PATH=/var/www vendor/bin/codecept run Acceptance -c tests/codeception.yml --no-redirect"
"THEME_ID=apex MODULE_IDS=oegeoblocking SHOP_ROOT_PATH=/var/www vendor/bin/codecept run Acceptance -c tests/codeception.yml --no-redirect"
]

},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# If you need both WebDriver and PHPBrowser tests - create a separate suite.

actor: AcceptanceTester
path: Acceptance
modules:
enabled:
- Asserts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* See LICENSE file for license details.
*/

namespace OxidEsales\GeoBlocking\Tests\Codeception;
namespace OxidEsales\GeoBlocking\Tests\Codeception\Support;

use OxidEsales\Codeception\Page\Home;
use OxidEsales\Facts\Facts;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions tests/Codeception/Support/Helper/Acceptance.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/**
* Copyright © OXID eSales AG. All rights reserved.
* See LICENSE file for license details.
*/

namespace OxidEsales\GeoBlocking\Tests\Codeception\Support\Helper;


use Codeception\TestInterface;

class Acceptance extends \Codeception\Module
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
* Copyright © OXID eSales AG. All rights reserved.
* See LICENSE file for license details.
*/
namespace OxidEsales\GeoBlocking\Tests\Codeception\Step\Acceptance;
namespace OxidEsales\GeoBlocking\Tests\Codeception\Support\Step\Acceptance;

use OxidEsales\Codeception\Page\Checkout\UserCheckout;
use OxidEsales\Codeception\Page\Checkout\Basket as BasketPage;
use OxidEsales\Codeception\Module\Translation\Translator;
use OxidEsales\GeoBlocking\Tests\Codeception\AcceptanceTester;
use OxidEsales\GeoBlocking\Tests\Codeception\Support\AcceptanceTester;

class Basket extends AcceptanceTester
{
Expand Down
Empty file removed tests/Codeception/_output/.gitkeep
Empty file.
35 changes: 0 additions & 35 deletions tests/Codeception/_support/Helper/Acceptance.php

This file was deleted.

Empty file.
1 change: 1 addition & 0 deletions tests/Codeception/acceptance/FrontendCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use OxidEsales\Codeception\Module\Translation\Translator;
use OxidEsales\Codeception\Page\Checkout\UserCheckout;
use OxidEsales\Codeception\Step\Basket;
use OxidEsales\GeoBlocking\Tests\Codeception\Support\AcceptanceTester;

class FrontendCest
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Codeception/acceptance/_bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
require_once Path::join((new \OxidEsales\Facts\Facts())->getShopRootPath(), 'source', 'bootstrap.php');

$helper = new \OxidEsales\Codeception\Module\FixturesHelper();
$fixturesPath = dirname(__FILE__).'/../_data/fixtures.php';
$fixturesPath = dirname(__FILE__).'/../Support/Data/fixtures.php';
if ((new Facts())->isEnterprise()) {
$fixturesPath = dirname(__FILE__).'/../_data/fixtures_ee.php';
$fixturesPath = dirname(__FILE__).'/../Support/Data/fixtures_ee.php';
}
$helper->loadRuntimeFixtures($fixturesPath);
10 changes: 6 additions & 4 deletions tests/Codeception/config/params.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
* See LICENSE file for license details.
*/

namespace OxidEsales\DoctrineMigrationWrapper;

use OxidEsales\Facts\Config\ConfigFile;
use OxidEsales\Facts\Facts;
use OxidEsales\Codeception\Module\Database\DatabaseDefaultsFileGenerator;
use Webmozart\PathUtil\Path;

if ($shopRootPath = getenv('SHOP_ROOT_PATH')){
require_once(Path::join($shopRootPath, 'source', 'bootstrap.php'));
}

$facts = new Facts();

$seleniumServerPort = getenv('SELENIUM_SERVER_PORT');
Expand Down Expand Up @@ -38,7 +40,7 @@

function getTestDataDumpFilePath()
{
return getShopTestPath() . '/Codeception/_data/dump.sql';
return Path::join(__DIR__, '/../', 'Support','Data', 'dump.sql');
}

function getShopTestPath()
Expand Down Expand Up @@ -67,7 +69,7 @@ function getShopSuitePath($facts)

function getModuleTestDataDumpFilePath()
{
return __DIR__ . '/../_data/dump.sql';
return __DIR__ . '/../Support/Data/dump.sql';
}

function getMysqlConfigPath()
Expand Down
9 changes: 5 additions & 4 deletions tests/codeception.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
namespace: OxidEsales\GeoBlocking\Tests\Codeception
support_namespace: Support
params:
- Codeception/config/params.php
paths:
tests: Codeception
output: Codeception/_output
data: Codeception/_data
support: Codeception/_support
output: Codeception/Output
data: Codeception/Support/Data
support: Codeception/Support
envs: Codeception/_envs
actor_suffix: Tester
actor_suffix: Tester
settings:
colors: true
log: true
Expand Down

0 comments on commit 41360e9

Please sign in to comment.