// Path: src/samples/journey-pattern-sample/src/main/java/net/serenitybdd/demos/todos/model/TodoStatusFilter.java
// public enum TodoStatusFilter {
//     All, Active, Completed
// }
// 
// Path: src/samples/journey-pattern-sample/src/main/java/net/serenitybdd/demos/todos/pages/todolist/filter/FilterSelection.java
// public class FilterSelection {
//     public static Target SELECTED_FILTER = Target.the("selected filter").locatedBy("#filters li .selected");
//     public static Target FILTER = Target.the("filter").locatedBy("//*[@id='filters']//a[.='{0}']");
// }


import net.serenitybdd.demos.todos.model.TodoStatusFilter;
import net.serenitybdd.demos.todos.pages.todolist.filter.FilterSelection;
import net.serenitybdd.screenplay.Actor;
import net.serenitybdd.screenplay.Question;
import net.serenitybdd.screenplay.annotations.Subject;
import net.serenitybdd.screenplay.questions.Text;
package net.serenitybdd.demos.todos.questions;


@Subject("the displayed todo items")
public class CurrentFilter implements Question<TodoStatusFilter> {

    @Override
    public TodoStatusFilter answeredBy(Actor actor) {
// Path: src/samples/journey-pattern-sample/src/main/java/net/serenitybdd/demos/todos/model/TodoStatusFilter.java
// public enum TodoStatusFilter {
//     All, Active, Completed
// }
// 
// Path: src/samples/journey-pattern-sample/src/main/java/net/serenitybdd/demos/todos/pages/todolist/filter/FilterSelection.java
// public class FilterSelection {
//     public static Target SELECTED_FILTER = Target.the("selected filter").locatedBy("#filters li .selected");
//     public static Target FILTER = Target.the("filter").locatedBy("//*[@id='filters']//a[.='{0}']");
// }


// Path: src/samples/journey-pattern-sample/src/main/java/net/serenitybdd/demos/todos/questions/CurrentFilter.java
import net.serenitybdd.demos.todos.model.TodoStatusFilter;
import net.serenitybdd.demos.todos.pages.todolist.filter.FilterSelection;
import net.serenitybdd.screenplay.Actor;
import net.serenitybdd.screenplay.Question;
import net.serenitybdd.screenplay.annotations.Subject;
import net.serenitybdd.screenplay.questions.Text;

package net.serenitybdd.demos.todos.questions;


@Subject("the displayed todo items")
public class CurrentFilter implements Question<TodoStatusFilter> {

    @Override
    public TodoStatusFilter answeredBy(Actor actor) {
        return Text.of(FilterSelection.SELECTED_FILTER).viewedBy(actor).asEnum(TodoStatusFilter.class);