Search in sources :

Example 16 with Anchor

use of com.google.gwt.user.client.ui.Anchor in project gwt-test-utils by gwt-test-utils.

the class WidgetAssertTest method isNotVisibleWithCustomAssertionErrorMessage.

@Test
public void isNotVisibleWithCustomAssertionErrorMessage() {
    // Given
    Anchor a = new Anchor();
    // When
    try {
        GwtAssertions.assertThat(a).overridingErrorMessage("custom failure").isNotVisible();
        fail("AssertionError should be thrown");
    } catch (AssertionError e) {
        assertThat(e.getMessage()).isEqualTo("[Anchor] custom failure");
    }
}
Also used : Anchor(com.google.gwt.user.client.ui.Anchor) GwtTestTest(com.googlecode.gwt.test.GwtTestTest) Test(org.junit.Test)

Example 17 with Anchor

use of com.google.gwt.user.client.ui.Anchor in project gwt-test-utils by gwt-test-utils.

the class WidgetAssertTest method textEquals.

@Test
public void textEquals() {
    // Given
    Anchor a = new Anchor();
    a.setText("Ben Linus");
    // When
    try {
        GwtAssertions.assertThat(a).textEquals("Ben Linus");
    } catch (AssertionError e) {
        fail("assertion should pass but failed with message : " + e.getMessage());
    }
}
Also used : Anchor(com.google.gwt.user.client.ui.Anchor) GwtTestTest(com.googlecode.gwt.test.GwtTestTest) Test(org.junit.Test)

Example 18 with Anchor

use of com.google.gwt.user.client.ui.Anchor in project gwt-test-utils by gwt-test-utils.

the class WidgetAssertTest method textEqualsWithCustomAssertionErrorMessage.

@Test
public void textEqualsWithCustomAssertionErrorMessage() {
    // Given
    Anchor a = new Anchor();
    a.setText("Ben Linus");
    // When
    try {
        GwtAssertions.assertThat(a).overridingErrorMessage("custom error message").textEquals("John Locke");
        fail("AssertionError should be thrown");
    } catch (AssertionError e) {
        assertThat(e.getMessage()).isEqualTo("[Anchor's text] custom error message");
    }
}
Also used : Anchor(com.google.gwt.user.client.ui.Anchor) GwtTestTest(com.googlecode.gwt.test.GwtTestTest) Test(org.junit.Test)

Example 19 with Anchor

use of com.google.gwt.user.client.ui.Anchor in project gwt-test-utils by gwt-test-utils.

the class WidgetAssertTest method isVisibleWithAsAndCustomAssertionErrorMessage.

@Test
public void isVisibleWithAsAndCustomAssertionErrorMessage() {
    // Given
    Anchor a = new Anchor();
    a.setVisible(false);
    // When
    try {
        GwtAssertions.assertThat(a).as("my anchor").overridingErrorMessage("custom failure").isVisible();
        fail("AssertionError should be thrown");
    } catch (AssertionError e) {
        assertThat(e.getMessage()).isEqualTo("[my anchor] custom failure");
    }
}
Also used : Anchor(com.google.gwt.user.client.ui.Anchor) GwtTestTest(com.googlecode.gwt.test.GwtTestTest) Test(org.junit.Test)

Example 20 with Anchor

use of com.google.gwt.user.client.ui.Anchor in project gwt-test-utils by gwt-test-utils.

the class WidgetAssertTest method isVisibleWithCustomAssertionErrorMessage.

@Test
public void isVisibleWithCustomAssertionErrorMessage() {
    // Given
    Anchor a = new Anchor();
    a.setVisible(false);
    // When
    try {
        GwtAssertions.assertThat(a).overridingErrorMessage("custom failure").isVisible();
        fail("AssertionError should be thrown");
    } catch (AssertionError e) {
        assertThat(e.getMessage()).isEqualTo("[Anchor] custom failure");
    }
}
Also used : Anchor(com.google.gwt.user.client.ui.Anchor) GwtTestTest(com.googlecode.gwt.test.GwtTestTest) Test(org.junit.Test)

Aggregations

Anchor (com.google.gwt.user.client.ui.Anchor)80 Test (org.junit.Test)59 GwtTestTest (com.googlecode.gwt.test.GwtTestTest)47 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)6 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)6 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)4 Image (com.google.gwt.user.client.ui.Image)4 InlineLabel (com.google.gwt.user.client.ui.InlineLabel)4 ImageResourceRenderer (com.google.gwt.user.client.ui.ImageResourceRenderer)3 RestApi (com.google.gerrit.client.rpc.RestApi)2 FlexCellFormatter (com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter)2 Grid (com.google.gwt.user.client.ui.Grid)2 CellFormatter (com.google.gwt.user.client.ui.HTMLTable.CellFormatter)2 InlineHTML (com.google.gwt.user.client.ui.InlineHTML)2 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)2 AvatarImage (com.google.gerrit.client.AvatarImage)1 DiffObject (com.google.gerrit.client.DiffObject)1 GerritUiExtensionPoint (com.google.gerrit.client.GerritUiExtensionPoint)1 BlameInfo (com.google.gerrit.client.blame.BlameInfo)1 ProjectInfo (com.google.gerrit.client.projects.ProjectInfo)1