Package com.lazerycode.selenium.graphs

Examples of com.lazerycode.selenium.graphs.ColumnChart


  @Test
  public void validateColumnChart() {
    driver.get(webServerURL + ":" + webServerPort + "/highcharts.html");

    WebElement highChartSVGElement = driver.findElement(By.id("columnchart"));
    ColumnChart chartObject = new ColumnChart(driver, highChartSVGElement);

    assertThat(chartObject.isChartDisplayed(), is(equalTo(true)));
    assertThat(chartObject.isLegendDisplayed(), is(equalTo(true)));

    chartObject.hoverOverPrimarySeriesAtXAxisLabel("Bananas");
    assertThat(chartObject.getPrimarySeriesColourForXAxisLabel("Bananas"), is(equalTo(Color.fromString("#4572A7"))));

    assertThat(chartObject.isTooltipDisplayed(), is(equalTo(true)));
    assertThat(chartObject.getToolTipLine(1), is(equalTo("Bananas")));
    assertThat(chartObject.getToolTipLine(2), is(equalTo("Jane")));
    assertThat(chartObject.getToolTipLine(3), is(equalTo(":")));
    assertThat(chartObject.getToolTipLine(4), is(equalTo("0")));

    chartObject.hoverOverSecondarySeriesAtXAxisLabel("Bananas");
    assertThat(chartObject.getSecondarySeriesColourForXAxisLabel("Bananas"), is(equalTo(Color.fromString("#AA4643"))));

    assertThat(chartObject.isTooltipDisplayed(), is(equalTo(true)));
    assertThat(chartObject.getToolTipLine(1), is(equalTo("Bananas")));
    assertThat(chartObject.getToolTipLine(2), is(equalTo("John")));
    assertThat(chartObject.getToolTipLine(3), is(equalTo(":")));
    assertThat(chartObject.getToolTipLine(4), is(equalTo("7")));

    String[] EXPECTED_X_AXIS_LABELS = {"Apples", "Bananas", "Oranges"};
    String[] EXPECTED_Y_AXIS_LABELS = {"0", "2.5", "5", "7.5", "Fruit eaten"};

    assertThat(chartObject.getXAxisLabelsAsArray(), is(equalTo(EXPECTED_X_AXIS_LABELS)));
    assertThat(chartObject.getYAxisLabelsAsArray(), is(equalTo(EXPECTED_Y_AXIS_LABELS)));

  }
View Full Code Here

TOP

Related Classes of com.lazerycode.selenium.graphs.ColumnChart

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.