Search in sources :

Example 1 with PageElement

use of com.github.noraui.application.page.Page.PageElement in project NoraUi by NoraUi.

the class StepUT method testFormatMessageNullMessage.

@Test
public void testFormatMessageNullMessage() {
    try {
        final DemoPage demoPage = (DemoPage) Page.getInstance(DEMO_PAGE_NAME);
        final PageElement pageElement = demoPage.getPageElementByKey("-input");
        Messages.format(null, pageElement, demoPage.getApplication());
    } catch (final TechnicalException e) {
        Assert.assertEquals("TechnicalException found", Messages.getMessage("FAIL_MESSAGE_FORMAT_STRING"), e.getMessage());
    }
}
Also used : TechnicalException(com.github.noraui.exception.TechnicalException) DemoPage(com.github.noraui.application.page.demo.DemoPage) PageElement(com.github.noraui.application.page.Page.PageElement) Test(org.junit.Test)

Example 2 with PageElement

use of com.github.noraui.application.page.Page.PageElement in project NoraUi by NoraUi.

the class StepUT method testFormatMessageNotValidMessage.

@Test
public void testFormatMessageNotValidMessage() {
    try {
        final DemoPage demoPage = (DemoPage) Page.getInstance(DEMO_PAGE_NAME);
        final PageElement pageElement = demoPage.getPageElementByKey("-input");
        Messages.format("Message %s in %s.%s", pageElement, demoPage.getApplication());
    } catch (final TechnicalException e) {
        Assert.assertEquals("TechnicalException found", Messages.getMessage("FAIL_MESSAGE_FORMAT_STRING"), e.getMessage());
    }
}
Also used : TechnicalException(com.github.noraui.exception.TechnicalException) DemoPage(com.github.noraui.application.page.demo.DemoPage) PageElement(com.github.noraui.application.page.Page.PageElement) Test(org.junit.Test)

Example 3 with PageElement

use of com.github.noraui.application.page.Page.PageElement in project NoraUi by NoraUi.

the class StepUT method testFormatMessage.

@Test
public void testFormatMessage() {
    try {
        final DemoPage demoPage = (DemoPage) Page.getInstance(DEMO_PAGE_NAME);
        final PageElement pageElement = demoPage.getPageElementByKey("-input_select_field");
        final String a = Messages.format("Message %s in %s.", pageElement, demoPage.getApplication());
        Assert.assertEquals("", "Message Input Select field in demo.", a);
    } catch (final TechnicalException e) {
        Assert.assertFalse("Error", true);
    }
}
Also used : TechnicalException(com.github.noraui.exception.TechnicalException) DemoPage(com.github.noraui.application.page.demo.DemoPage) PageElement(com.github.noraui.application.page.Page.PageElement) Test(org.junit.Test)

Example 4 with PageElement

use of com.github.noraui.application.page.Page.PageElement in project NoraUi by NoraUi.

the class StepUT method testFormatMessageNotValid2Message.

@Test
public void testFormatMessageNotValid2Message() {
    try {
        final DemoPage demoPage = (DemoPage) Page.getInstance(DEMO_PAGE_NAME);
        final PageElement pageElement = demoPage.getPageElementByKey("-input");
        Messages.format("Message %s.", pageElement, demoPage.getApplication());
    } catch (final TechnicalException e) {
        Assert.assertEquals("TechnicalException found", Messages.getMessage("FAIL_MESSAGE_FORMAT_STRING"), e.getMessage());
    }
}
Also used : TechnicalException(com.github.noraui.exception.TechnicalException) DemoPage(com.github.noraui.application.page.demo.DemoPage) PageElement(com.github.noraui.application.page.Page.PageElement) Test(org.junit.Test)

Example 5 with PageElement

use of com.github.noraui.application.page.Page.PageElement in project NoraUi by NoraUi.

the class StepUT method testFormatMessage2.

@Test
public void testFormatMessage2() {
    try {
        final DemoPage demoPage = (DemoPage) Page.getInstance(DEMO_PAGE_NAME);
        final PageElement pageElement = demoPage.getPageElementByKey("-submit");
        final String a = Messages.format("Message %s in %s.", pageElement, demoPage.getApplication());
        Assert.assertEquals("", "Message Submit button in demo.", a);
    } catch (final TechnicalException e) {
        Assert.assertFalse("Error", true);
    }
}
Also used : TechnicalException(com.github.noraui.exception.TechnicalException) DemoPage(com.github.noraui.application.page.demo.DemoPage) PageElement(com.github.noraui.application.page.Page.PageElement) Test(org.junit.Test)

Aggregations

PageElement (com.github.noraui.application.page.Page.PageElement)6 DemoPage (com.github.noraui.application.page.demo.DemoPage)6 TechnicalException (com.github.noraui.exception.TechnicalException)6 Test (org.junit.Test)6