Assert.assertTrue(page1.canShow());
Assert.assertFalse(page2.canShow());
Assert.assertFalse(page3.canShow());
// click on next
view.getNext().fireEvent(new ClickEvent(null));
// page not validating, button states remain
Assert.assertFalse(page1.isValid());
Assert.assertSame(page1, wizard.getCurrentPage());
Assert.assertFalse(view.getBack().isEnabled());
Assert.assertTrue(view.getNext().isEnabled());
Assert.assertTrue(view.getCancel().isEnabled());
Assert.assertFalse(view.getFinish().isEnabled());
Assert.assertTrue(page1.canShow());
Assert.assertFalse(page2.canShow());
Assert.assertFalse(page3.canShow());
// make page1 validate
page1.setValidate(true);
// click on next
view.getNext().fireEvent(new ClickEvent(null));
Assert.assertSame(page2, wizard.getCurrentPage());
Assert.assertTrue(view.getBack().isEnabled());
Assert.assertTrue(view.getNext().isEnabled());
Assert.assertTrue(view.getCancel().isEnabled());
Assert.assertFalse(view.getFinish().isEnabled());
Assert.assertTrue(page1.canShow());
Assert.assertTrue(page2.canShow());
Assert.assertFalse(page3.canShow());
// make page2 validate
page2.setValidate(true);
view.getNext().fireEvent(new ClickEvent(null));
Assert.assertSame(page3, wizard.getCurrentPage());
Assert.assertTrue(view.getBack().isEnabled());
Assert.assertFalse(view.getNext().isEnabled());
Assert.assertTrue(view.getCancel().isEnabled());
Assert.assertTrue(view.getFinish().isEnabled());