{"id":52,"date":"2014-02-11T05:11:46","date_gmt":"2014-02-11T11:11:46","guid":{"rendered":"http:\/\/blog.cigniti.com\/?p=52"},"modified":"2018-10-11T16:57:18","modified_gmt":"2018-10-11T11:27:18","slug":"twisting-the-test-automation-brain-to-work-with-twist","status":"publish","type":"post","link":"https:\/\/www.cigniti.com\/blog\/twisting-the-test-automation-brain-to-work-with-twist\/","title":{"rendered":"Twisting the test automation brain to work with TWIST"},"content":{"rendered":"

Twist is a test automation tool from ThoughtWorks that creates and maintains test automation suites in an Agile environment. Let us dig deeper into various features Twist provides and discover the approach from the perspective of a test automation engineer.<\/p>\n

TWISTing Eclipse<\/strong><\/p>\n

Twist allows you to create tests in form of Scenarios\/Business workflows or more apt behaviors. Twist is built on the popular eclipse IDE platform. Of course the platform has been customized to enable tool usage.<\/p>\n

Twist is based on the concepts of tools like Cucumber, Robot Framework and Fitnesse, but adds a layer of customization to make it more maintainable and readable.<\/p>\n

Although Cucumber and Robot have unique ways of creating scenarios, I will present Twist\u2019s differentiators to the stakeholders who are habituated to a more conventional approach of test automation. From my perspective, I will also talk about the disadvantages that Twist has over conventional approaches.<\/p>\n

Creating a test scenario with a TWIST<\/strong><\/p>\n

In Twist or any other BDD test tool, the test scripts are maintained as behaviors, scenarios or business workflows. Twist lets you create a scenario which is saved as a .scn(scenario) file and run as a test.<\/p>\n

Creating a scenario in Twist is pretty simple. Just click on “Business Workflow” button in the editor and you can start writing your steps.<\/p>\n

Refer to the following screenshot:<\/strong><\/p>\n

\"\"<\/p>\n

Each workflow has multiple steps which define the behavior of application. Now that we have seen how to write a simple step, let\u2019s add the complication, because you would want steps to pass some parameters. The succeeding section elaborates how this “English-like” script gets executed (It might not be a surprise to people who have already worked on Cucumber or Fitnesse!!).<\/p>\n

Parameterizing the test<\/strong><\/p>\n

As shown in the screen shot of how the parameterization, you essentially specify the parameters in double quotes (“) and Twist understands them to be parameters to the step. The key point here is that only the order of parameters is important, not their position.<\/p>\n

Refer to the following screenshot:<\/strong><\/p>\n

\"\"<\/p>\n

Data Drive the test?<\/strong><\/p>\n

Now that we have parameterized the test, it is time<\/p>\n

we data drive it as per Twist\u2019s rule table. This is similar to Cucumber\u2019s examples. Of course, Twist adds a bit of intuition to the way we data drive tests using something called rules tables where user can create a table with related data.<\/p>\n

Nesting the steps and complicating it all<\/p>\n

Now that we have parameterized and created data driven tests, it is time to include some reusability into our tests. This can be achieved in multiple ways in Twist<\/p>\n