// Path: sft-core/src/test/java/sft/integration/fixtures/SftResources.java
// public class SftResources {
// 
//     private final Class callerClass;
//     private final JavaResource javaResource;
//     private final SftResource htmlResource;
// 
//     public SftResources(Class callerClass, Class functionalTestClass) {
//         this.callerClass = callerClass;
//         javaResource = new JavaResource(functionalTestClass);
//         htmlResource = new SftResource(functionalTestClass);
//     }
// 
//     @Override
//     public String toString() {
//         return "<div class='resources'>" + javaResource.getOpenResourceHtmlLink(callerClass, "java", "alert-info") +
//                 htmlResource.getOpenResourceHtmlLink(callerClass, "html", "alert-info") + "</div>";
//     }
// }
// 
// Path: sft-core/src/test/java/sft/integration/use/sut/decorators/subUseCase/SubUseCaseBreadcrumb.java
// @Decorate(decorator = Breadcrumb.class)
// public class SubUseCaseBreadcrumb {
//     @FixturesHelper
//     private SftFixturesHelper sftFixturesHelper = new SftFixturesHelper();
// 
//     public SubSubUseCaseBreadcrumb subSubUseCaseBreadcrumb= new SubSubUseCaseBreadcrumb();
// 
//     @Test
//     public void test(){
//         sftFixturesHelper.doStuff();
//     }
// }


