Gizra / drupal-elm-starter

DEPRECATED - See https://github.com/Gizra/drupal-starter
33 stars 9 forks source link

WDIO backend & frontend tests. [4h] #201

Closed nedSaf closed 5 years ago

nedSaf commented 6 years ago

@AronNovak I had the idea of dividing the WDIO tests (specs) into two directories and running each one separately, meaning that we remove Behat tests completely and stick only to WDIO.

Do you think it's something that could be good? If so, I'll open an experimental PR.

Test environment

The tests are divided into two directories, backend & frontend, Travis runs on both directories in two separate commands in which each has a dedicated conf.js file pointing to the right baseUrl and directory under specs

Example of changing your local config to test the backend.

exports.config = merge(wdioConf.config, {
  // Set a base URL in order to shorten url command calls.
  // If your url parameter starts with "/", then the base url gets prepended.
  baseUrl: 'http://cbo.local',

  specs: [
    './specs/backend/**/*.js'
  ]
});
AronNovak commented 6 years ago

@nedSaf In many projects, we do use WDIO to test backend, or let's say the Drupal UI, either backend or frontend. Behat has some advantages like having a very tight integration with Drupal, but I see the trend that we drop Behat everywhere, so indeed I think this is something meaningful. And we should try to execute backend and frontend WDIO tests in parallel.

nedSaf commented 6 years ago

Thanks @AronNovak, I'm in the mindset of ditching Behat all together, I'll add a PR soon and see how we like the approach.

nedSaf commented 5 years ago

This is merged.