- PHP 7.1 +
-
WordPress "Unit" Tests in CF with phpunit Runs in CI/CD
-
JavaScript unit tests in CF
-
Cypress e2e tests
-
Isolated unit testing
-
Ghost Inspector Testing
Merge
Requires git and Composer and npm and Yarn
- Clone From Github:
git clone [email protected]:CalderaWP/caldera-wordpress-plugin
- Build for development:
yarn && composer install
- Setup test and local development environment:
composer wp:install && composer wp:activate && composer cf:form-import
e2e tests are written using cypress.io in the directory cypress
.
See: cypress/README.md
- Launch the test runner for cypress:
yarn test:e2e
- Start everything
yarn start
- Start dev server for React app
yarn start:app
- Start dev server for blocks
yarn start:blocks
- Unit tests
yarn test
- Launch the test runner for cypress:
yarn test:e2e
- Do a Cypress.io Test Run
yarn test:e2e:run
- Generate coverage report locally
yarn test:coverage-report
- All PHP is developed in
/php
-
Run PHP Tests, Lints And Sniffs
composer tests
-
Run Unit Tests:
composer test:unit
A local development environment is included, and provided. It is used for integration tests. Requires Composer, Docker and Docker Compose.
- Install Local Environment And WordPress "Unit" Test Suite
composer wp:install
You should now have WordPress at http://localhost:8218/
- Username: admin
- password: password
- Activate Plugins
composer wp:activate
- Import test forms
composer cf:form-import
- (re)Start Server: Once server is installed, you can start it again
composer wp:start
- (re)Activate Plugins
composer wp:activate
- (re)Set WordPress permalinks
composer wp:config
Tests will also run in Travis on each push. You should also run tests locally as you develop.
Follow the steps above to create local development environment, then you can use the commands listed in the next section.
A local development environment is included, and provided. It is used for integration tests. Requires Composer, Docker and Docker Compose.
- Install Local Environment And WordPress "Unit" Test Suite
composer wp:install
- Import test forms and put them on pages
composer cf:test:install
You should now have WordPress at http://localhost:8218/
- Username: admin
- password: password
- (re)Start Server: Once server is installed, you can start it again
composer wp:start
- (re)Activate Plugins
composer wp:activate
- (re)Set WordPress permalinks
composer wp:config
Tests will also run in Travis on each push. You should also run tests locally as you develop.
Follow the steps above to create local development environment, then you can use the commands listed in the next section.
cwp import
- Import all test forms that are not currently imported
cwp pages
- Add pages, with form shortcodes needed to run tests.