//[Test, Description("Verify When User sends an Invalid Length to Distribution Name Then it throws an Error Message")] public void TC_05_ValidateDistributionNamelengthWithLessThan5Characters() { try { String TestName = (TestContext.CurrentContext.Test.Name.ToString()); String description = TestContext.CurrentContext.Test.Properties.Get("Description").ToString(); CreateTest(TestName, description); AddProjectPage addProject = new AddProjectPage(driver); addProject.ClickAddProject(); System.Threading.Thread.Sleep(3000); String expected = addProject.EnterProjectTitle(); System.Threading.Thread.Sleep(5000); addProject.ClickContentType(); System.Threading.Thread.Sleep(15000); addProject.ClickSourceControlTypeGitLab(); System.Threading.Thread.Sleep(5000); addProject.ClickRepository(); System.Threading.Thread.Sleep(5000); addProject.EnterPublishedPath("Publishing path to create project"); System.Threading.Thread.Sleep(5000); addProject.EnterDescription("This is to create Project"); System.Threading.Thread.Sleep(5000); addProject.ClickCreateProject(); System.Threading.Thread.Sleep(25000); addProject.ClickNotifications(); System.Threading.Thread.Sleep(5000); String status = addProject.GetNotificationStatus(); String projectDetails = addProject.GetCreatedProject(); String path = TakeScreenshot(driver); addProject.SuccessScreenshot(path, "Project Created Successfully"); Assert.IsTrue(VerifyText("Success", status, "Project is Created with status:" + status + "", "Project is not created with status: " + status + "")); addProject.BackToProject(); System.Threading.Thread.Sleep(15000); CreateDistributionPage distmodule = new CreateDistributionPage(driver); System.Threading.Thread.Sleep(3000); distmodule.SearchForProject(expected); System.Threading.Thread.Sleep(5000); distmodule.ClickDistribution(); String expected1 = "Please enter at least 5 characters."; distmodule.EnterInvalidnNameLength(); System.Threading.Thread.Sleep(7000); distmodule.EnterDescription("Description"); String actual = distmodule.GetText(distmodule.INVALID_TITLE_LENGTH); String path1 = TakeScreenshot(driver); distmodule.SuccessScreenshot(path1, "Validating Distribution Name Length"); System.Threading.Thread.Sleep(7000); Assert.IsTrue(VerifyEquals(expected1, actual, "Validation of Length Constraints for Distribution Name Field is successful", "Validation of Length Constraints for Distribution Name Field is Not successful")); distmodule.ClickCloseButton(); System.Threading.Thread.Sleep(5000); } catch (AssertionException) { fail("Assertion failed"); throw; } }
//[Test, Description("Verify User is able to Add Distribution to a Project of Empty TOC With Mandatory Fields")] public void TC_04_ValidateAddDistributionsForProjectOfEmptyTOCAndMandatoryFields() { try { String TestName = (TestContext.CurrentContext.Test.Name.ToString()); String description = TestContext.CurrentContext.Test.Properties.Get("Description").ToString(); CreateTest(TestName, description); AddProjectPage addProject = new AddProjectPage(driver); addProject.ClickAddProject(); System.Threading.Thread.Sleep(3000); String expected = addProject.EnterProjectTitle(); System.Threading.Thread.Sleep(5000); addProject.ClickContentType(); System.Threading.Thread.Sleep(15000); addProject.ClickSourceControlTypeGitLab(); System.Threading.Thread.Sleep(5000); addProject.ClickRepository(); System.Threading.Thread.Sleep(5000); addProject.EnterPublishedPath("Publishing path to create project"); System.Threading.Thread.Sleep(5000); addProject.EnterDescription("This is to create Project"); System.Threading.Thread.Sleep(5000); addProject.ClickCreateProject(); System.Threading.Thread.Sleep(25000); addProject.ClickNotifications(); System.Threading.Thread.Sleep(5000); String status = addProject.GetNotificationStatus(); String projectDetails = addProject.GetCreatedProject(); String path = TakeScreenshot(driver); addProject.SuccessScreenshot(path, "Project Created Successfully"); Assert.IsTrue(VerifyText("Success", status, "Project is Created with status:" + status + "", "Project is not created with status: " + status + "")); addProject.BackToProject(); System.Threading.Thread.Sleep(15000); CreateDistributionPage distmodule = new CreateDistributionPage(driver); System.Threading.Thread.Sleep(3000); distmodule.SearchForProject(expected); System.Threading.Thread.Sleep(5000); distmodule.ClickDistribution(); System.Threading.Thread.Sleep(8000); String expected1 = distmodule.EnterDistirbutionName(); System.Threading.Thread.Sleep(57000); distmodule.ClickBranchWithOutTOC(); System.Threading.Thread.Sleep(5000); distmodule.ClickCreateDistribution(); System.Threading.Thread.Sleep(35000); addProject.ClickNotifications(); System.Threading.Thread.Sleep(15000); String status1 = addProject.GetNotificationStatus(); String path1 = TakeScreenshot(driver); addProject.SuccessScreenshot(path1, "Distribution got Created successfully"); Assert.IsTrue(VerifyText("Success", status1, "Distribution is Created with status:" + status1 + "", "Distribution is not created with status: " + status1 + "")); addProject.BackToProject(); System.Threading.Thread.Sleep(5000); distmodule.ClickDistribution(); System.Threading.Thread.Sleep(18000); String actual = distmodule.getDistributionName(); String path2 = TakeScreenshot(driver); distmodule.SuccessScreenshot(path1, "Created Distribution"); Assert.IsTrue(VerifyEquals(expected1, actual, "Create Distribution for Project WithOut TOC is successful", "Create Distribution for Project Without TOC is not successful")); distmodule.ClickCloseButton(); System.Threading.Thread.Sleep(5000); } catch (AssertionException) { fail("Assertion failed"); throw; } }