use of org.mycore.iview.tests.controller.SideBarController in project mycore by MyCoRe-Org.
the class SideBarIT method testSideBarResize.
@Test
public /**
* Ignored because https://github.com/mozilla/geckodriver/issues/233
*/
void testSideBarResize() throws Exception {
this.setTestName(getClassname() + "-testSideBarResize");
this.getDriver();
this.getAppController().openViewer(this.getDriver(), getTestDerivate());
ImageViewerController controller = this.getViewerController();
ToolBarController tbController = controller.getToolBarController();
SideBarController sbController = controller.getSideBarController();
tbController.pressButton(ToolBarController.BUTTON_ID_SIDEBAR_CONTROLL);
tbController.clickElementById(ImageOverviewController.IMAGE_OVERVIEW_SELECTOR);
int sbWidthStart = sbController.getSideBarWidth();
try {
// Firefox does not support actions so we just let the test pass.
sbController.dragAndDropByXpath("//div[contains(@class,\"sidebar\")]/span[@class=\"resizer\"]", 50, 0);
} catch (UnsupportedCommandException e) {
LOGGER.warn("Driver does not support Actions", e);
return;
}
int sbWidthEnd = sbController.getSideBarWidth();
assertLess(sbWidthEnd, sbWidthStart, "Sidebar width schould be increased!");
}
use of org.mycore.iview.tests.controller.SideBarController in project mycore by MyCoRe-Org.
the class SideBarIT method testSideBarPresent.
@Test
public void testSideBarPresent() throws Exception {
this.setTestName(getClassname() + "-testSideBarPresent");
this.getDriver();
this.getAppController().openViewer(this.getDriver(), getTestDerivate());
ImageViewerController controller = this.getViewerController();
ToolBarController tbController = controller.getToolBarController();
SideBarController sbController = controller.getSideBarController();
tbController.pressButton(ToolBarController.BUTTON_ID_SIDEBAR_CONTROLL);
tbController.clickElementById(ImageOverviewController.IMAGE_OVERVIEW_SELECTOR);
Assert.assertTrue("SideBar should be present!", sbController.assertSideBarPresent());
tbController.clickElementByXpath(SideBarController.SIDEBAR_CLOSE_SELECTOR);
Assert.assertFalse("SideBar should not be present!", sbController.assertSideBarPresent());
}
use of org.mycore.iview.tests.controller.SideBarController in project mycore by MyCoRe-Org.
the class SideBarIT method testOverviewLayout.
@Test
public void testOverviewLayout() throws InterruptedException {
this.setTestName(getClassname() + "-testOvervieLayout");
this.getDriver();
this.getAppController().openViewer(this.getDriver(), getTestDerivate());
ImageViewerController controller = this.getViewerController();
ToolBarController tbController = controller.getToolBarController();
SideBarController sbController = controller.getSideBarController();
tbController.pressButton(ToolBarController.BUTTON_ID_SIDEBAR_CONTROLL);
tbController.clickElementById(ImageOverviewController.IMAGE_OVERVIEW_SELECTOR);
int before = sbController.countThumbnails();
try {
sbController.dragAndDropByXpath("//div[contains(@class,'sidebar')]/span[@class='resizer']", 300, 0);
} catch (UnsupportedCommandException e) {
LOGGER.warn("Driver does not support Actions", e);
return;
}
Thread.sleep(1000);
int after = sbController.countThumbnails();
Assert.assertEquals(2 * before, after);
}
Aggregations