// Path: src/samples/journey-pattern-sample/src/main/java/net/serenitybdd/demos/todos/pages/todolist/items/TodoListItem.java
// public class TodoListItem {
// 
//     public static Target COMPLETE_ITEM_BUTTON = Target.the("Complete button")
//             .locatedBy( "//*[@class='view' and contains(.,'{0}')]//input[@type='checkbox']");
// 
//     public static Target DELETE_ITEM_BUTTON = Target.the("Delete button")
//             .locatedBy( "//*[@class='view' and contains(.,'{0}')]//button[@class='destroy']");
// 
//     public static Target ITEM_TEXT_LABEL = Target.the("Item text label")
//             .locatedBy("//*[@class='view' and contains(.,'{0}')]//label");
// 
//     public static Target ITEM_TEXT_INPUT = Target.the("Item text label")
//             .locatedBy("//li[contains(.,'{0}')]//form/input");
// }


import net.serenitybdd.demos.todos.pages.todolist.items.TodoListItem;
import net.serenitybdd.screenplay.Actor;
import net.serenitybdd.screenplay.Task;
import net.serenitybdd.screenplay.actions.Click;
import net.serenitybdd.screenplay.targets.Target;
import net.thucydides.core.annotations.Step;
package net.serenitybdd.demos.todos.tasks;


public class CompleteItem implements Task {

    private final String itemName;

    protected CompleteItem(String itemName) {
        this.itemName = itemName;
    }

    @Override
    @Step("{0} completes the item called #itemName")
    public <T extends Actor> void performAs(T theActor) {
// Path: src/samples/journey-pattern-sample/src/main/java/net/serenitybdd/demos/todos/pages/todolist/items/TodoListItem.java
// public class TodoListItem {
// 
//     public static Target COMPLETE_ITEM_BUTTON = Target.the("Complete button")
//             .locatedBy( "//*[@class='view' and contains(.,'{0}')]//input[@type='checkbox']");
// 
//     public static Target DELETE_ITEM_BUTTON = Target.the("Delete button")
//             .locatedBy( "//*[@class='view' and contains(.,'{0}')]//button[@class='destroy']");
// 
//     public static Target ITEM_TEXT_LABEL = Target.the("Item text label")
//             .locatedBy("//*[@class='view' and contains(.,'{0}')]//label");
// 
//     public static Target ITEM_TEXT_INPUT = Target.the("Item text label")
//             .locatedBy("//li[contains(.,'{0}')]//form/input");
// }


// Path: src/samples/journey-pattern-sample/src/main/java/net/serenitybdd/demos/todos/tasks/CompleteItem.java
import net.serenitybdd.demos.todos.pages.todolist.items.TodoListItem;
import net.serenitybdd.screenplay.Actor;
import net.serenitybdd.screenplay.Task;
import net.serenitybdd.screenplay.actions.Click;
import net.serenitybdd.screenplay.targets.Target;
import net.thucydides.core.annotations.Step;

package net.serenitybdd.demos.todos.tasks;


public class CompleteItem implements Task {

    private final String itemName;

    protected CompleteItem(String itemName) {
        this.itemName = itemName;
    }

    @Override
    @Step("{0} completes the item called #itemName")
    public <T extends Actor> void performAs(T theActor) {
        Target completeButton = TodoListItem.COMPLETE_ITEM_BUTTON.of(itemName);