コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: Lolmarty/EpamExamThree
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: Lolmarty/EpamExamThree
        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;
        }