Ruby provides a standard Test::Unit
library for unit testing.
In TestComplete, you can run Ruby unit tests and Selenium tests created by using the RubyUnit testing framework as part of your TestComplete project. In the RubyUnit Test editor, you configure the tests to be run.
To learn about TestComplete support for third-party unit testing frameworks, see —
Integration With Unit Testing Frameworks
To learn about TestComplete support for Selenium WebDriver tests, see —
Requirements
-
To run the RubyUnit tests, specify the path to the Ruby executable (ruby.exe) in the Unit Testing Options dialog.
To open the dialog, select Tools | Options from the TestComplete main menu and then select Engines | Unit Testing in the resulting Options dialog.
-
To run Selenium tests, make sure that your computer and TestComplete project meet the requirements described in Integration With Selenium - Prerequisites.
1. Prepare Your Test Machine, TestComplete and Tests
-
Make sure that the computer where you will run tests, TestComplete and your tests are prepared for testing.
To learn how to prepare Selenium tests for testing, see –
-
Copy your Ruby test files to your TestComplete computer.
2. Configure Your TestComplete Project
-
Open your TestComplete test project or create a new one.
-
Add a Selenium or Unit Testing collection to your test project. See Adding and Removing Project Items and Their Child Elements.
-
Add a RubyUnit item to the created collection.
3. Configure the RubyUnit Item to Run Needed Tests
-
In Module, enter the path to your Ruby module (.rb). You can click the ellipsis button and browse for the Ruby module in the subsequent dialog.
-
Select the mode you want to use to run tests:
-
To run all tests defined in your Ruby module, select Run all tests from the module in the Modes section.
-
To run only specific tests, select Run specified tests in the Modes section.
On the Tests list, specify the tests you want to run. To add a test, click Add and enter the test name. You can enter the test method name, for example,
test1
, or the test method name with its test case class name separated by#
, for example,TestCaseClass1#test1
.To remove a selected test from the list, click Remove. To temporary exclude a test from a test run, clear the check box next to the test name in the list.
-
4. Run the RubyUnit Test Item
Run the RubyUnit test item in TestComplete. For information on how to run unit test items, see Running RubyUnit Tests and Selenium Tests Created With RubyUnit.
TestComplete will command Ruby to run the specified test cases.
After the test run is over, view the test results.
See Also
Integration With Unit Testing Frameworks
Running RubyUnit Tests and Selenium Tests Created With RubyUnit
Integration With Selenium
Unit Testing Options Dialog