How to call a step in Step definition in TestComplete
- 6 years ago
Hi,
What about this:
[Binding]
public class MySteps: Steps
{Given("I want to create a sales order") ------------Senario 1 - step definition
public void CreateSalesOrder()
{__CreateSalesOrder();
}
Given("I open the sales order page") ------------Senario 1 - step definition
public void SalesOrderOpened()
{__SalesOrderOpened();
}
Given("I click the add new order button") ------------Senario 1 - step definition
public void ClickNewButton()
{__ClickNewButton();
}
Then("a new sales order is created") ------------Senario 1 - step definition
public void OrderCreated()
{__OrderCreated();
}
public void __CreateOrder()
{__CreateSalesOrder();
__SalesOrderOpened();
__ClickNewButton();
__OrderCreated();
}
------For scenario 2's first step which would be calling scenario 1 step definitions
[Given("I have created an order")]
public void CreateOrder()
{__CreateOrder();
}