Skip to content

Latest commit

 

History

History
46 lines (33 loc) · 1.13 KB

File metadata and controls

46 lines (33 loc) · 1.13 KB

Testing

UI tests

We use Cypress to test the UI of all OS2Loop modules and we utilize Cypress for Drupal to make it easy to create and run UI tests.

Testing a module

To add Cypress tests to a module, os2loop_page, say, add a sub-module called os2loop_page_tests_cypress under the os2loop_page module:

web/profiles/custom/os2loop/modules/os2loop_page
└── modules
    ├── os2loop_page_tests
    └── os2loop_page_tests_cypress

Unit tests

cd web
php core/scripts/run-tests.sh --sqlite /tmp/test.sqlite os2loop_tests
vendor/bin/phpunit --configuration web/core

Running tests with the symfony binary

To run tests with the symfony binary we need a to patch run-tests.sh (cf. https://www.drupal.org/project/drupal/issues/2748883#comment-12102000):

cd web
curl https://www.drupal.org/files/issues/use_the_php_binary-2748883-32.patch | patch --strip=1

Then run tests with

symfony php core/scripts/run-tests.sh --php 'symfony php' --sqlite /tmp/test.sqlite os2loop_tests