Search in sources :

Example 1 with StructureOverviewController

use of org.mycore.iview.tests.controller.StructureOverviewController in project mycore by MyCoRe-Org.

the class StructureOverviewIT method testStructureOverview.

@Test
public /**
 * Checks if the structure Overview loaded from mets.xml works!
 * @throws IOException
 * @throws InterruptedException
 */
void testStructureOverview() throws IOException, InterruptedException {
    this.setTestName(getClassname() + "-testStructureOverview");
    this.getDriver();
    this.getAppController().openViewer(this.getDriver(), getTestDerivate());
    ImageViewerController controller = this.getViewerController();
    ToolBarController tbController = controller.getToolBarController();
    StructureOverviewController soController = controller.getStructureOverviewController();
    tbController.pressButton(ToolBarController.BUTTON_ID_SIDEBAR_CONTROLL);
    Thread.sleep(1000);
    tbController.clickElementById(StructureOverviewController.CHAPTER_OVERVIEW_SELECTOR);
    int greenPixelCount = selectImgAndCountColor(soController, getGreenLabel(), Color.GREEN);
    int redPixelCount = selectImgAndCountColor(soController, getRedLabel(), Color.RED);
    int bluePixelCount = selectImgAndCountColor(soController, getBlueLabel(), Color.BLUE);
    int redPixelCountRGB = selectImgAndCountColor(soController, getRgbLabel(), Color.RED);
    int greenPixelCountRGB = selectImgAndCountColor(soController, getRgbLabel(), Color.GREEN);
    int bluePixelCountRGB = selectImgAndCountColor(soController, getRgbLabel(), Color.BLUE);
    String messagePattern = "There should be less red pixels in the rgb screenshot than in the red ({0} > {1})";
    assertLess(redPixelCount, redPixelCountRGB, messagePattern);
    messagePattern = "There should be less green pixels in the rgb screenshot than in the red ({0} > {1})";
    assertLess(greenPixelCount, greenPixelCountRGB, messagePattern);
    messagePattern = "There should be less blue pixels in the rgb screenshot than in the red ({0} > {1})";
    assertLess(bluePixelCount, bluePixelCountRGB, messagePattern);
    Assert.assertFalse("There should´nt be any 'undefined' page labels.", soController.hasUndefinedPageLabels());
}
Also used : ImageViewerController(org.mycore.iview.tests.controller.ImageViewerController) ToolBarController(org.mycore.iview.tests.controller.ToolBarController) StructureOverviewController(org.mycore.iview.tests.controller.StructureOverviewController) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 ImageViewerController (org.mycore.iview.tests.controller.ImageViewerController)1 StructureOverviewController (org.mycore.iview.tests.controller.StructureOverviewController)1 ToolBarController (org.mycore.iview.tests.controller.ToolBarController)1