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: LoginIn order to access the applicationAs a registered userI need to be able to log inScenario: Successful loginGiven I am a registered userWhen I enter my credentials and submit the login formThen I should see a welcome page
Mimik is built on top of some of the best open source projects available:
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.
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: LoginIn order to access my account on GithubAs a registered userI need to be able to log inScenario: Successful loginGiven I am a registered userWhen I go to github.comAnd I enter my credentials and submit the login formThen I should see a welcome page
Run the following command to generate an empty step definition file template.
cd testsmimik 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.featureTested in firefoxScenario: 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 0Completed 1 feature in 1.37s
You can access the full documentation here.
Usage: mimik [options] [command]Commands:run run feature tests found in the [target] pathwatch watch for file changes in the [target] path, then run feature testsgenerate 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 filenameRun mimik [command] --help to see description and available options for a particular 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 
Usage: wdlauncher [command]Commands:start start the selenium standalone serverinstall install or update missing selenium driver binariesstatus display the current available driver binariesOptions:-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.