ddev / ddev-ui

A not-currently-maintained user Interface that provides a graphical way of interacting with DDEV Local
https://www.ddev.com/
Apache License 2.0
20 stars 5 forks source link

Integration and UI Testing #58

Open rickmanelius opened 6 years ago

rickmanelius commented 6 years ago

What happened (or feature request):

Updated A/C - 11/27/18


Given the amount of user interaction on the UI, we probably need a more robust approach for integration testing with sample data.

This epic includes:

rickmanelius commented 6 years ago

As part of our focus on foundational items in milestone v0.3, I think it would be wise to review how we're currently doing integration tests and re-evaluate to see if we need to take a different approach to ensure proper coverage of all functionality through v0.2 and that it will persist moving forward.

rfay commented 6 years ago

There are probably 3 specific areas that I think need implementation in terms of tests.

  1. Direct integration testing between ddev-ui and ddev, with real projects. So for example, a test to create a site would actually create a site and verify that it came up correctly.
  2. Testing of any ddev-ui actions that change anything on the filesystem. So for example, if we take any action (like untarring an archive), test to make sure that happened on the filesystem.
  3. Actual UI testing. I see a number of electron testing possibilities with a google search
andrew-c-tran commented 6 years ago

Current Test Strategy is Mocha unit tests that leverage fixtures and mocks to simulate output from modules with controlled input. What is lacking is integration tests that actually exercise an actual CLI instance, and browser-level click testing a-la selenium.

Proposed solution:

Testing with Spectron allows us to test the electron specific features as well as verify the presentational flow (clicks, modals, spinner appearance, etc) so that's highly preferred. The unit tests will ensure the modules are behaving as expected, the integration will verify the contract between CLI and ddev-shell wrapper are good and have not changed/broken with later builds.

One problem that after hours of searching I still have no answer to: how the heck can we test sudo access via a test? Though this won't be an issue any longer if/when we get the hostname issue resolved.

rfay commented 6 years ago

There are a couple of levels of integration we need to deal with:

They can be separate approaches.

On sudo: It's possible we don't have to test it. If the test setup creates the needed hostnames in /etc/hosts, sudo will never be needed. We would rather test sudo usage of course. But ddev start would run in this situation without needing any privileges.

dclear commented 6 years ago

TODO: update this issue with the agreed, initial testing strategy.

dclear commented 6 years ago

adding @mafriend - this is an epic that contains (some) of the current priorities around testing