// [Test, Description("Verify User is able to Upload CodeBlocks in Media Screen")] public void TC_01_ValidationOfUploadCodeBlock() { try { String TestName = (TestContext.CurrentContext.Test.Name.ToString()); String description = TestContext.CurrentContext.Test.Properties.Get("Description").ToString(); CreateTest(TestName, description); Console.WriteLine("Entered into testcase"); AuthoringScreenEnhancements auth = new AuthoringScreenEnhancements(driver); System.Threading.Thread.Sleep(5000); auth.ClickMedia(); auth.ClickCodeBlocksTab(); System.Threading.Thread.Sleep(5000); auth.UploadCodeBlock(); System.Threading.Thread.Sleep(2000); String path1 = TakeScreenshot(driver); auth.SuccessScreenshot(path1, "Uploaded New CodeBlock"); AddProjectPage addProject = new AddProjectPage(driver); addProject.ClickNotifications(); System.Threading.Thread.Sleep(5000); String str = addProject.GetNotificationName(); result = str.Split(new[] { ':' }).Skip(1).FirstOrDefault(); Console.WriteLine("&&&&&" + result); String path2 = TakeScreenshot(driver); auth.SuccessScreenshot(path2, "Uploaded New CodeBlock" + result + " with Notification"); addProject.BackToProject(); System.Threading.Thread.Sleep(2000); auth.ClickDashboard(); } catch (AssertionException) { fail("Assertion failed"); throw; } }
// [Test, Description("Verify User is unable to upload Invalid Code Blocks")] public void TC_05_ValidateUploadOfInvalidCodeBlock() { try { String TestName = (TestContext.CurrentContext.Test.Name.ToString()); String description = TestContext.CurrentContext.Test.Properties.Get("Description").ToString(); CreateTest(TestName, description); AuthoringScreenEnhancements auth = new AuthoringScreenEnhancements(driver); System.Threading.Thread.Sleep(8000); auth.ClickMedia(); System.Threading.Thread.Sleep(8000); auth.ClickCodeBlocksTab(); System.Threading.Thread.Sleep(8000); auth.UploadInvalidCodeBlock(); System.Threading.Thread.Sleep(8000); String path1 = TakeScreenshot(driver); auth.SuccessScreenshot(path1, "Unable to Upload CodeBlock"); System.Threading.Thread.Sleep(5000); auth.ClickDashboard(); } catch (AssertionException) { fail("Assertion failed"); throw; } }