Package com.lazerycode.selenium.graphs

Examples of com.lazerycode.selenium.graphs.LineChart


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

    WebElement highChartSVGElement = driver.findElement(By.id("linechart"));
    LineChart chartObject = new LineChart(driver, highChartSVGElement);

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

    chartObject.hoverOverPointOfGraphAtXAxisLabel("Bananas");

    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")));
    assertThat(chartObject.getToolTipLine(5), is(equalTo("John")));
    assertThat(chartObject.getToolTipLine(6), is(equalTo(":")));
    assertThat(chartObject.getToolTipLine(7), is(equalTo("7")));

    String[] EXPECTED_X_AXIS_LABELS = {"Apples", "Bananas", "Oranges"};
    String[] EXPECTED_Y_AXIS_LABELS = {"0", "-2.5", "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.LineChart

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.