private static List <string> GenerateTooltipMessages(IWebDriver driver, List <Point> graph, HighchartsPage page) { Actions action = new Actions(driver); action.MoveToElement(page.RootElement, 0, 0) .MoveByOffset(graph[0].X, graph[0].Y) .Build() .Perform(); List <string> tooltip = new List <string>(); for (int point = 1; point < graph.Count; point++) { for (int i = 0; i <= graph[point].X - graph[point - 1].X; i += Step) { action.MoveByOffset(Step, 0).Build().Perform(); if (tooltip.LastOrDefault() != page.TooltipElement.Text && page.TooltipElement.Text.Contains(HighchartsPage.EmployeeKeyword)) { tooltip.Add(page.TooltipElement.Text); } } action.MoveByOffset(0, graph[point].Y - graph[point - 1].Y) .Build() .Perform(); } return(tooltip); }
public void TestChartsTooltip() { HighchartsPage page = new HighchartsPage(driver); page.HideNonEmployeeCharts(); IWebElement seriesElement = page.LocateVisibleSeries(); List<Point> graph = GeneratePointsFromSeries(seriesElement); List<string> tooltip = GenerateTooltipMessages(driver, graph, page); ProcessTooltipMessages(tooltip); }
public void TestChartsTooltip() { HighchartsPage page = new HighchartsPage(driver); page.HideNonEmployeeCharts(); IWebElement seriesElement = page.LocateVisibleSeries(); List <Point> graph = GeneratePointsFromSeries(seriesElement); List <string> tooltip = GenerateTooltipMessages(driver, graph, page); ProcessTooltipMessages(tooltip); }
private static List<string> GenerateTooltipMessages(IWebDriver driver, List<Point> graph, HighchartsPage page) { Actions action = new Actions(driver); action.MoveToElement(page.RootElement, 0, 0) .MoveByOffset(graph[0].X, graph[0].Y) .Build() .Perform(); List<string> tooltip = new List<string>(); for (int point = 1; point < graph.Count; point++) { for (int i = 0; i <= graph[point].X - graph[point - 1].X; i+=Step) { action.MoveByOffset(Step, 0).Build().Perform(); if (tooltip.LastOrDefault() != page.TooltipElement.Text && page.TooltipElement.Text.Contains(HighchartsPage.EmployeeKeyword)) { tooltip.Add(page.TooltipElement.Text); } } action.MoveByOffset(0, graph[point].Y - graph[point - 1].Y) .Build() .Perform(); } return tooltip; }