Ejemplo n.º 1
0
        public void BlazorChartTest_CodedStep()
        {
            // Refreshing the DOM tree
            this.ActiveBrowser.RefreshDomTree();

            // Loading the chart
            HtmlDiv chart = this.Find.ByExpression <HtmlDiv>("tagName=div", "class=~k-chart");

            // Loading chart's point groups
            HtmlControl pointsGroup = chart.Find.ByExpression <HtmlControl>("tagName=g", "clip-path=~salesandrevenue#kdef1");

            // Finding the points by circle
            var points = pointsGroup.Find.AllByTagName("circle");

            foreach (Element point in points)
            {
                // Hovering over the circles
                HtmlControl pCtrl = point.As <HtmlControl>();
                pCtrl.MouseHover(1, 1);

                System.Threading.Thread.Sleep(1000);

                // Capturing the image and using OCR to convert image into text data
                this.ExtractPointData();

                this.ActiveBrowser.RefreshDomTree();

                System.Threading.Thread.Sleep(1000);
            }

            // Logging captured data
            var dataPoint = this.DataPoints.Where(dp => dp.Category == "Jun").FirstOrDefault();

            Log.WriteLine("Category : " + dataPoint.Category);
            Log.WriteLine("HL : " + dataPoint.AA);
            Log.WriteLine("ML : " + dataPoint.DM);
            Log.WriteLine("SF : " + dataPoint.SF);
            Log.WriteLine("Total : " + dataPoint.TotalRevenue);

            // Validating if the captured data is matching with the data from the service
            Assert.IsTrue(new ValidationService().ValidateProductPoints(this.DataPoints));
        }
Ejemplo n.º 2
0
 public void Hover()
 {
     _inputControl.MouseHover();
 }