yii2-netdisk/tests
2013-12-17 23:43:43 -05:00
..
_data Added acceptance tests for the basic app. 2013-06-22 20:26:22 -04:00
_helpers cleanup and re-aranged codeception tests for basic app 2013-12-17 00:27:33 +01:00
_log Added acceptance tests for the basic app. 2013-06-22 20:26:22 -04:00
_pages Refactored codeception/BasePage. 2013-12-17 23:43:43 -05:00
acceptance Refactored codeception/BasePage. 2013-12-17 23:43:43 -05:00
functional Refactored codeception/BasePage. 2013-12-17 23:43:43 -05:00
unit finished codeception extension 2013-12-17 01:00:13 +01:00
_bootstrap.php cleanup and re-aranged codeception tests for basic app 2013-12-17 00:27:33 +01:00
.gitignore removed auto generated files from repo 2013-12-17 00:45:25 +01:00
acceptance.suite.yml cleanup and re-aranged codeception tests for basic app 2013-12-17 00:27:33 +01:00
functional.suite.yml cleanup and re-aranged codeception tests for basic app 2013-12-17 00:27:33 +01:00
README.md updated codeception docs. fixes #1558 2013-12-17 17:27:42 +01:00
unit.suite.dist.yml removed auto generated files from repo 2013-12-17 00:45:25 +01:00

This folder contains various tests for the basic application. These tests are developed with Codeception PHP Testing Framework.

To run the tests, follow these steps:

  1. Download Codeception(Quickstart step 1) and put the codeception.phar in the application base directory (not in this tests directory!).

  2. Adjust the test configuration files based on your environment:

    • Configure the URL for acceptance tests in acceptance.suite.yml. The URL should point to the index-test-acceptance.php file that is located under the web directory of the application.
    • functional.suite.yml for functional testing and unit.suite.yml for unit testing should already work out of the box and should not need to be adjusted.
    • If you want to run acceptance tests, you need to download selenium standalone and start it with command java -jar {selenium-standalone-name}.jar. After that you can use WebDriver codeception module that will connect to selenium and launch browser. This also allows you to use Xvfb in your tests which allows you to run tests without showing the running browser on the screen. There is codeception blog post that explains how it works.
  3. Go to the application base directory and build the test suites:

    php codecept.phar build    // rebuild test scripts, only need to be run once
    
  4. Run the tests:

    php codecept.phar run      // run all available tests
    // you can also run a test suite alone:
    php codecept.phar run acceptance
    php codecept.phar run functional
    php codecept.phar run unit
    

Please refer to Codeception tutorial for more details about writing acceptance, functional and unit tests.