DICED Cucumber, is an In-house DICE.FM extension for running our Ruby Cucumber tests directly from Visual Studio Code. This extension enables you to run tests from feature files and view the results in the sidebar.
Run Cucumber Tests: Execute your Ruby Cucumber tests directly from VS Code.
Sidebar Integration: View and manage your tests from the sidebar.
Context Menu Options: Quickly run or refresh tests from the context menu.
Detailed Reports: View detailed test reports within VS Code.
HTML Reports: Generate and view HTML reports with links in the output channel.
Run Links in Feature Files: Run tests directly from the feature files using small "Run Test" links added above each detected scenario or scenario outline example.
Rerun Last Test: Easily rerun the last executed test using a keybinding.
Usage
Running Tests
There are several ways to run your Ruby Cucumber tests using the DICED Cucumber extension:
From the Sidebar:
Click on the "Testing" icon in the sidebar to open the test explorer.
Select the test or test suite you want to run and click the play button.
From Feature Files:
Small "Run Test" links are added above each detected scenario or scenario outline example. Click these links to run the individual test.
From the Context Menu:
Right-click on a .feature file or inside an open .feature file.
Select ► Cucumber Feature to run all tests within it.
Rerun Last Test:
Press Ctrl+Shift+i (Windows/Linux) or Cmd+Shift+i (macOS) to rerun the last executed test.
Automatically on Save:
Configure your settings to run tests automatically whenever you save a .feature file.
Menu Options
The extension introduces new options in various menus:
Explorer Context Menu:
► Cucumber Feature: Run the selected feature file.
↺ Cucumber Features: Refresh the test list.
✖ Cancel Running Cucumber Tests: Cancel all running tests.
Editor Context Menu:
► Cucumber Feature: Run the feature file currently open in the editor.
↺ Cucumber Features: Refresh the test list.
✖ Cancel Running Cucumber Tests: Cancel all running tests.
Reports
After running tests, view detailed reports within VS Code:
Test Explorer:
View the status of each test, including passed, failed, and skipped tests.
Click on individual tests to see detailed results or jump to their location in their feature file.
Output Channel:
View logs and output of your test runs in the Output panel.
HTML reports are generated for each test run, providing detailed results. Links to these reports are available in the output channel.
Message Box:
After each test run, a message box will notify you if the HTML report is generated, with a link to open it directly.
Show Logs Link:
After a test run, refreshing the tests will display a "Show Logs" link, allowing you to view the detailed logs for the test runs.
Configuration
"diced-cucumber.rootDirectory":
Description: This setting specifies the path to the directory containing the "features" folder where your Cucumber tests are located. (If you are not using 'chrome_docker')
Example: If your project directory is located at "/path/to/your/project", you should set this value to "/path/to/your/project", ensuring to include the starting "/".
"diced-cucumber.domain":
Description: This setting determines the value of the DOMAIN environment variable used during test execution.
Example: To run your tests on a domain named "example-domain.com", set this value to "example-domain.com".
"diced-cucumber.browser":
Description: This setting specifies the browser to use for running the tests. The selected browser value is used to set the ENV['BROWSER'] environment variable when running tests.
Options: "chrome" or "chrome_docker"
Default: "chrome"
"diced-cucumber.headless":
Description: This setting controls whether to run the tests in headless mode. If enabled, the "headless" option is passed to ChromeDriver through Capybara. (If you are not using 'chrome_docker')