コード例 #1
0
        public void VerifySortByOptions()
        {
            try
            {
                test = extent.CreateTest("VerifySortByOptions").Info("Test Started");
                IMTRLandingPage    imtr       = new IMTRLandingPage(BaseTest.driver);
                NavigationMenuPage navigation = new NavigationMenuPage(BaseTest.driver);
                navigation.ClickMainMenu();
                navigation.ClickTrackRecordOption();

                //Verify Sort By for ongoing deals
                imtr.ClickOngoingDeals();
                //Verify descending works as expected
                imtr.ClickOptionsInSortBy();
                Boolean desc = imtr.SelectDescending();
                Assert.True(desc == true, "Descending does not work");
                Thread.Sleep(3000);
                //Verify Ascending works as expected
                Boolean Asc = imtr.SelectDescending();
                Assert.True(Asc == true, "Ascending does not work");

                //Verify Sort by for Sold Deals
                driver.Navigate().Refresh();
                Thread.Sleep(3000);
                imtr.ClickSoldDeals();
                imtr.ChangeToView();
                imtr.ClickOptionsInSortBy();
                Boolean desc1 = imtr.SelectDescending();
                Assert.True(desc1 == true, "Descending does not work");
                Boolean Asc1 = imtr.SelectDescending();
                Assert.True(Asc1 == true, "Ascending does not work");
                test.Log(Status.Pass, "Test Case Passed");
            }
            catch (Exception e)
            {
                test.Log(Status.Fail, "Test Case Failed");
                baseTest.TakeScreenshot();
                Console.WriteLine(e.StackTrace);
            }
        }