Package net.mindengine.galen.specs.page

Examples of net.mindengine.galen.specs.page.PageSection


    @Test(dependsOnMethods = BASE_TEST)
    public void shouldRead_parameterizedSpecs() {
        List<PageSection> sections = pageSpec.findSections(asList("parameterized"));
        assertThat(sections.size(), is(1));
       
        PageSection section = sections.get(0);
       
        List<ObjectSpecs> objects = section.getObjects();
       
        assertThat(objects.size(), is(6));
       
        for (int index = 1; index <=6; index++) {
            ObjectSpecs objectSpecs = objects.get(index - 1);
View Full Code Here


    @Test(dependsOnMethods = BASE_TEST)
    public void shouldRead_parameterizedSpecs_2() {
        List<PageSection> sections = pageSpec.findSections(asList("parameterized2"));
        assertThat(sections.size(), is(1));
       
        PageSection section = sections.get(0);
       
        List<ObjectSpecs> objects = section.getObjects();
       
        assertThat(objects.size(), is(6));
       
        //[ 1, 3, 6-8, 10]
        int[] indexes = {1, 3, 6, 7, 8, 10};
View Full Code Here

        PageSpec pageSpec = pageSpecReader.read(getClass().getResource("/specs/spec-conditional-simple.spec").getFile());
       
        List<PageSection> sections = pageSpec.getSections();
        assertThat(sections.size(), is(1));
       
        PageSection pageSection = sections.get(0);
        List<ConditionalBlock> blocks = pageSection.getConditionalBlocks();
        assertThat(blocks.size(), is(1));
       
        ConditionalBlock block = blocks.get(0);
        List<ConditionalBlockStatement> statements = block.getStatements();
        assertThat(statements.size(), is(1));
        ConditionalBlockStatement statement = statements.get(0);
        assertThat(statement.isInverted(), is(false));
       
        List<ObjectSpecs> statementObjects = statement.getObjects();
        assertThat(statementObjects.size(), is(2));
        assertThat(statementObjects.get(0).getObjectName(), is("button-1"));
        assertThat(statementObjects.get(0).getSpecs().get(0).getOriginalText(), is("width: > 100px"));
        assertThat(statementObjects.get(1).getObjectName(), is("button-2"));
        assertThat(statementObjects.get(1).getSpecs().get(0).getOriginalText(), is("height: < 50px"));
        assertThat(statementObjects.get(1).getSpecs().get(1).getOriginalText(), is("width: 200px"));
       
        List<ObjectSpecs> bodyObjects = block.getBodyObjects();
        assertThat(bodyObjects.size(), is(2));
        assertThat(bodyObjects.get(0).getObjectName(), is("button-1"));
        assertThat(bodyObjects.get(0).getSpecs().get(0).getOriginalText(), is("above: button-2 0px"));
        assertThat(bodyObjects.get(1).getObjectName(), is("button-2"));
        assertThat(bodyObjects.get(1).getSpecs().get(0).getOriginalText(), is("below: button-1 0px"));
       
       
        List<ObjectSpecs> sectionObjects = pageSection.getObjects();
        assertThat(sectionObjects.size(), is(2));
        assertThat(sectionObjects.get(0).getObjectName(), is("textfield"));
        assertThat(sectionObjects.get(0).getObjectName(), is("textfield"));
    }
View Full Code Here

        PageSpec pageSpec = pageSpecReader.read(getClass().getResource("/specs/spec-conditional-or.spec").getFile());
       
        List<PageSection> sections = pageSpec.getSections();
        assertThat(sections.size(), is(1));
       
        PageSection pageSection = sections.get(0);
        List<ConditionalBlock> blocks = pageSection.getConditionalBlocks();
        assertThat(blocks.size(), is(1));
       
        ConditionalBlock block = blocks.get(0);
        List<ConditionalBlockStatement> statements = block.getStatements();
        assertThat(statements.size(), is(3));
View Full Code Here

        PageSpec pageSpec = pageSpecReader.read(getClass().getResource("/specs/spec-conditional-inverted.spec").getFile());
       
        List<PageSection> sections = pageSpec.getSections();
        assertThat(sections.size(), is(1));
       
        PageSection pageSection = sections.get(0);
        List<ConditionalBlock> blocks = pageSection.getConditionalBlocks();
        assertThat(blocks.size(), is(1));
       
        ConditionalBlock block = blocks.get(0);
        List<ConditionalBlockStatement> statements = block.getStatements();
        assertThat(statements.size(), is(2));
View Full Code Here

        PageSpec pageSpec = pageSpecReader.read(getClass().getResource("/specs/spec-conditional-otherwise.spec").getFile());
       
        List<PageSection> sections = pageSpec.getSections();
        assertThat(sections.size(), is(1));
       
        PageSection pageSection = sections.get(0);
        List<ConditionalBlock> blocks = pageSection.getConditionalBlocks();
        assertThat(blocks.size(), is(1));
       
        ConditionalBlock block = blocks.get(0);
        List<ConditionalBlockStatement> statements = block.getStatements();
        assertThat(statements.size(), is(1));
View Full Code Here

    public void shouldParse_componentSpecs() throws Exception {
        PageSpec pageSpec = pageSpecReader.read(getClass().getResource("/specs/components/spec-for-component-test-main.spec").getFile());
        List<PageSection> sections = pageSpec.getSections();
        assertThat(sections.size(), is(1));
       
        PageSection pageSection = sections.get(0);
       
        List<ObjectSpecs> objects = pageSection.getObjects();
        assertThat(objects.size(), is(3));
       
        assertThat(objects.get(0).getObjectName(), is("user-profile-1"));
        assertThat(objects.get(1).getObjectName(), is("user-profile-2"));
        assertThat(objects.get(2).getObjectName(), is("user-profile-3"));
View Full Code Here

       
        PageSpec pageSpec = pageSpecReader.read(getClass().getResource("/specs/spec-variables.spec").getFile());
        List<PageSection> sections = pageSpec.getSections();
        assertThat(sections.size(), is(1));
       
        PageSection pageSection = sections.get(0);
       
        List<ObjectSpecs> objects = pageSection.getObjects();
        assertThat(objects.size(), is(2));
       
       
        ObjectSpecs headerObject = objects.get(0);
        ObjectSpecs containerObject = objects.get(1);
View Full Code Here

    @Test
    public void shouldParse_warningLevels_forSpecs() throws IOException {
        PageSpec pageSpec = pageSpecReader.read(getClass().getResource("/specs/spec-warning-level.spec").getFile());
        List<PageSection> sections = pageSpec.getSections();
        assertThat(sections.size(), is(1));
        PageSection pageSection = sections.get(0);

        List<ObjectSpecs> objects = pageSection.getObjects();
        assertThat(objects.size(), is(3));

        {
            List<Spec> specs = objects.get(0).getSpecs();
            assertThat(specs.size(), is(2));
View Full Code Here

       
        ConditionalBlockStatement currentStatement = new ConditionalBlockStatement();
        currentStatement.setInverted(inverted);
        conditionalBlock.getStatements().add(currentStatement);
       
        PageSection currentSection = new PageSection();
        currentSectionState = new StateDoingSection(getProperties(), currentSection, getContextPath(), getPageSpecReader());
       
        currentStatement.setObjects(currentSection.getObjects());
    }
View Full Code Here

TOP

Related Classes of net.mindengine.galen.specs.page.PageSection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.