Пример #1
0
        //  [Test, Description("Verify User is Unable to get the codeBlock when searched with the AssetId of CodeBlock in Images Tab")]
        public void TC_03_ValidateWhenUserSearchesCodeBlockAssetIdInImages()
        {
            try
            {
                String TestName    = (TestContext.CurrentContext.Test.Name.ToString());
                String description = TestContext.CurrentContext.Test.Properties.Get("Description").ToString();
                CreateTest(TestName, description);

                /*CreateDistributionPage distmodule = new CreateDistributionPage(driver);
                 * System.Threading.Thread.Sleep(5000);
                 * distmodule.SearchForProject("Testing_Proj");
                 * CreateDraftPage createDraft = new CreateDraftPage(driver);
                 * System.Threading.Thread.Sleep(8000);
                 * createDraft.CLICKOPENPROJECT();
                 * System.Threading.Thread.Sleep(8000);
                 * //driver.Navigate().Refresh();
                 * createDraft.ClikOnBackdrop();
                 * System.Threading.Thread.Sleep(5000);
                 * AuthoringScreenEnhancements auth = new AuthoringScreenEnhancements(driver);
                 * auth.ClickInsertCodeBlock();
                 * String path1 = TakeScreenshot(driver);
                 * auth.SuccessScreenshot(path1, "Verifying Uploaded CodeBlock");*/
                System.Threading.Thread.Sleep(5000);
                AuthoringScreenEnhancements auth = new AuthoringScreenEnhancements(driver);
                auth.ClickInsertCodeBlock();
                System.Threading.Thread.Sleep(25000);
                Console.WriteLine("*******HERE iS RESULT" + result);
                String str = result.Split(new[] { ' ' }).Skip(2).FirstOrDefault();
                Console.WriteLine("*******HERE iS RESULT" + str);
                auth.EnterAssetName(str);
                System.Threading.Thread.Sleep(25000);
                String path3 = TakeScreenshot(driver);
                auth.SuccessScreenshot(path3, "Verifying the uploaded CodeBlock AssetID");
                auth.SelectCodeBlockFromUpload(result);
                auth.ClickInsertImage();
                System.Threading.Thread.Sleep(5000);
                auth.SearchAssetID();
                Console.WriteLine("Entered AssetID of CoeBlock in Images");
                System.Threading.Thread.Sleep(5000);
                String path4 = TakeScreenshot(driver);
                auth.SuccessScreenshot(path4, "Verifying the CodeBlock  Url pasted in Images does not show any Uploads");
                auth.CloseUploadPage();
                System.Threading.Thread.Sleep(5000);
                //auth.ClickDashboard();
            }
            catch (AssertionException)
            {
                fail("Assertion failed");
                throw;
            }
        }