Codeception 5 update (#1583)

Co-authored-by: Thomas Landauer <thomas@landauer.at>
This commit is contained in:
Aaron Gustavo Nieves
2024-01-20 03:51:11 -05:00
committed by GitHub
parent 282ef7409d
commit 054eef6640
16 changed files with 171 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
namespace: App\Tests
support_namespace: Support
paths:
tests: tests
output: tests/_output
data: tests/Support/Data
support: tests/Support
envs: tests/_envs
actor_suffix: Tester
extensions:
enabled:
- Codeception\Extension\RunFailed
params:
- .env
- .env.test
settings:
shuffle: true
colors: true
report_useless_tests: true

View File

@@ -0,0 +1,6 @@
{
"copy-from-recipe": {
"codeception.yml": "codeception.yml",
"tests/": "tests/"
}
}

View File

@@ -0,0 +1,13 @@
File codeception.yml created <- Global configuration
tests/Unit created <- Unit tests
tests/Unit.suite.yml written <- Unit tests suite configuration
tests/Functional created <- Functional tests
tests/Functional.suite.yml written <- Functional tests suite configuration
tests/Acceptance created <- Acceptance tests
tests/Acceptance.suite.yml written <- Acceptance tests suite configuration
<info>Codeception is installed for acceptance, functional, and unit testing</>
<options=bold>Next steps:</>
1. Edit <options=bold>tests/Functional.suite.yml</> to enable Doctrine module if needed
2. Create your first acceptance test using <comment>vendor/bin/codecept generate:cest Acceptance First</>
3. Write your first test in <options=bold>tests/Acceptance/FirstCest.php</>
4. Run tests using: <comment>vendor/bin/codecept run</>

View File

@@ -0,0 +1,16 @@
# Codeception Test Suite Configuration
#
# Suite for acceptance tests.
# Perform tests in browser using the WebDriver or PhpBrowser.
# If you need both WebDriver and PHPBrowser tests - create a separate suite.
actor: AcceptanceTester
modules:
enabled:
- PhpBrowser:
url: https://localhost:8000
# add Codeception\Step\Retry trait to AcceptanceTester to enable retries
step_decorators:
- Codeception\Step\ConditionalAssertion
- Codeception\Step\TryTo
- Codeception\Step\Retry

View File

@@ -0,0 +1,15 @@
# Codeception Test Suite Configuration
#
# Suite for functional tests
# Emulate web requests and make application process them
actor: FunctionalTester
modules:
enabled:
- Asserts
- Symfony:
app_path: 'src'
environment: 'test'
# - Doctrine2:
# depends: Symfony
# cleanup: true

View File

@@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
namespace App\Tests\Support;
/**
* Inherited Methods
*
* @method void wantTo($text)
* @method void wantToTest($text)
* @method void execute($callable)
* @method void expectTo($prediction)
* @method void expect($prediction)
* @method void amGoingTo($argumentation)
* @method void am($role)
* @method void lookForwardTo($achieveValue)
* @method void comment($description)
* @method void pause($vars = [])
*
* @SuppressWarnings(PHPMD)
*/
class AcceptanceTester extends \Codeception\Actor
{
use _generated\AcceptanceTesterActions;
/**
* Define custom actions here
*/
}

View File

@@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
namespace App\Tests\Support;
/**
* Inherited Methods
*
* @method void wantTo($text)
* @method void wantToTest($text)
* @method void execute($callable)
* @method void expectTo($prediction)
* @method void expect($prediction)
* @method void amGoingTo($argumentation)
* @method void am($role)
* @method void lookForwardTo($achieveValue)
* @method void comment($description)
* @method void pause($vars = [])
*
* @SuppressWarnings(PHPMD)
*/
class FunctionalTester extends \Codeception\Actor
{
use _generated\FunctionalTesterActions;
/**
* Define custom actions here
*/
}

View File

@@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
namespace App\Tests\Support;
/**
* Inherited Methods
*
* @method void wantTo($text)
* @method void wantToTest($text)
* @method void execute($callable)
* @method void expectTo($prediction)
* @method void expect($prediction)
* @method void amGoingTo($argumentation)
* @method void am($role)
* @method void lookForwardTo($achieveValue)
* @method void comment($description)
* @method void pause($vars = [])
*
* @SuppressWarnings(PHPMD)
*/
class UnitTester extends \Codeception\Actor
{
use _generated\UnitTesterActions;
/**
* Define custom actions here
*/
}

View File

@@ -0,0 +1,2 @@
*
!.gitignore

View File

@@ -0,0 +1,8 @@
# Codeception Test Suite Configuration
#
# Suite for unit or integration tests.
actor: UnitTester
modules:
enabled:
- Asserts

View File

View File

@@ -0,0 +1,2 @@
*
!.gitignore