// 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;

    private void theIssueOfEachFixtureCallsIsAddedAtEachRow() throws IOException {
        Elements raws = jUnitHtmlHelper.html.select("div.panel-body > table > tbody > tr ");
        Assert.assertTrue(raws.get(0).select("td").get(3).hasClass("succeeded"));
        Assert.assertTrue(raws.get(1).select("td").get(3).hasClass("succeeded"));
        Assert.assertTrue(raws.get(2).select("td").get(3).hasClass("failed"));
        Assert.assertTrue(raws.get(3).select("td").get(3).hasClass("ignored"));
    }

    private void columnHeaderAreFieldNames() throws IOException {
        Elements columnHeaders = jUnitHtmlHelper.html.select("div.panel-body > table > thead > tr > th");
        Assert.assertEquals(4, columnHeaders.size());
        Assert.assertEquals("first", columnHeaders.get(0).text());
        Assert.assertEquals("second", columnHeaders.get(1).text());
        Assert.assertEquals("sum", columnHeaders.get(2).text());
        Assert.assertEquals("", columnHeaders.get(3).text());
    }

    private void eachValuesAreDisplayed() throws IOException {
        Elements raws = jUnitHtmlHelper.html.select("div.panel-body > table > tbody > tr ");
        Assert.assertEquals(4, raws.size());
        Assert.assertEquals("1", raws.get(0).select("td").get(0).text());
        Assert.assertEquals("1", raws.get(0).select("td").get(1).text());
        Assert.assertEquals("2", raws.get(0).select("td").get(2).text());

        Assert.assertEquals("8", raws.get(2).select("td").get(0).text());
        Assert.assertEquals("2", raws.get(2).select("td").get(1).text());
        Assert.assertEquals("9", raws.get(2).select("td").get(2).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;


    private void theIssueOfEachFixtureCallsIsAddedAtEachRow() throws IOException {
        Elements raws = jUnitHtmlHelper.html.select("div.panel-body > table > tbody > tr ");
        Assert.assertTrue(raws.get(0).select("td").get(3).hasClass("succeeded"));
        Assert.assertTrue(raws.get(1).select("td").get(3).hasClass("succeeded"));
        Assert.assertTrue(raws.get(2).select("td").get(3).hasClass("failed"));
        Assert.assertTrue(raws.get(3).select("td").get(3).hasClass("ignored"));
    }

    private void columnHeaderAreFieldNames() throws IOException {
        Elements columnHeaders = jUnitHtmlHelper.html.select("div.panel-body > table > thead > tr > th");
        Assert.assertEquals(4, columnHeaders.size());
        Assert.assertEquals("first", columnHeaders.get(0).text());
        Assert.assertEquals("second", columnHeaders.get(1).text());
        Assert.assertEquals("sum", columnHeaders.get(2).text());
        Assert.assertEquals("", columnHeaders.get(3).text());
    }

    private void eachValuesAreDisplayed() throws IOException {
        Elements raws = jUnitHtmlHelper.html.select("div.panel-body > table > tbody > tr ");
        Assert.assertEquals(4, raws.size());
        Assert.assertEquals("1", raws.get(0).select("td").get(0).text());
        Assert.assertEquals("1", raws.get(0).select("td").get(1).text());
        Assert.assertEquals("2", raws.get(0).select("td").get(2).text());

        Assert.assertEquals("8", raws.get(2).select("td").get(0).text());
        Assert.assertEquals("2", raws.get(2).select("td").get(1).text());
        Assert.assertEquals("9", raws.get(2).select("td").get(2).text());
    }

    @Text("The table title is ${tableTitle} ")