mimik0.13.0 • Public • Published
Mimik is a behavior-driven testing framework and UI automation platform. Similar to Cucumber, it enables Agile story-writing allowing all stakeholders to describe how software should behave in natural language.
Mimik focuses on simplicity and brings excitement to test writing. Tests follow a simple text structure to describe domain-specific behavior. This text structure is known as Guerkin:
Feature: Login In order to access the application As a registered user I need to be able to log in Scenario: Successful login Given I am a registered user When I enter my credentials and submit the login form Then I should see a welcome page
Mimik is built on top of some of the best open source projects available:
- BDD / Cucumber style, Feature based testing
- Supports features written in multiple languages
- Unit and Functional Testing
- Generate test source files "step definitions" automatically
- Watch for file changes and run specific tests automatically
- Supports multiple parallel test strategies
- Supports cross-browser testing
- Run functional tests on local browsers or cloud-based services
- Rich HTML5 reports
- Jira and Testrail integration
- Install and run selenium drivers automatically.
- More: views, junit output, annotation support, filtering by annotations,
- Lastly, it's Free!
npm install mimik -g
-g ensures that the mimik command is installed and accessible globally.
Create a folder structure for your test project as follows:
tests ├─ features └─ steps
Note: This structure is generally recommended, but not required.
Define your Feature
Features are the primary building blocks in Mimik. Here you describe the feature you want to test. Features will contain a title, an optional description to outline the business benefits and goals. A feature will be followed by one or multiple scenarios. Each scenario will contain a series of given/when/then steps.
create the file
features/login.feature and add the following content to it.
Feature: Login In order to access my account on Github As a registered user I need to be able to log in Scenario: Successful login Given I am a registered user When I go to github.com And I enter my credentials and submit the login form Then I should see a welcome page
Generate the Step Definitions
Run the following command to generate an empty step definition file template.
cd tests mimik generate features/login.feature
An interactive menu will guide you through the process. Select the option to save output to a file when prompted, as follows:
The generated step definition file should look like this:
// Given I am a registered user;// When I go to github.com;// And I enter my credentials and submit the login form;// Then I should see a welcome page;
We will edit the generated files further down. For now, let's run the feature as is.
Now that the feature is defined and the corresponding step definition file is generated, go ahead and run mimik from the
If all the steps above were executed properly, you will get the following output (output is colored):
Found 1 feature ---------------------------------------------------------- Feature: Login #tests/features/login.feature Tested in firefox Scenario: Successful login ✓ Given I am a registered user ✓ When I go to github.com ✓ And I enter my credentials and submit the login form ✓ Then I should see a welcome page ---------- ----------- ------------- -------- --------- -------- Features Scenarios Total Steps Passed Skipped Failed ---------- ----------- ------------- -------- --------- -------- 1 1 4 ✓ 4 0 0 Completed 1 feature in 1.37s
Update the Step Defintions
You can access the full documentation here.
The Mimik command
Usage: mimik [options] [command] Commands: run run feature tests found in the [target] path watch watch for file changes in the [target] path, then run feature tests generate generate step definition templates for the specified feature file <path> Options: -h, --help output usage information -V, --version output the version number -c, --config <path> specify an external config file -b, --browsers <names> comma-delimited <names> of local browsers to use (chrome|firefox|ie|safari|phantomjs) -m, --match <pattern> only run features matching <pattern> --match-invert inverts --match results -T, --tags <names> only run feature tests annotated with one of the comma-delimited tag <names> -E, --exclude-tags <names> exclude feature tests annotated with one of the comma-delimited tag <names> -t, --timeout <ms> set per-test timeout in milliseconds  -s, --slow <ms> `slow` test threshold in milliseconds  -f, --failfast stop running tests on the first encoutered failure or timeout --test-strategy <name> `test` runs various tests in parallel. `browser` runs each test against mutiple browsers [test] --reporters <names> comma-delimited report <names> to enable. available options: junit,html --report-path <path> path for the generated reports --rerun <path> rerun failed tests recorded in `failed.dat` from the last test run --debug enable debug logging --log <path> output a log file to filename Run mimik [command] --help to see description and available options for a particular command
Options for the watch command
Usage: watch [options] [path ...] Options: -h, --help output usage information -d, --watch-delay <ms> Buffers multiple changes into a single run using a delay in milliseconds 
The Selenium Launcher command
Usage: wdlauncher [command] Commands: start start the selenium standalone server install install or update missing selenium driver binaries status display the current available driver binaries Options: -h, --help output usage information --output <path> path to the location of the binaries -p,--port <num> optional port for the selenium standalone server --auto-install auto install missing binaries before starting the selenium server --overwrite force download existing binaries --debug enable debug logging --log <path> path including file name to create a file log
See the examples folder.
MIT. See LICENSE-MIT.