예제 #1
0
        public void CheckAllFinal()
        {
            var map     = new Dictionary <string, string>();
            var rowSize = Driver.Instance.FindElements(By.XPath("/html/body/div/div[1]/table/tbody/tr/td[1]")).Count();

            for (int i = 1; i <= rowSize; i++)
            {
                var cellText = Driver.Instance.FindElement(By.XPath("/html/body/div/div[1]/table/tbody/tr[" + i + "]/td[1]")).Text;
                try
                {
                    ReviewPage.MakeReview(cellText).Review(this.review).SaveFinal();
                }
                catch
                {
                    try
                    {
                        var isAt = ReviewPage.IsAt;
                    }
                    catch
                    {
                        Driver.Instance.Navigate().Back();
                    }
                    map.Add(cellText + " Make", "Unable to make final review");
                }
                try
                {
                    ReviewPage.MakeReview(cellText).Review(this.review).CheckFinal();
                }
                catch
                {
                    try
                    {
                        var isAt = ReviewPage.IsAt;
                    }
                    catch
                    {
                        Driver.Instance.Navigate().Back();
                    }
                    map.Add(cellText + " Check", "Unable to check final review");
                }
            }
            if (map.Count > 0)
            {
                string Exception = "There is a problem with the following themes: ";
                foreach (var pair in map)
                {
                    string key   = pair.Key;
                    string value = pair.Value;
                    Exception = Exception + "Theme " + key + ": " + value + "; ";
                }
                throw new System.Exception(Exception);
            }
        }