Sample Project Created for "Bridging the Testing Gap"
Steps to create:
- Followed the Codeception Quickstart to "Setup for a single test suite"
- Install via Composer
composer require "codeception/codeception" --dev
- Acceptance Testing (only)
php vendor/bin/codecept init Acceptance
- Configure Acceptance Tests
- Change
codeception.ymlto use the PhpBrowser like the quickstart - Add the https://phptek.io url
- Change
- Write a Basic Test
- rename our HomepageCest.php file
- add code similar to FirstCest
- Add Module for PhpBrowswer
composer require codeception/module-phpbrowser --dev
- RUN!
php vendor/bin/codecept run --steps
- Install via Composer
- Add BDD feature file following Codeception Docs: BDD
php vendor/bin/codecept g:feature Acceptance partners- Update the
tests/partners.featurefile to look for one partner using "partner" and "level" variables - Generate snippets
php vendor/bin/codecept gherkin:snippets Acceptance - Paste the snippets into
tests/Support/AcceptanceTester.php - Add test code to the snippets similar to the
HomepageCest.php - Update the
tests/partners.featureto use a Scenario Outline
- Update the test to look for "partner" WITHIN the
divcontaining the "level"h3 - Run test from a single file:
php vendor/bin/codecept run --steps Acceptance partners.feature - Run all tests:
php vendor/bin/codecept run --steps