Skip to content

sketchings/codeception_sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Codception Sample

Sample Project Created for "Bridging the Testing Gap"

Steps to create:

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

About

Sample Project Created for "Bridge the Testing Gap" at Longhorn PHP 2025

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors