Package net.mindengine.galen.specs.reader

Examples of net.mindengine.galen.specs.reader.Place


    }
   
    @Test(dependsOnMethods = BASE_TEST)
    public void shouldStore_lineNumber_inSpecs() {
        List<PageSection> sections = pageSpec.getSections();
        Place place = sections.get(0).getObjects().get(0).getSpecs().get(0).getPlace();
        assertThat(place.getFilePath(), endsWith("/specs.txt"));
        assertThat(place.getLineNumber(), is(18));
       
        place = sections.get(1).getObjects().get(0).getSpecs().get(0).getPlace();
        assertThat(place.getFilePath(), endsWith("/specs.txt"));
        assertThat(place.getLineNumber(), is(24));
    }
View Full Code Here


        String line = bufferedReader.readLine();

        int lineNumber = 1;
        try {
            while(line != null) {
                lineProcessor.processLine(line, varsContext, new Place(fileLocation, lineNumber));
                line = bufferedReader.readLine();
                lineNumber++;
            }
        }
        catch (Exception exception) {
View Full Code Here

           
            validationListener.onObject(pageRunner, pageValidation, "objectA1"); {
                validationListener.onSpecError(pageRunner, pageValidation,
                        "objectA1",
                        new SpecInside("other-object", asList(new Location(exact(10), asList(LEFT)))).withOriginalText("inside: other-object 10px left")
                            .withPlace(new Place("specs.spec", 12)),
                        new ValidationError(asList(new ErrorArea(new Rect(10, 10, 100, 50), "objectA1")), asList("objectA1 is not inside other-object")));
               
                validationListener.onSpecSuccess(pageRunner, pageValidation, "objectA1", new SpecWidth(between(10, 20)).withOriginalText("width: 10 to 20px").withPlace(new Place("specs.spec", 12)));
            }
            validationListener.onAfterObject(pageRunner, pageValidation, "objectA1");
           
            validationListener.onObject(pageRunner, pageValidation, "objectA2"); {
                validationListener.onSpecSuccess(pageRunner, pageValidation, "objectA2", new SpecWidth(between(10, 20)).withOriginalText("width: 10 to 20px").withPlace(new Place("specs.spec", 12)));
                validationListener.onSpecError(pageRunner, pageValidation,
                        "objectA2",
                        new SpecWidth(exact(10)).withOriginalText("width: 10px")
                            .withPlace(new Place("specs.spec", 12)),
                        new ValidationError(asList(new ErrorArea(new Rect(200, 300, 50, 30), "objectA2")), asList("objectA2 width is 20px instead of 10px")));

                validationListener.onSpecError(pageRunner, pageValidation,
                        "objectA2",
                        new SpecText(SpecText.Type.IS, "Login").withOriginalText("text is: Login")
                                .withPlace(new Place("specs.spec", 12))
                                .withOnlyWarn(true),
                        new ValidationError(asList(new ErrorArea(new Rect(200, 300, 50, 30), "objectA2")), asList("objectA2 text is \"Logout\" instead of \"Login\"")));
            }
            validationListener.onAfterObject(pageRunner, pageValidation, "objectA2");
           
            validationListener.onAfterSection(pageRunner, pageValidation, section1);
           
            PageSection section2 = sectionWithName("some section 2");
            validationListener.onBeforeSection(pageRunner, pageValidation, section2);
           
            validationListener.onObject(pageRunner, pageValidation, "objectA1"); {
                validationListener.onSpecSuccess(pageRunner, pageValidation, "objectA1", new SpecHeight(between(10, 20)).withOriginalText("height: 10 to 20px").withPlace(new Place("specs.spec", 12)));
               
                //Doing sub-objects call
                {
                    validationListener.onObject(pageRunner, pageValidation, "sub-objectA1"); {
                        validationListener.onSpecSuccess(pageRunner, pageValidation, "sub-objectA1", new SpecHeight(between(10, 20)).withOriginalText("height: 10 to 20px").withPlace(new Place("specs.spec", 12)));
                        validationListener.onSpecError(pageRunner, pageValidation,
                                "sub-objectA1",
                                new SpecWidth(exact(10)).withOriginalText("width: 10px")
                                    .withPlace(new Place("specs.spec", 12)),
                                new ValidationError(asList(new ErrorArea(new Rect(200, 300, 50, 30), "sub-objectA1")), asList("sub-objectA1 width is 20px instead of 10px")));
                    }
                    validationListener.onAfterObject(pageRunner, pageValidation, "sub-objectA1");
                }
                validationListener.onSpecSuccess(pageRunner, pageValidation, "objectA1", new SpecHeight(between(10, 20)).withOriginalText("component: some-component.spec").withPlace(new Place("specs.spec", 12)));
            }
            validationListener.onAfterObject(pageRunner, pageValidation, "objectA1");
           
            validationListener.onAfterSection(pageRunner, pageValidation, section2);
       
        }
        validationListener.onAfterPageAction(pageRunner, action);
       
       
       
        validationListener.onBeforePageAction(pageRunner, action);
        {
            PageSection section1 = sectionWithName("some section 1");
            validationListener.onBeforeSection(pageRunner, pageValidation, section1);
           
            validationListener.onObject(pageRunner, pageValidation, "objectB1"); {
                validationListener.onSpecSuccess(pageRunner, pageValidation, "objectB1", new SpecWidth(between(10, 20)).withOriginalText("width: 10 to 20px").withPlace(new Place("specs.spec", 12)));
               
                validationListener.onSpecError(pageRunner, pageValidation,
                        "objectB1",
                        new SpecInside("other-object", asList(new Location(exact(10), asList(LEFT)))).withOriginalText("inside: other-object 10px left")
                            .withPlace(new Place("specs.spec", 12)),
                        new ValidationError(asList(new ErrorArea(new Rect(10, 10, 100, 50), "objectB1")), asList("objectB1 is not inside other-object", "second error message with <xml> &tags"))
                            .withImageComparisonSample(new Rect(20, 30, 100, 40), "imgs/button-sample-correct.png", Rainbow4J.loadImage(comparisonMapImagePath)));
            }
            validationListener.onAfterObject(pageRunner, pageValidation, "objectB1");
           
            validationListener.onObject(pageRunner, pageValidation, "objectB2"); {
                validationListener.onSpecSuccess(pageRunner, pageValidation, "objectB2", new SpecHeight(exact(100)).withOriginalText("height: 100px").withPlace(new Place("specs.spec", 12)));
            }
            validationListener.onAfterObject(pageRunner, pageValidation, "objectB2");
           
            validationListener.onGlobalError(pageRunner, new FakeException("Some exception here"));
           
View Full Code Here

TOP

Related Classes of net.mindengine.galen.specs.reader.Place

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.