Exemple #1
0
 //[Test, Description("Verify User is able to add Distribution for the GitHub Project with all Fields")]
 public void TC_02_ValidateCreateDistributionForGitHubProjectWithAllFields()
 {
     try
     {
         String TestName    = (TestContext.CurrentContext.Test.Name.ToString());
         String description = TestContext.CurrentContext.Test.Properties.Get("Description").ToString();
         CreateTest(TestName, description);
         System.Threading.Thread.Sleep(5000);
         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.ClickSourceControlTypeGitHub();
         System.Threading.Thread.Sleep(15000);
         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, "GitHub Project is Created");
         Assert.IsTrue(VerifyText("Success", status, "GitHub Project is Created with status:" + status + "", "GitHub 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(3000);
         distmodule.ClickDistribution();
         System.Threading.Thread.Sleep(8000);
         String expected1 = distmodule.EnterDistirbutionName();
         System.Threading.Thread.Sleep(85000);
         distmodule.ClickBranchForGitHub();
         System.Threading.Thread.Sleep(5000);
         distmodule.EnterTocPath();
         distmodule.EnterDescription("This is to create a distribution");
         System.Threading.Thread.Sleep(5000);
         distmodule.ClickCreateDistribution();
         System.Threading.Thread.Sleep(40000);
         addProject.ClickNotifications();
         System.Threading.Thread.Sleep(15000);
         String status1 = addProject.GetNotificationStatus();
         String path1   = TakeScreenshot(driver);
         addProject.SuccessScreenshot(path1, "Distribution: " + expected1 + "got Created successfully For GITHUB Project with TOC");
         Assert.IsTrue(VerifyText("Success", status1, "Distribution is Created for github With TOC Path 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 for GITHUB With TOC");
         Assert.IsTrue(VerifyEquals(expected1, actual, "Create Distribution for GitHub Project  with TOC is successful", "Create Distribution for GitHub Project is not successful"));
         System.Threading.Thread.Sleep(8000);
         String expected2 = distmodule.EnterDistirbutionName();
         System.Threading.Thread.Sleep(65000);
         distmodule.ClickBranchWithOutTOC();
         System.Threading.Thread.Sleep(5000);
         distmodule.EnterDescription("This is to create a distribution");
         System.Threading.Thread.Sleep(5000);
         distmodule.ClickCreateDistribution();
         System.Threading.Thread.Sleep(40000);
         addProject.ClickNotifications();
         System.Threading.Thread.Sleep(15000);
         String status2 = addProject.GetNotificationStatus();
         String path3   = TakeScreenshot(driver);
         addProject.SuccessScreenshot(path3, "Distribution: " + expected2 + " got Created successfully Without TOC Path");
         Assert.IsTrue(VerifyText("Success", status2, "Distribution is Created For GitLab Without TOC with status:" + status2 + "", "Distribution is not created For GitLab without TOC with status: " + status2 + ""));
         addProject.BackToProject();
         System.Threading.Thread.Sleep(5000);
     }
     catch (AssertionException)
     {
         fail("Assertion failed");
         throw;
     }
 }