Hello, World
Let us create the a scenario that will test the blog.
- Paste the following text into the scenario:
As a user I should be able to see my blog home page when the browser opens up. At The Home Page: #verify that the blog title is "My blog"
- Press CTRL+1 to implement the workflow title. This will open a wizard that allows you to create the underlying code.
- Specify a package name for your Java class. Click Finish. You will now see an empty java class.
- Apply Quick Fix again (CTRL+1) to create an implementation of the workflow step.
- Navigate to the workflow step implementation by CTRL+Clicking on the workflow step. You can also navigate by pressing F3.
- Add a statement to the constructor to open the blog home page, and the verify step to verify that the text is present on the page. The Java class would now look like the code below:
- Go back to the scenario and click Execute to execute the scenario. You will see a browser open. You will also see a green bar in the Scenario View once the execution completes.
A workflow is shown in a light brown color to indicate that it needs to be implemented.
CTRL+1 is the magic key that will assist you in fixing errors and problems in the Scenario and Java editors.
package com.thoughtworks.blog.workflows;
import static junit.framework.Assert.*;
import com.thoughtworks.twist.driver.selenium.TwistSelenium;
public class AtTheHomePage {
private TwistSelenium selenium;
public AtTheHomePage(TwistSelenium selenium) {
this.selenium = selenium;
selenium.open("/blog"); //open the home page
}
public void verifyThatTheBlogTitleIs(String text) {
assertTrue(selenium.isTextPresent(text));
}
}

Congratulations! You have now successfully created, implemented and executed a scenario.
Proceed to Login into the blog.