testing

Published on Thursday 18, October 2018

Running Drupal's Nightwatch test suite on DDEV

This is the third, and final post in my series on running Drupal’s various test suites using the DDEV local development stack. Previously I covered running Drupal’s Unit, Kernel, and Functional tests and then running Chromedriver to execute the FunctionalJavascript test suite. In this post, I will talk about running the newly introduced Nightwatch.js test framework.

Running Drupal's FunctionalJavascript tests on DDEV Tuesday 16, October 2018 mglaman

This is part two of a series on running Drupal’s testing suites on DDEV. We left off last time with trying to execute a FunctionalJavscript test and having every test case skipped because no browser emulator was available. In this post, we will run through getting set up to execute Drupal’s FunctionalJavascript tests inside of your DDEV web container.

Running Drupal's PHPUnit test suites on DDEV Friday 12, October 2018 mglaman

DDEV is a local development stack built on top of Docker. It gives you all of your environment needs without messy configured on your host machine, without needing to know Docker or configure your own containers. Which is great, and makes life easier. Instead of just using DDEV to develop your site or application locally, why not also run your tests within it?

Test driven development in PhpStorm with auto-testing enabled Saturday 6, October 2018 mglaman
When I work, I try to follow the principles of Test-Driven Development. I have found it to aid me in writing cleaner code, identifying odd coupling of components or crazy accidental dependencies between components. It also lets me write my API first by using mocks against interfaces I have defined. PhpStorm's auto-test functionality speeds up my test-driven development process.
Published on Sunday 19, March 2017

Setup Drupal Commerce for CI and Behat testing

I can proudly say that we have been on top of our test coverage in Drupal Commerce. Back in June of 2016 we had removed any trace of Simpletest based tests and moved over to PHPUnit Unit, Kernel, Functional, and FunctionalJavascript tests. Once using PhantomJS for JavaScript testing landed in core we jumped ship. Test coverage is great for the individual project because we can ensure that we ship an (assumedly, mostly) bug-free product. But I believe we should do more than that.

Run \Drupal\Tests\BrowserTestBase with SQLite Monday 23, May 2016 mglaman

As part of the push to deprecate SimpleTest and use PHPUnit as the test runner in Drupal 8, there is the \Drupal\Tests\BrowserTestBase class. The BrowserTestBase provides a Mink runner that tests web pages in Drupal. Unlike kernel tests, which require a database and can be run via PHPUnit as well, browser tests use your default database connection. I prefer to run my tests with SQLite as I do not need to have my Docker containers running.

The simplest solution I have found, thus far, is to check the HTTP_USER_AGRENT