Testomatio - Test Management for Codeception
Creates default config, tests directory and sample suites for current project. Use this command to start building a test suite.
By default it will create 3 suites Acceptance, Functional, and Unit.
codecept bootstrap
- creates tests
dir and codeception.yml
in current dir.codecept bootstrap --empty
- creates tests
dir without suitescodecept bootstrap --namespace Frontend
- creates tests, and use Frontend
namespace for actor classes and helpers.codecept bootstrap --actor Wizard
- sets actor as Wizard, to have TestWizard
actor in tests.codecept bootstrap path/to/the/project
- provide different path to a project, where tests should be placedRecursively cleans output
directory and generated code.
codecept clean
Auto-updates phar archive from official site: ‘https://codeception.com/codecept.phar’ .
php codecept.phar self-update
@author Franck Cassedanne [email protected]
Generates PageObject. Can be generated either globally, or just for one suite. If PageObject is generated globally it will act as UIMap, without any logic in it.
codecept g:page Login
codecept g:page Registration
codecept g:page acceptance Login
Prints all steps from all Gherkin contexts for a specific suite
Generates Actor classes (initially Guy classes) from suite configs. Starting from Codeception 2.0 actor classes are auto-generated. Use this command to generate them manually.
codecept build
codecept build path/to/project
Generates Cest (scenario-driven object-oriented test) file:
codecept generate:cest suite Login
codecept g:cest suite subdir/subdir/testnameCest.php
codecept g:cest suite LoginCest -c path/to/project
codecept g:cest "App\Login"
Creates empty Helper class.
codecept g:helper MyHelper
codecept g:helper "My\Helper"
Generates empty environment configuration file into envs dir:
codecept g:env firefox
Required to have envs
path to be specified in codeception.yml
Create new test suite. Requires suite name and actor name
codecept g:suite api
-> api + ApiTestercodecept g:suite integration Code
-> integration + CodeTestercodecept g:suite frontend Front
-> frontend + FrontTesterTry to execute test commands in run-time. You may try commands before writing the test.
codecept console acceptance
- starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.Generates user-friendly text scenarios from scenario-driven tests (Cest).
codecept g:scenarios acceptance
- for all acceptance testscodecept g:scenarios acceptance --format html
- in html formatcodecept g:scenarios acceptance --path doc
- generate scenarios to doc
dirCreates empty GroupObject - extension which handles all group events.
codecept g:group Admin
Generates code snippets for matched feature files in a suite. Code snippets are expected to be implemented in Actor or PageObjects
Usage:
codecept gherkin:snippets acceptance
- snippets from all feature of acceptance testscodecept gherkin:snippets acceptance/feature/users
- snippets from feature/users
dir of acceptance testscodecept gherkin:snippets acceptance user_account.feature
- snippets from a single feature filecodecept gherkin:snippets acceptance/feature/users/user_accout.feature
- snippets from feature file in a dirShows step by step execution process for scenario driven tests without actually running them.
codecept dry-run acceptance
codecept dry-run acceptance MyCest
codecept dry-run acceptance checkout.feature
codecept dry-run tests/acceptance/MyCest.php
Validates and prints Codeception config. Use it do debug Yaml configs
Check config:
codecept config
: check global configcodecept config unit
: check suite configLoad config:
codecept config:validate -c path/to/another/config
: from another dircodecept config:validate -c another_config.yml
: from another config fileCheck overriding config values (like in run
command)
codecept config:validate -o "settings: shuffle: true"
: enable shufflecodecept config:validate -o "settings: lint: false"
: disable lintingcodecept config:validate -o "reporters: report: \Custom\Reporter" --report
: use custom reporterGenerates Snapshot. Snapshot can be used to test dynamical data. If suite name is provided, an actor class will be included into placeholder
codecept g:snapshot UserEmails
codecept g:snapshot Products
codecept g:snapshot acceptance UserEmails
Executes tests.
Usage:
codecept run acceptance
: run all acceptance testscodecept run tests/acceptance/MyCest.php
: run only MyCestcodecept run acceptance MyCest
: same as abovecodecept run acceptance MyCest:myTestInIt
: run one test from a Cestcodecept run acceptance MyCest:myTestInIt#1
: run one example or data provider item by numbercodecept run acceptance MyCest:myTestInIt#1-3
: run a range of examples or data provider itemscodecept run acceptance MyCest:myTestInIt@name.*
: run data provider items with matching namescodecept run acceptance checkout.feature
: run feature-filecodecept run acceptance -g slow
: run tests from slow groupcodecept run unit,functional
: run only unit and functional suitesVerbosity modes:
codecept run -v
:codecept run --steps
: print step-by-step executioncodecept run -vv
: print steps and debug informationcodecept run --debug
: alias for -vv
codecept run -vvv
: print Codeception-internal debug informationLoad config:
codecept run -c path/to/another/config
: from another dircodecept run -c another_config.yml
: from another config fileOverride config values:
codecept run -o "settings: shuffle: true"
: enable shufflecodecept run -o "settings: lint: false"
: disable lintingRun with specific extension
codecept run --ext Recorder
run with Recorder extension enabledcodecept run --ext DotReporter
run with DotReporter printercodecept run --ext "My\Custom\Extension"
run with an extension loaded by class nameFull reference:
Generates skeleton for Unit Test that extends Codeception\TestCase\Test
.
codecept g:test unit User
codecept g:test unit "App\User"
Generates StepObject class. You will be asked for steps you want to implement.
codecept g:stepobject acceptance AdminSteps
codecept g:stepobject acceptance UserSteps --silent
- skip action questionsGenerates Feature file (in Gherkin):
codecept generate:feature suite Login
codecept g:feature suite subdir/subdir/login.feature
codecept g:feature suite login.feature -c path/to/project