Skip to content

Testing Tools for E2E & UI Unit Test

Fionna Chan edited this page Jul 3, 2020 · 2 revisions

Karibu can be used for 1) E2E integration tests and 2) unit tests for individual components.

We have Selenium BDD tests with pretty good coverage for E2E already.

Our use case for Karibu would be 2) unit tests for individual components.

Tool Selenium Karibu
Type End-to-end test
Black box testing
High level
Unit test
White box testing
Lower level
Objectives - Implementation matches user story / user acceptance criteria
- Ensure every part of the web app works together
- Test for component requirement (e.g. input/output) from developer’s perspective
- Ensure component itself as a module without any dependency functions as expected
Test example
acceptance criteria
(Notes field)
Testing if the notes is saved (check that it’s saved into the DB)
Given the user has logged in to Pathmind
When the user adds notes “ABCD” to the notes field on Experiment View for Project “Path” Model 3 Experiment 12
And the user goes to the Dashboard
Then the user should see “ABCD” as the Experiment notes for Project “Path” Model 3 Experiment 12
Testing if the notes is saved (check that the notes component is at its saved state on the UI)
If the user inputs “ABCD” in a notes field component
The user clicks outside of the notes field component (done by triggering the component on blur event)
The green checkmark next to the “Save” button is visible
Changes required when there are code refactoring regarding the DOM and the functional code that don’t change user interactions Minimal changes for selecting the DOM element with XPath Tests have to be refactored because unit tests should test for implementation details
Test creation Test engineer Developer implementing the component
Test creation process For New Features
On the same branch where a feature that affects any user story, the developer is responsible for the feature, and the test engineer will add the E2E tests

For Existing Features
When there is a change to a feature that impacts any user story, the developer should try to modify the existing E2E tests.
For existing user stories without tests, the test engineer will decide on when to add the tests.
For New Components
When the developer is creating a component, Karibu unit tests need to be implemented on the same branch by the developer

For Existing Components
Once Karibu is implemented into the codebase, there will be a ticket for adding Karibu unit tests to each component.
The tickets can be worked on either when there’s a change to the component, or as a separate tech-debt repayment task.
Test maintenance when there are changes Developers
(if it’s too complicated, test engineer can take over)
Developers
Env setup to run tests Set up the whole app, run on an actual / headless browser No need to run webapp, browserless

Clone this wiki locally