Package net.mindengine.galen.specs.reader.page

Examples of net.mindengine.galen.specs.reader.page.PageSpec


     
    }
   
    @Test
    public void shouldProcess_simpleMathOperations_inParameterizedSpecs() throws IOException {
      PageSpec pageSpec = pageSpecReader.read(getClass().getResource("/spec-math.spec").getFile());
     
        List<Spec> specs = pageSpec.getSections().get(0).getObjects().get(0).getSpecs();
     
      assertThat(specs.size(), is(2));
      assertThat(specs.get(0).getOriginalText(), is("inside: box-2 10px left"));
      assertThat(specs.get(1).getOriginalText(), is("inside: box-4 10px left"));
     
View Full Code Here


     
    }
   
    @Test
    public void shouldParse_conditionalSpecBlocks() throws Exception {
        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));
View Full Code Here

        assertThat(sectionObjects.get(0).getObjectName(), is("textfield"));
    }
   
    @Test
    public void shouldParse_conditionalSpecBlocks_withOrStatement() throws Exception {
        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));
View Full Code Here

       
    }
   
    @Test
    public void shouldParse_conditionalSpecBlocks_inverted() throws Exception {
        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));
View Full Code Here

       
    }
   
    @Test
    public void shouldParse_conditionalSpecBlocks_withOtherwise() throws Exception {
        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));
View Full Code Here

    }
   
   
    @Test
    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();
View Full Code Here

   
   
    @Test
    public void shouldParse_variablesDefinitions() throws Exception {
       
        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();
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));
View Full Code Here

    }

    @Test
    public void shouldAllowTo_importJavascriptFiles() throws IOException {
        PageSpecReader specReader = new PageSpecReader(new Properties(), null);
        PageSpec pageSpec = specReader.read(getClass().getResource("/specs/spec-with-javascript-import.spec").getFile());
        assertThat(pageSpec.getSections().get(0).getObjects().get(0).getSpecs().get(0).getOriginalText(), is("text is: some value from-javascript function"));
    }
View Full Code Here

    @Test
    public void shouldAllowTo_usePageObjectValues_inJsExpressions() throws IOException {
        WebDriver driver = new MockedDriver();
        driver.get("/mocks/pages/object-values-in-js.json");
        PageSpecReader specReader = new PageSpecReader(new Properties(), new SeleniumBrowser(driver));
        PageSpec pageSpec = specReader.read(getClass().getResource("/specs/spec-with-object-values-in-js.spec").getFile());
        assertThat(pageSpec.getSections().get(0).getObjects().get(0).getSpecs().get(0).getOriginalText(), is("near: menu-item-4 20px left"));
        assertThat(pageSpec.getSections().get(0).getObjects().get(0).getSpecs().get(1).getOriginalText(), is("above: menu-item-4 30px"));
    }
View Full Code Here

TOP

Related Classes of net.mindengine.galen.specs.reader.page.PageSpec

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.