The Drupal community has deprecated SimpleTest and the Webform module needs to switch over using PHPUnit (https://www.drupal.org/docs/8/phpunit) based tests.

Concepts

  • Tests confirm expectations.
  • Tests should be repeatable, maintainable, and easy to execute
  • Tests are documentation.

Notes

  • Webform module requires that all features, functionality and even form elements have an example/test page that developer or an automated test can review and fix expecting
  • Simple test has better ui integration but is deprecated.
  • JavaScript testing is now supported

Things that don't need 100% test coverage.

  • Features that extend core systems which already include test coverage
  • Features that are too time consuming to write tests for, especially if it is less time and effort to assume that users and developer will create issues if the feature fails to meet expectations.

Features that lack good test coverage

  • Translations
  • States API JS
  • Webform fields

Tasks

  • Setup Drupal\Tests\BrowserTestBase example
  • Setup WebformBrowserTestBase
  • Setup Webform loader.

References

Comments

jrockowitz created an issue. See original summary.

anpolimus’s picture

Issue tags: +KyivCampCS17
jrockowitz’s picture

Issue summary: View changes
anpolimus’s picture

@jrockowitz, do you have any description for the Drupal\Tests\BrowserTestBase?
What core methods do we need?

jrockowitz’s picture

I have not ported any SImpleTests to BrowserTests. I am not really ready to use BrowserTests because the SimpleTest UI is so convenient. I also think that over the next few months there will be more documentation and tools to help convert SimpleTests to BrowserTests.

The Webform module does not have any JavaScript tests and needs more PHP Unit tests.

jrockowitz’s picture

Status: Active » Closed (outdated)