Examples of MockedPage


Examples of br.com.caelum.vraptor.view.MockedPage

  }

  @Test
  public void shouldForwardToViewWhenResultWasNotUsed() {
    when(result.used()).thenReturn(false);
    when(result.use(PageResult.class)).thenReturn(new MockedPage());

    interceptor.intercept(null, null, null);

    verify(result).use(PageResult.class);
  }
View Full Code Here

Examples of br.com.caelum.vraptor.view.MockedPage

  }

  @Test
  public void shouldForwardToViewWhenResultWasNotUsed() {
    when(result.used()).thenReturn(false);
    when(result.use(PageResult.class)).thenReturn(new MockedPage());
    interceptor.forward(new RequestSucceded(request, response));
    verify(result).use(PageResult.class);
  }
View Full Code Here

Examples of net.mindengine.galen.components.validation.MockedPage

    @Test public void shouldTest_conditionalBlocks_simple_whenConditionPasses() throws IOException {
        GalenPageActionCheck check = new GalenPageActionCheck();
        check.setSpecs(Arrays.asList(getClass().getResource("/specs/spec-conditional-simple.spec").getFile()));
       
        MockedBrowser mockedBrowser = new MockedBrowser("http://galenframework.com", new Dimension(640, 480));
        mockedBrowser.setMockedPage(new MockedPage(new HashMap<String, PageElement>(){{
            put("textfield", new MockedPageElement(0, 0, 100, 100));
            put("button-1", new MockedPageElement(0, 0, 200, 100));
            put("button-2", new MockedPageElement(0, 100, 200, 10));
        }}));
       
View Full Code Here

Examples of net.mindengine.galen.components.validation.MockedPage

    @Test public void shouldTest_conditionalBlocks_simple_whenConditionPasses_butStatementInverted() throws IOException {
        GalenPageActionCheck check = new GalenPageActionCheck();
        check.setSpecs(Arrays.asList(getClass().getResource("/specs/spec-conditional-simple-inverted.spec").getFile()));
       
        MockedBrowser mockedBrowser = new MockedBrowser("http://galenframework.com", new Dimension(640, 480));
        mockedBrowser.setMockedPage(new MockedPage(new HashMap<String, PageElement>(){{
            put("textfield", new MockedPageElement(0, 0, 100, 100));
            put("button-1", new MockedPageElement(0, 0, 200, 100));
            put("button-2", new MockedPageElement(0, 100, 200, 10));
        }}));
       
View Full Code Here

Examples of net.mindengine.galen.components.validation.MockedPage

    @Test public void shouldTest_conditionalBlocks_simple_whenConditionFails_inverted() throws IOException {
        GalenPageActionCheck check = new GalenPageActionCheck();
        check.setSpecs(Arrays.asList(getClass().getResource("/specs/spec-conditional-simple-inverted.spec").getFile()));
       
        MockedBrowser mockedBrowser = new MockedBrowser("http://galenframework.com", new Dimension(640, 480));
        mockedBrowser.setMockedPage(new MockedPage(new HashMap<String, PageElement>(){{
            put("textfield", new MockedPageElement(0, 0, 100, 100));
            put("button-1", new MockedInvisiblePageElement(0, 0, 100, 100));
            put("button-2", new MockedInvisiblePageElement(0, 0, 100, 100));
        }}));
View Full Code Here

Examples of net.mindengine.galen.components.validation.MockedPage

    @Test public void shouldTest_conditionalBlocks_simple_whenConditionFails() throws IOException {
        GalenPageActionCheck check = new GalenPageActionCheck();
        check.setSpecs(Arrays.asList(getClass().getResource("/specs/spec-conditional-simple.spec").getFile()));
       
        MockedBrowser mockedBrowser = new MockedBrowser("http://galenframework.com", new Dimension(640, 480));
        mockedBrowser.setMockedPage(new MockedPage(new HashMap<String, PageElement>(){{
            put("textfield", new MockedPageElement(0, 0, 100, 100));
            put("button-1", new MockedInvisiblePageElement(0, 0, 100, 100));
            put("button-2", new MockedInvisiblePageElement(0, 0, 100, 100));
        }}));
View Full Code Here

Examples of net.mindengine.galen.components.validation.MockedPage

    @Test public void shouldTest_conditionalBlocks_simpleOtherwise_whenConditionFails() throws IOException {
        GalenPageActionCheck check = new GalenPageActionCheck();
        check.setSpecs(Arrays.asList(getClass().getResource("/specs/spec-conditional-simple-otherwise.spec").getFile()));
       
        MockedBrowser mockedBrowser = new MockedBrowser("http://galenframework.com", new Dimension(640, 480));
        mockedBrowser.setMockedPage(new MockedPage(new HashMap<String, PageElement>(){{
            put("textfield", new MockedPageElement(0, 0, 100, 100));
            put("button-1", new MockedInvisiblePageElement(0, 0, 100, 100));
            put("button-2", new MockedInvisiblePageElement(0, 0, 100, 100));
        }}));
View Full Code Here

Examples of net.mindengine.galen.components.validation.MockedPage

        };
    }

    @Test
    public void imageSpec_shouldAlsoGenerate_imageComparisonMap() {
        MockedPage page = page(new HashMap<String, PageElement>() {{
            put("object", element(100, 90, 100, 40));
        }}, imageComparisonTestScreenshot);

        PageSpec pageSpec = createMockedPageSpec(page);
        PageValidation validation = new PageValidation(null, page, pageSpec, null, null);
View Full Code Here

Examples of net.mindengine.galen.components.validation.MockedPage

    private Location location(Range exact, Side...sides) {
        return new Location(exact, asList(sides));
    }

    private MockedPage page(HashMap<String, PageElement> elements) {
        return new MockedPage(elements);
    }
View Full Code Here

Examples of net.mindengine.galen.components.validation.MockedPage

    private MockedPage page(HashMap<String, PageElement> elements) {
        return new MockedPage(elements);
    }
   
    private MockedPage page(HashMap<String, PageElement> elements, BufferedImage screenshotImage) {
        return new MockedPage(elements, screenshotImage);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.