Quickstart

  1. Setup. Execute: php vendor/bin/codecept bootstrap.
  2. Create Test. Generate your first acceptance test.
  3. Configure Acceptance Tests. Please make sure your local development server is running.
  4. Write a Basic Test. It’s now time to write your first test.
  5. Run! Tests are executed with ‘run’ command.

What is Codeception in yii2?

Yii Framework provides basic and advanced application templates. Both include sample Codeception tests, thus to start with Codeception you need to start new Yii project from a one of those templates.

Which Codeception method may be used to check that a variable is greater than expected?

assertGreaterThanOrEqual Asserts
assertGreaterThanOrEqual. Asserts that a value is greater than or equal to another value.

What is a UAT?

User Acceptance Testing (UAT) is the final stage of any software development life cycle. This is when actual users test the software to see if it is able to carry out the required tasks it was designed to address in real-world situations.

How to enable yii2 module in codeception?

Alternatively, you can enable Yii2 module in suite configuration file and run This module was bundled with Codeception 2 and 3, but since version 4 it is necessary to install it separately. Some modules are bundled with PHAR files.

What is unit testing in Yii?

Unit tests are located in tests/unit directory and are supposed to contain all kind of unit and integration testing. Each test case extends Codeception\\Test\\Unit class, which is standard Codeception format for unit testing. It is pretty hard to develop completely isolated unit tests in Yii, so an application is bootstrapped before each test case.

How to write functional tests in yyii2?

Yii2 module provides special methods, like amLoggedInAs (for fast authentication), haveRecord, seeRecord, seeEmailIsSent and others. They all are listed in module reference. Functional tests should be written inside Cest files, which is a scenario-driven test format of Codeception. You can easily create a new test by running:

How to write functional tests in codeception?

Functional tests should be written inside Cest files, which is a scenario-driven test format of Codeception. You can easily create a new test by running: Functional tests are really powerful and simple. They are highly recommended to use for any Yii application.