import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import sft.Decorate;
import sft.Displayable;
import sft.FixturesHelper;
import sft.SimpleFunctionalTest;
import sft.Text;
import sft.decorators.Breadcrumb;
import sft.integration.fixtures.JUnitHtmlHelper;
import sft.integration.fixtures.SftResources;
import sft.integration.use.sut.decorators.*;
import sft.integration.use.sut.decorators.subUseCase.SubSubUseCaseBreadcrumb;
import sft.integration.use.sut.decorators.subUseCase.SubUseCaseBreadcrumb;
import java.io.IOException;
import java.util.ArrayList;
        Assert.assertTrue("Expecting class " + style + " in body", jUnitHtmlHelper.html.select("body.useCase").hasClass(style));
    }

    @Text("Several style can be used together @Decorate(decorator = Style.class, parameters ={\"${style1}\",\"${style2}\",\"${style3}\"}) ")
    private void severalStylesCanBeSpecified(String style1, String style2, String style3) throws Exception {
        final Elements select = jUnitHtmlHelper.html.select("div.scenario");
        Assert.assertTrue("Expecting class " + style1 + " in scenario div", select.hasClass(style1));
        Assert.assertTrue("Expecting class " + style2 + " in scenario div", select.hasClass(style2));
        Assert.assertTrue("Expecting class " + style3 + " in scenario div", select.hasClass(style3));
    }

    @Text("The style decorator can be apply on use case, scenario, fixture and sub use case")
    private void theStyleDecoratorCanBeApplyOnUseCaseScenarioFixtureAndSubUseCase() throws Exception {
        final Document htmlReport = jUnitHtmlHelper.html;
        Assert.assertTrue("Expecting class style in body", htmlReport.select("body.useCase").hasClass("style"));
        Assert.assertTrue("Expecting class style1 in scenario div", htmlReport.select("div.scenario").hasClass("style1"));
        Assert.assertTrue("Expecting class style4 in instruction div", htmlReport.select("div.instruction").hasClass("style4"));
        Assert.assertTrue("Expecting class style5 in relatedUseCase li", htmlReport.select("li.relatedUseCase").hasClass("style5"));
    }

    private void byAddingBreadcrumbDecoratorOnUseCase() throws Exception {
        jUnitHtmlHelper.run(this.getClass(), BreadcrumbDecoratorSample.class);
        displayableResources = new DisplayableResources("parent user story", jUnitHtmlHelper.displayResources);
    }

    private void aBreadcrumbsIsAddedAfterTitle() throws Exception {
        Elements breadcrumbs = jUnitHtmlHelper.html.select("ol.breadcrumb");
        Assert.assertEquals(1, breadcrumbs.select("li").size());
        Assert.assertEquals("Breadcrumb decorator sample", breadcrumbs.select("li").get(0).text());

// Path: sft-core/src/test/java/sft/integration/fixtures/SftResources.java
// public class SftResources {
// 
//     private final Class callerClass;
//     private final JavaResource javaResource;
//     private final SftResource htmlResource;
// 
//     public SftResources(Class callerClass, Class functionalTestClass) {
//         this.callerClass = callerClass;
//         javaResource = new JavaResource(functionalTestClass);
//         htmlResource = new SftResource(functionalTestClass);
//     }
// 
//     @Override
//     public String toString() {
//         return "<div class='resources'>" + javaResource.getOpenResourceHtmlLink(callerClass, "java", "alert-info") +
//                 htmlResource.getOpenResourceHtmlLink(callerClass, "html", "alert-info") + "</div>";
//     }
// }
// 
// Path: sft-core/src/test/java/sft/integration/use/sut/decorators/subUseCase/SubUseCaseBreadcrumb.java
// @Decorate(decorator = Breadcrumb.class)
// public class SubUseCaseBreadcrumb {
//     @FixturesHelper
//     private SftFixturesHelper sftFixturesHelper = new SftFixturesHelper();
// 
//     public SubSubUseCaseBreadcrumb subSubUseCaseBreadcrumb= new SubSubUseCaseBreadcrumb();
// 
//     @Test
//     public void test(){
//         sftFixturesHelper.doStuff();
//     }
// }


// Path: sft-core/src/test/java/sft/integration/use/UsingDecorator.java
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import sft.Decorate;
import sft.Displayable;
import sft.FixturesHelper;
import sft.SimpleFunctionalTest;
import sft.Text;
import sft.decorators.Breadcrumb;
import sft.integration.fixtures.JUnitHtmlHelper;
import sft.integration.fixtures.SftResources;
import sft.integration.use.sut.decorators.*;
import sft.integration.use.sut.decorators.subUseCase.SubSubUseCaseBreadcrumb;
import sft.integration.use.sut.decorators.subUseCase.SubUseCaseBreadcrumb;
import java.io.IOException;
import java.util.ArrayList;

        Assert.assertTrue("Expecting class " + style + " in body", jUnitHtmlHelper.html.select("body.useCase").hasClass(style));
    }

    @Text("Several style can be used together @Decorate(decorator = Style.class, parameters ={\"${style1}\",\"${style2}\",\"${style3}\"}) ")
    private void severalStylesCanBeSpecified(String style1, String style2, String style3) throws Exception {
        final Elements select = jUnitHtmlHelper.html.select("div.scenario");
        Assert.assertTrue("Expecting class " + style1 + " in scenario div", select.hasClass(style1));
        Assert.assertTrue("Expecting class " + style2 + " in scenario div", select.hasClass(style2));
        Assert.assertTrue("Expecting class " + style3 + " in scenario div", select.hasClass(style3));
    }

    @Text("The style decorator can be apply on use case, scenario, fixture and sub use case")
    private void theStyleDecoratorCanBeApplyOnUseCaseScenarioFixtureAndSubUseCase() throws Exception {
        final Document htmlReport = jUnitHtmlHelper.html;
        Assert.assertTrue("Expecting class style in body", htmlReport.select("body.useCase").hasClass("style"));
        Assert.assertTrue("Expecting class style1 in scenario div", htmlReport.select("div.scenario").hasClass("style1"));
        Assert.assertTrue("Expecting class style4 in instruction div", htmlReport.select("div.instruction").hasClass("style4"));
        Assert.assertTrue("Expecting class style5 in relatedUseCase li", htmlReport.select("li.relatedUseCase").hasClass("style5"));
    }

    private void byAddingBreadcrumbDecoratorOnUseCase() throws Exception {
        jUnitHtmlHelper.run(this.getClass(), BreadcrumbDecoratorSample.class);
        displayableResources = new DisplayableResources("parent user story", jUnitHtmlHelper.displayResources);
    }

    private void aBreadcrumbsIsAddedAfterTitle() throws Exception {
        Elements breadcrumbs = jUnitHtmlHelper.html.select("ol.breadcrumb");
        Assert.assertEquals(1, breadcrumbs.select("li").size());
        Assert.assertEquals("Breadcrumb decorator sample", breadcrumbs.select("li").get(0).text());

        jUnitHtmlHelper.run(this.getClass(), SubUseCaseBreadcrumb.class);