TestComplete samples (both built-in and additional) are located in the <Users>\Public\Public Documents\TestComplete 14 Samples folder.
Some file managers display the Public Documents folder as Documents.
Behavior-driven development (BDD) is a software development methodology that combines technical aspects and business interests. It implies that the team decides what to test and to what extent, and creates test scenarios in a simple language (like Gherkin) that is understandable by even non-technical-savvy employees.
In TestComplete, you can create such BDD tests against desktop, web and mobile applications, you can also automate their test steps and run these tests daily.
To create and run BDD tests in TestComplete, you use the Scenarios project item. It contains child items (called features) that correspond to .feature files or feature descriptions used by such tools as HipTest or Cucumber:
BDD scenarios describe test cases in a plain-text form, and though they use Gherkin keywords, they can be created by non-technical-savvy employees. Quite often, they are written by product managers or subject matter experts, and are automated by the QA team or special automation engineers.
The latter can import scenarios to TestComplete and automate the scenarios’ test steps. After that, they can include BDD scenarios in automated tests that run on a daily basis.
As you can see, for each function, TestComplete also generates an expression that links a function to a test step:
When you run a scenario, TestComplete will run the script functions that match the test steps of this scenario.
For more information on the syntax of these expressions, see Binding Script Functions to Test Steps.
After you generate script functions for test steps, you can create function bodies. You can either write script code manually, or record a script. See Create Test Step Scripts.
After you create script code, you can run your BDD scenarios. The easiest way to do this is to right-click a scenario in the Gherkin editor and to select Run This Scenario from the context menu:
You can also run BDD tests as test items of your project, from scripts and from the command line. See Run BDD Tests. In other words, you can easily include BDD tests in your automated test set and run them on a regular basis.
Tip: It is considered to be a good approach to assign tags to feature files and individual scenarios in them, and then run BDD tests by tags. See Tags for complete information on this.
In TestComplete, you can create BDD scenarios anew in the Gherkin editor, import them from a feature file on your hard drive, or import them from HipTest. HipTest is a cloud-based test platform by SmartBear for Agile testing and behavior-driven development. It’s a feature-rich solution that enables you to create BDD scenarios quickly and easily, maintain these scenarios and run them.
TestComplete tightly integrates with HipTest. Your team can continue using HipTest to create and update BDD scenarios, and use TestComplete to automate and run these scenarios. This approach helps you save time and resources needed to run tests and work more on test automation, increasing the number of automated tests and test coverage.
For complete information on HipTest support in TestComplete, see HipTest Integration.
TestComplete includes a sample BDD test project that contains a few scenarios and scripts that automate the test steps. To open the project, simply select Samples > BDD on the TestComplete start page:
You can also open the project file from your hard drive: <TestComplete 14 Samples>\BDD\WebStore_BDDSample.pjs.