Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add testing and coverage reporting using Codeception and Selenium #127

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

kittysnacks
Copy link
Collaborator

This contains changes to allow for acceptance testing using Selenium with ChromeDriver. Other WebDrivers can be used, but I've only added ChromeDriver for now. 🙂

Some points:

  • These changes are intended to be used during local development and should not affect any production installations.
    • Getting automated tests running with Travis will require a bit more work. (initial DB setup, seeding, etc) It's not difficult work, I just haven't done it. 🙂
  • Usage of any of this is optional -- only when running composer test.
  • Codeception is used to run tests now.
  • Codeception uses PHPUnit under the hood, so tests may still be written using PHPUnit.
  • I added one example acceptance test for logging in as the default admin user.
  • PHP 7 is required to run tests, due to Codeception's dependencies.
  • I've updated readme.html with testing instructions, at the bottom of the file.

I was hoping to not add Selenium as a requirement for testing, but due to the requirement of JavaScript on the client side, using Codeception's PhpBrowser (mimics a simple web browser) won't be possible.

This will allow for generation of code coverage reports.
PHPUnit v5.x is past EOL and causes the following error with Codeception:

In ErrorHandler.php line 83:

  count(): Parameter must be an array or an object that implements Countable
Added .gitkeep files for acceptance, functional, and unit directories.
Removed generated support files.
Created .gitignore files for generated output directories.
- Moved devmode.php require to the top of init.php.
	- c3.php should be the first thing loaded.
- Added a require for the composer autoloader.
- Use localhost:80 instead of localhost:3000 for acceptance tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant