// [Test, Description("Verify Project Title throws an error message When User gives Invalid Length")] public void TC_06_ValidateProjectTitleLengthWithLessThan5Characters() { 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.ClickDashboard(); System.Threading.Thread.Sleep(3000); addProject.ClickAddProject(); addProject.ProjectTitleInvalidLength(); String expected = "Please enter at least 5 characters"; System.Threading.Thread.Sleep(3000); addProject.ClickContentType(); String actual = addProject.GetText(addProject.INVALID_TITLE_LENGTH); String path = TakeScreenshot(driver); addProject.SuccessScreenshot(path, "Validating Length of the Title"); System.Threading.Thread.Sleep(3000); Assert.IsTrue(VerifyEquals(expected, actual, "Validation Got Successful", "Validation Got Failed")); addProject.ClickClose(); System.Threading.Thread.Sleep(5000); } catch (AssertionException) { fail("Assertion failed"); throw; } }
// [Test, Description("Verify User is able to Upload an Image in Media Screen")] public void TC_01_ValidationOfUploadImage() { 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(8000); auth.ClickMedia(); System.Threading.Thread.Sleep(8000); auth.UploadImage(); System.Threading.Thread.Sleep(2000); String path1 = TakeScreenshot(driver); auth.SuccessScreenshot(path1, "Uploaded New Image"); 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 Image" + result + " with Notification"); addProject.BackToProject(); System.Threading.Thread.Sleep(2000); auth.ClickDashboard(); } catch (AssertionException) { fail("Assertion failed"); throw; } }
// [Test, Description("Verifying Whether User is able to send More Than 100 characters to the Project Title")] public void TC_07_ValidateProjectTitleLengthWithMoreThan100Characters() { 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.ClickDashboard(); System.Threading.Thread.Sleep(3000); addProject.ClickAddProject(); addProject.ProjectLengthMoreThan100(); System.Threading.Thread.Sleep(3000); addProject.ClickContentType(); String path = TakeScreenshot(driver); addProject.SuccessScreenshot(path, "Length of the Title exceeded its limit"); System.Threading.Thread.Sleep(7000); String str = addProject.GetTitleLength(); Assert.IsTrue(VerifyEquals("100/100", str, "Length Of Project Title got exceeded to its limit as " + str + "", "Length Of Project Title Not got exceeded to its limit as " + str + "")); addProject.ClickClose(); System.Threading.Thread.Sleep(5000); } catch (AssertionException) { fail("Assertion failed"); throw; } }
//[Test, Description("Verify User is able to create a blank draft")] public void TC_04_ValidationOfCreateBlankDraftWithValidDraftName() { try { String TestName = (TestContext.CurrentContext.Test.Name.ToString()); String description = TestContext.CurrentContext.Test.Properties.Get("Description").ToString(); CreateTest(TestName, description); CreateDraftPage createDraft = new CreateDraftPage(driver); System.Threading.Thread.Sleep(5000); createDraft.ClickNewDraft(); String draftName = createDraft.EnterValidDraftName(); System.Threading.Thread.Sleep(5000); createDraft.ClickOnBlankDraft(); System.Threading.Thread.Sleep(5000); String path1 = TakeScreenshot(driver); createDraft.SuccessScreenshot(path1, "Creating Blank Draft"); createDraft.CreateDraft(); System.Threading.Thread.Sleep(25000); AddProjectPage addProject = new AddProjectPage(driver); addProject.ClickNotifications(); System.Threading.Thread.Sleep(8000); String status = addProject.GetNotificationStatus(); String path3 = TakeScreenshot(driver); addProject.SuccessScreenshot(path3, "Draft got Created Successfully"); Assert.IsTrue(VerifyText("Success", status, "Draft: " + draftName + " is Created with status:" + status + "", "Draft is not created with status: " + status + "")); addProject.BackToProject(); } catch (AssertionException) { fail("Assertion failed"); throw; } }
public bool IsProjectCreated() { IWebDriver driver; DriversContainer.cd.TryGetValue(TestContext.CurrentContext.Test.Name, out driver); var addProjectPage = new AddProjectPage(driver); return(addProjectPage.isProjectCreatedNotice.Text.Equals("Successful creation.")); }
//[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; } }
public void CreateProject(string nameProject, string projectIdentifier) { IWebDriver driver; DriversContainer.cd.TryGetValue(TestContext.CurrentContext.Test.Name, out driver); var addNewProject = new AddProjectPage(driver); addNewProject.OpenPage(); addNewProject.CreateNewProject(nameProject, projectIdentifier); }
public MainWindow() { InitializeComponent(); Title = "Project Management"; CommandQueryDispatcher = new CommandQueryDispatcher(); ProjectsPage = new ProjectsPage(this); MainFrame.Content = ProjectsPage; AddProjectPage = new AddProjectPage(this); UsersPage = new UsersPage(this); CreateUserPage = new CreateUserPage(this); }
//[Test, Description("Verify User is able to select a Draft from Dropdown when two different Drafts are selected for AcceptDraftToLive")] public void TC_07_ValidateUserAbleToSelectaDraftFromDropdownWhenClickedAcceptDraftToLiveButton() { try { String TestName = (TestContext.CurrentContext.Test.Name.ToString()); String description = TestContext.CurrentContext.Test.Properties.Get("Description").ToString(); CreateTest(TestName, description); CreateDraftPage createDraft = new CreateDraftPage(driver); System.Threading.Thread.Sleep(5000); createDraft.ClickNewDraft(); System.Threading.Thread.Sleep(5000); String Expected1 = createDraft.EnterValidDraftName(); //createDraft.ClickOnExistingDraft(); // createDraft.SelectCoderDraft(); createDraft.CreateDraft(); System.Threading.Thread.Sleep(15000); System.Threading.Thread.Sleep(5000); AddProjectPage addProject = new AddProjectPage(driver); addProject.ClickNotifications(); // createDraft.ClikOnBackdrop(); String path1 = TakeScreenshot(driver); createDraft.SuccessScreenshot(path1, "Created a Draft"); addProject.BackToProject(); AuthoringScreenEnhancements auth = new AuthoringScreenEnhancements(driver); System.Threading.Thread.Sleep(5000); auth.LeftDraftDropDown(Expected1); System.Threading.Thread.Sleep(5000); auth.ClickAcceptDraftToLive(); String path2 = TakeScreenshot(driver); createDraft.SuccessScreenshot(path2, "DropDown Appears in Accept Draft to live When two different drafts are selected"); System.Threading.Thread.Sleep(5000); auth.SelectDraftFromAcceptDraftToLiveDropDown(); System.Threading.Thread.Sleep(15000); System.Threading.Thread.Sleep(5000); addProject.ClickNotifications(); // createDraft.ClikOnBackdrop(); String path3 = TakeScreenshot(driver); createDraft.SuccessScreenshot(path3, "Created a Live Draft for the scenario of two different drafts"); addProject.BackToProject(); System.Threading.Thread.Sleep(5000); auth.LeftLiveDraft(); System.Threading.Thread.Sleep(5000); auth.MDLeftTab(); String path4 = TakeScreenshot(driver); createDraft.SuccessScreenshot(path4, "Content In the Live Draft"); } catch (AssertionException) { fail("Assertion failed"); throw; } }
public void CreateNewProjectTest() { AddProjectPage addProjectPage = new AddProjectPage(driver); DriversContainer.cd.TryGetValue(TestContext.CurrentContext.Test.Name, out driver); steps.LoginRedmine(driver, Username, Password); steps.CreateProject(rnd.GetRandomString(4), rnd.GetRandomString(2)); var sendAsync = client.SendAsync(addProjectPage.GetResponseAddProjectPage()); var response = sendAsync.Result; Assert.True(steps.IsProjectCreated()); Assert.AreEqual((int)response.StatusCode, 200); }
// [Test, Description("Verifying User is able to Add Project For GitLab with all Fields")] public void TC_02_ValidateCreateProjectForGitLabWithAllFields() { 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(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, "Project Created Title"); 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(3000); String actual = distmodule.getProjectTitle(); String path1 = TakeScreenshot(driver); addProject.SuccessScreenshot(path1, "ProjectTitle"); Assert.IsTrue(VerifyEquals(expected, actual, "GitLab Project Got created Successfully", "GitLab Project Not Created Succesfully")); } catch (AssertionException) { // addTestCaseStatus("Fail", testcaseID, "Test Case Failed"); fail("Assertion failed"); throw; } }
//[Test, Description("Verify User is able to Edit Content for Blank Draft in Right Side GDOC")] public void TC_07_ValidationOfScreenEnhancementsWhenUserEditsBlankDraftContentInRightGdoc() { try { String TestName = (TestContext.CurrentContext.Test.Name.ToString()); String description = TestContext.CurrentContext.Test.Properties.Get("Description").ToString(); CreateTest(TestName, description); CreateDraftPage createDraft = new CreateDraftPage(driver); System.Threading.Thread.Sleep(5000); createDraft.ClickNewDraft(); String draftName = createDraft.EnterValidDraftName(); System.Threading.Thread.Sleep(5000); createDraft.ClickOnBlankDraft(); System.Threading.Thread.Sleep(5000); String path1 = TakeScreenshot(driver); createDraft.SuccessScreenshot(path1, "Creating Blank Draft"); createDraft.CreateDraft(); System.Threading.Thread.Sleep(15000); System.Threading.Thread.Sleep(5000); AddProjectPage addProject = new AddProjectPage(driver); addProject.ClickNotifications(); // createDraft.ClikOnBackdrop(); String path2 = TakeScreenshot(driver); createDraft.SuccessScreenshot(path2, "Created a Draft"); addProject.BackToProject(); System.Threading.Thread.Sleep(8000); AuthoringScreenEnhancements auth = new AuthoringScreenEnhancements(driver); auth.RightDraftDropDown(draftName); System.Threading.Thread.Sleep(5000); IWebElement framel = auth.EnterIntoRightFrame(); driver.SwitchTo().Frame(framel); System.Threading.Thread.Sleep(5000); driver.SwitchTo().ActiveElement(); auth.ClickGdocRight(); driver.SwitchTo().ActiveElement().SendKeys("SELENIUM_TEST_123"); System.Threading.Thread.Sleep(15000); String path3 = TakeScreenshot(driver); auth.SuccessScreenshot(path3, "Editing Existing Draft in GDOC Left"); driver.SwitchTo().DefaultContent(); auth.LeftDraftDropDown(draftName); System.Threading.Thread.Sleep(5000); } catch (AssertionException) { fail("Assertion failed"); throw; } }
//[Test, Description("Verify User is able to edit the existing draft content in Right side GDOC")] public void TC_03_ValidationOfScreenEnhancementsUserEditsExistingContentInRightGdoc() { try { String TestName = (TestContext.CurrentContext.Test.Name.ToString()); String description = TestContext.CurrentContext.Test.Properties.Get("Description").ToString(); CreateTest(TestName, description); CreateDraftPage createDraft = new CreateDraftPage(driver); System.Threading.Thread.Sleep(5000); createDraft.ClickNewDraft(); System.Threading.Thread.Sleep(5000); String draftName = createDraft.EnterValidDraftName(); createDraft.SelectCoderDraft(); System.Threading.Thread.Sleep(5000); createDraft.CreateDraft(); System.Threading.Thread.Sleep(15000); AddProjectPage addProject = new AddProjectPage(driver); addProject.ClickNotifications(); System.Threading.Thread.Sleep(8000); String status2 = addProject.GetNotificationStatus(); String path2 = TakeScreenshot(driver); addProject.SuccessScreenshot(path2, "Draft got Created Successfully"); Assert.IsTrue(VerifyText("Success", status2, "Draft: " + draftName + " is Created with status:" + status2 + "", "Draft is not created with status: " + status2 + "")); addProject.BackToProject(); AuthoringScreenEnhancements auth = new AuthoringScreenEnhancements(driver); System.Threading.Thread.Sleep(8000); auth.RightDraftDropDown(draftName); System.Threading.Thread.Sleep(8000); IWebElement framel = auth.EnterIntoRightFrame(); driver.SwitchTo().Frame(framel); System.Threading.Thread.Sleep(5000); driver.SwitchTo().ActiveElement(); auth.ClickGdocRight(); driver.SwitchTo().ActiveElement().SendKeys("SELENIUM_TEST_123"); System.Threading.Thread.Sleep(15000); String path3 = TakeScreenshot(driver); auth.SuccessScreenshot(path3, "Editing Existing Draft in GDOC Right"); driver.SwitchTo().DefaultContent(); auth.LeftDraftDropDown(draftName); System.Threading.Thread.Sleep(5000); } catch (AssertionException) { fail("Assertion failed"); throw; } }
public void Test1() { var loginSteps = new LoginSteps(Driver); loginSteps.Login(); var dashBoardPage = new DashboardPage(Driver); dashBoardPage.SidebarProjectsAdd.Click(); var addProjectPage = new AddProjectPage(Driver); addProjectPage.Name.SendKeys("test-wrappers-radioButton"); addProjectPage.ModeSuite.SelectById("suite_mode_single_baseline"); addProjectPage.AddProject.Click(); }
//[Test, Description("Verify User is able to create an existing Draft")] public void TC_03_ValidationOfCreateExistingDraftWithValidDraftName() { try { String TestName = (TestContext.CurrentContext.Test.Name.ToString()); String description = TestContext.CurrentContext.Test.Properties.Get("Description").ToString(); CreateTest(TestName, description); CreateDraftPage createDraft = new CreateDraftPage(driver); System.Threading.Thread.Sleep(5000); createDraft.ClickNewDraft(); System.Threading.Thread.Sleep(5000); String draftName = createDraft.EnterValidDraftName(); //createDraft.ClickOnExistingDraft(); createDraft.SelectCoderDraft(); String path1 = TakeScreenshot(driver); createDraft.SuccessScreenshot(path1, "Creating Existing Draft"); createDraft.CreateDraft(); System.Threading.Thread.Sleep(25000); AddProjectPage addProject = new AddProjectPage(driver); addProject.ClickNotifications(); System.Threading.Thread.Sleep(8000); String status = addProject.GetNotificationStatus(); String path = TakeScreenshot(driver); addProject.SuccessScreenshot(path, "Draft got Created Successfully"); Assert.IsTrue(VerifyText("Success", status, "Draft: " + draftName + " is Created with status:" + status + "", "Draft is not created with status: " + status + "")); addProject.BackToProject(); //creating duplicate draft System.Threading.Thread.Sleep(15000); createDraft.ClickNewDraft(); System.Threading.Thread.Sleep(5000); String str = "Duplicate Draft Name"; createDraft.EnterDraftName(draftName); String path2 = TakeScreenshot(driver); createDraft.SuccessScreenshot(path2, "Error Message While Creating Duplicate Draft"); String actual = addProject.GetText(addProject.INVALID_TITLE_LENGTH); Assert.IsTrue(VerifyEquals(str, actual, "Duplicate Draft: " + draftName + " is Unable to Create", "Duplicate Draft " + draftName + " is created")); createDraft.CLOSEDRAFT(); } catch (AssertionException) { fail("Assertion failed"); throw; } }
//[Test, Description("Verify User Able to Click On the AcceptDraftToLive Button when two Drafts are same")] public void TC_02_ValidateUserAbleClickOnAcceptToDraftLiveButtonIfBothTheDraftsAreSame() { try { String TestName = (TestContext.CurrentContext.Test.Name.ToString()); String description = TestContext.CurrentContext.Test.Properties.Get("Description").ToString(); CreateTest(TestName, description); CreateDraftPage createDraft = new CreateDraftPage(driver); System.Threading.Thread.Sleep(5000); createDraft.ClickNewDraft(); System.Threading.Thread.Sleep(5000); String draftName = createDraft.EnterValidDraftName(); // createDraft.ClickOnExistingDraft(); createDraft.CreateDraft(); System.Threading.Thread.Sleep(15000); System.Threading.Thread.Sleep(5000); AddProjectPage addProject = new AddProjectPage(driver); addProject.ClickNotifications(); System.Threading.Thread.Sleep(5000); String path1 = TakeScreenshot(driver); createDraft.SuccessScreenshot(path1, "Created a Draft"); addProject.BackToProject(); AuthoringScreenEnhancements auth = new AuthoringScreenEnhancements(driver); System.Threading.Thread.Sleep(5000); auth.LeftDraftDropDown(draftName); System.Threading.Thread.Sleep(5000); auth.RightDraftDropDown(draftName); System.Threading.Thread.Sleep(5000); auth.ClickAcceptDraftToLive(); System.Threading.Thread.Sleep(15000); addProject.ClickNotifications(); System.Threading.Thread.Sleep(5000); String path2 = TakeScreenshot(driver); createDraft.SuccessScreenshot(path2, "Created a Live Draft"); AddProjectPage addProject1 = new AddProjectPage(driver); addProject1.BackToProject(); System.Threading.Thread.Sleep(5000); } catch (AssertionException) { fail("Assertion failed"); throw; } }
// [Test, Description("Verifying User is able to send more than 1000 characters to Description field in Create Project")] public void TC_08_ValidateProjectDescriptionLengthWithMoreThan1000Characters() { 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.ClickDashboard(); System.Threading.Thread.Sleep(3000); addProject.ClickAddProject(); String expected = addProject.EnterProjectTitle(); addProject.ClickContentType(); System.Threading.Thread.Sleep(15000); addProject.ClickRepository(); addProject.EnterPublishedPath("Publishing path to create project"); String str = addProject.ProjectDescriptionMorethan1000(); Console.WriteLine("The Text Beyonnd 1000 is " + str); String path = TakeScreenshot(driver); addProject.SuccessScreenshot(path, "Length of the Description exceeded its limit"); String str1 = addProject.GetDescriptionLength(); Assert.IsTrue(VerifyEquals("1000/1000", str1, "Length Of Project Title got exceeded to its limit as " + str1 + "", "Length Of Project Title Not got exceeded to its limit as " + str1 + "")); addProject.ClickCreateProject(); System.Threading.Thread.Sleep(7000); addProject.ClickNotifications(); System.Threading.Thread.Sleep(5000); addProject.BackToProject(); CreateDistributionPage distmodule = new CreateDistributionPage(driver); System.Threading.Thread.Sleep(7000); distmodule.SearchForProject(expected); System.Threading.Thread.Sleep(7000); String path1 = TakeScreenshot(driver); addProject.SuccessScreenshot(path1, "Description Length"); String txt = addProject.GetDescriptionText(); Assert.IsTrue(VerifyContainsText(txt, str, "Description Text is validated successfully", "Description Text is not validated successfully")); System.Threading.Thread.Sleep(5000); } catch (AssertionException) { fail("Assertion failed"); throw; } }
public void Test3() { var loginSteps = new LoginSteps(Driver); loginSteps.Login(); var dashBoardPage = new DashboardPage(Driver); dashBoardPage.SidebarProjectsAdd.Click(); var addProjectPage = new AddProjectPage(Driver); addProjectPage.Name.SendKeys("radioBut2"); addProjectPage.ModeSuite.SelectByValue("2"); /*var radioButton = new RadioButton(Driver, By.XPath("//div[@class='radio']")); * radioButton.SelectByValue("2");*/ // addProjectPage.AddProjectButton.Click(); Thread.Sleep(1000); }
public void TC_01_ValidateAddProjectButtonsIsEnabled() { 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); System.Threading.Thread.Sleep(5000); Boolean flag = addproject.IsProjectEnable(); String path = TakeScreenshot(driver); addproject.SuccessScreenshot(path, "Add Project is enabled"); Assert.IsTrue(VerifyBoolean(true, flag, "Create Project Button is Enabled", "Create Project Button is not Enabled")); System.Threading.Thread.Sleep(15000); } catch (AssertionException) { fail("Assertion failed"); throw; } }
//[Test, Description("Verify User is Unable to create a Draft with Same Name of Existing Draft")] public void TC_07_ValidateUserIsUnableToCreateDuplicateDrafts() { try { String TestName = (TestContext.CurrentContext.Test.Name.ToString()); String description = TestContext.CurrentContext.Test.Properties.Get("Description").ToString(); CreateTest(TestName, description); CreateDraftPage createDraft = new CreateDraftPage(driver); System.Threading.Thread.Sleep(5000); createDraft.ClickNewDraft(); System.Threading.Thread.Sleep(5000); String Expected1 = createDraft.EnterValidDraftName(); //createDraft.ClickOnExistingDraft(); // createDraft.SelectCoderDraft(); createDraft.CreateDraft(); System.Threading.Thread.Sleep(15000); System.Threading.Thread.Sleep(5000); AddProjectPage addProject = new AddProjectPage(driver); addProject.ClickNotifications(); // createDraft.ClikOnBackdrop(); String path1 = TakeScreenshot(driver); createDraft.SuccessScreenshot(path1, "Created a Draft Named " + Expected1 + " with existing content"); addProject.BackToProject(); System.Threading.Thread.Sleep(5000); AuthoringScreenEnhancements auth = new AuthoringScreenEnhancements(driver); auth.LeftDraftDropDown(Expected1); System.Threading.Thread.Sleep(5000); createDraft.ClickNewDraft(); System.Threading.Thread.Sleep(5000); createDraft.EnterDraftName(Expected1); createDraft.ClickOnBlankDraft(); String path2 = TakeScreenshot(driver); createDraft.SuccessScreenshot(path2, "Unable To Create a Draft Named " + Expected1 + " with Blank Message"); } catch (AssertionException) { fail("Assertion failed"); throw; } }
public void Test2() { var loginSteps = new LoginSteps(Driver); loginSteps.Login(); var dashBoardPage = new DashboardPage(Driver); dashBoardPage.SidebarProjectsAdd.Click(); var addProjectPage = new AddProjectPage(Driver); addProjectPage.AddProject.Click(); var checkBox = new CheckBox(Driver, By.Id("show_announcement")); //var radioButton = new RadioButton(Driver, By.ClassName("radio")); // radioButton.SelectById("suite_mode_single_baseline"); Console.Out.WriteLine(checkBox.Selected); checkBox.Click(); Console.Out.WriteLine(checkBox.Selected); }
//[Test, Description("Verify User is able to edit the existing draft content in Left side GDOC")] public void TC_01_ValidateScreenEnhancementsWhenUserEditsExistingContentInLeftGdoc() { 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.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(3000); distmodule.ClickDistribution(); System.Threading.Thread.Sleep(8000); String expected1 = distmodule.EnterDistirbutionName(); System.Threading.Thread.Sleep(75000); distmodule.ClickBranchWithTOC(); 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 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); CreateDraftPage createDraft = new CreateDraftPage(driver); System.Threading.Thread.Sleep(8000); createDraft.CLICKOPENPROJECT(); System.Threading.Thread.Sleep(10000); createDraft.ClikOnBackdrop(); System.Threading.Thread.Sleep(5000); createDraft.ClickNewDraft(); System.Threading.Thread.Sleep(5000); String draftName = createDraft.EnterValidDraftName(); createDraft.SelectCoderDraft(); System.Threading.Thread.Sleep(5000); createDraft.CreateDraft(); System.Threading.Thread.Sleep(15000); addProject.ClickNotifications(); System.Threading.Thread.Sleep(8000); String status2 = addProject.GetNotificationStatus(); String path2 = TakeScreenshot(driver); addProject.SuccessScreenshot(path2, "Draft got Created Successfully"); Assert.IsTrue(VerifyText("Success", status2, "Draft: " + draftName + " is Created with status:" + status2 + "", "Draft is not created with status: " + status2 + "")); addProject.BackToProject(); AuthoringScreenEnhancements auth = new AuthoringScreenEnhancements(driver); System.Threading.Thread.Sleep(8000); auth.LeftDraftDropDown(draftName); System.Threading.Thread.Sleep(5000); IWebElement framel = auth.EnterIntoLeftFrame(); driver.SwitchTo().Frame(framel); System.Threading.Thread.Sleep(5000); driver.SwitchTo().ActiveElement(); auth.ClickGdocLeft(); driver.SwitchTo().ActiveElement().SendKeys("SELENIUM_TEST_123"); System.Threading.Thread.Sleep(15000); String path3 = TakeScreenshot(driver); auth.SuccessScreenshot(path3, "Editing Existing Draft in GDOC Left"); driver.SwitchTo().DefaultContent(); auth.RightDraftDropDown(draftName); System.Threading.Thread.Sleep(5000); } catch (AssertionException) { fail("Assertion failed"); throw; } }
//[Test, Description("Verify User Is able to View a DropDown on Clicking of AcceptDraftToLive Button When both drafts are different")] public void TC_01_ValidateUserAbleToSeeDropDownOnAccepttodraftliveButtonIfBothTheDraftsAreDifferent() { 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.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(3000); distmodule.ClickDistribution(); System.Threading.Thread.Sleep(8000); String expected1 = distmodule.EnterDistirbutionName(); System.Threading.Thread.Sleep(85000); distmodule.ClickBranchWithTOC(); 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(50000); addProject.ClickNotifications(); System.Threading.Thread.Sleep(25000); 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); CreateDraftPage createDraft = new CreateDraftPage(driver); System.Threading.Thread.Sleep(8000); createDraft.CLICKOPENPROJECT(); System.Threading.Thread.Sleep(10000); createDraft.ClikOnBackdrop(); System.Threading.Thread.Sleep(5000); createDraft.ClickNewDraft(); System.Threading.Thread.Sleep(5000); String Expected1 = createDraft.EnterValidDraftName(); createDraft.CreateDraft(); System.Threading.Thread.Sleep(15000); System.Threading.Thread.Sleep(5000); addProject.ClickNotifications(); String path2 = TakeScreenshot(driver); createDraft.SuccessScreenshot(path2, "Created a Draft: " + Expected1 + ""); addProject.BackToProject(); AuthoringScreenEnhancements auth = new AuthoringScreenEnhancements(driver); System.Threading.Thread.Sleep(5000); auth.LeftDraftDropDown(Expected1); System.Threading.Thread.Sleep(5000); auth.ClickAcceptDraftToLive(); String path3 = TakeScreenshot(driver); createDraft.SuccessScreenshot(path3, "DropDown Appears in Accept Draft to live When two different drafts are selected"); String Actual = auth.GetDropDownValues(); Console.WriteLine("DropDown Contains: " + Actual); //auth.LeftDraftDropDown(); } catch (AssertionException) { fail("Assertion failed"); throw; } }
// [Test, Description("Verify user is able to do GDoc Enhancement for Uploaded Image")] public void TC_02_ValidateGdocEnhancementsForUploadOfImage() { 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.ClickSourceControlTypeGitLab(); //System.Threading.Thread.Sleep(25000); //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(3000); //distmodule.ClickDistribution(); //System.Threading.Thread.Sleep(8000); //String expected1 = distmodule.EnterDistirbutionName(); //System.Threading.Thread.Sleep(75000); //distmodule.ClickBranchWithTOC(); //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 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); CreateDistributionPage distmodule = new CreateDistributionPage(driver); System.Threading.Thread.Sleep(3000); distmodule.SearchForProject("TestQA_CK"); System.Threading.Thread.Sleep(3000); CreateDraftPage createDraft = new CreateDraftPage(driver); System.Threading.Thread.Sleep(8000); createDraft.CLICKOPENPROJECT(); System.Threading.Thread.Sleep(10000); createDraft.ClikOnBackdrop(); AuthoringScreenEnhancements auth = new AuthoringScreenEnhancements(driver); System.Threading.Thread.Sleep(8000); auth.ClickInsertImage(); 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 path2 = TakeScreenshot(driver); auth.SuccessScreenshot(path2, "Verifying Uploaded Image"); auth.SelectImageFromUpload(result); CreateDraftPage createDraft1 = new CreateDraftPage(driver); System.Threading.Thread.Sleep(5000); createDraft1.ClickNewDraft(); String draftName = createDraft.EnterValidDraftName(); System.Threading.Thread.Sleep(5000); createDraft1.ClickOnBlankDraft(); System.Threading.Thread.Sleep(5000); String path3 = TakeScreenshot(driver); createDraft1.SuccessScreenshot(path3, "Creating Blank Draft: " + draftName + ""); createDraft.CreateDraft(); System.Threading.Thread.Sleep(15000); System.Threading.Thread.Sleep(5000); addProject.ClickNotifications(); System.Threading.Thread.Sleep(5000); addProject.BackToProject(); AuthoringScreenEnhancements auth1 = new AuthoringScreenEnhancements(driver); System.Threading.Thread.Sleep(5000); auth1.LeftDraftDropDown(draftName); System.Threading.Thread.Sleep(5000); IWebElement framel = auth1.EnterIntoLeftFrame(); driver.SwitchTo().Frame(framel); System.Threading.Thread.Sleep(5000); driver.SwitchTo().ActiveElement(); auth1.ClickGdocLeft(); driver.SwitchTo().ActiveElement().SendKeys(Keys.Control + "v"); System.Threading.Thread.Sleep(5000); String path5 = TakeScreenshot(driver); auth1.SuccessScreenshot(path5, "pasting the image Url in Gdoc"); driver.SwitchTo().DefaultContent(); System.Threading.Thread.Sleep(5000); auth1.PreviewLeftTab(); String path6 = TakeScreenshot(driver); auth1.SuccessScreenshot(path6, "Verifying the image got reflected in Preview Left"); System.Threading.Thread.Sleep(5000); auth.GdocLeftTab(); // auth.ClickDashboard(); } catch (AssertionException) { fail("Assertion failed"); throw; } }
//[Test, Description("Verify User Able to Validate Live Draft and Continuous Update Of Live Draft")] public void TC_03_ValidateUserAbleToCreateLiveDraftAndCanContinuouslyUpdateIt() { try { String TestName = (TestContext.CurrentContext.Test.Name.ToString()); String description = TestContext.CurrentContext.Test.Properties.Get("Description").ToString(); CreateTest(TestName, description); AuthoringScreenEnhancements auth1 = new AuthoringScreenEnhancements(driver); auth1.LeftLiveDraft(); System.Threading.Thread.Sleep(5000); auth1.MDLeftTab(); System.Threading.Thread.Sleep(5000); auth1.RightLiveDraft(); System.Threading.Thread.Sleep(5000); auth1.MDRightTab(); System.Threading.Thread.Sleep(5000); CreateDraftPage createDraft1 = new CreateDraftPage(driver); String path3 = TakeScreenshot(driver); createDraft1.SuccessScreenshot(path3, "Validating a Live Draft in both Editor Panes with some content"); CreateDraftPage createDraft2 = new CreateDraftPage(driver); System.Threading.Thread.Sleep(5000); createDraft2.ClickNewDraft(); System.Threading.Thread.Sleep(5000); String draftName1 = createDraft2.EnterValidDraftName(); createDraft2.ClickOnBlankDraft(); System.Threading.Thread.Sleep(5000); String path4 = TakeScreenshot(driver); createDraft2.SuccessScreenshot(path4, "Creating a Blank Draft"); createDraft2.CreateDraft(); System.Threading.Thread.Sleep(15000); System.Threading.Thread.Sleep(5000); AddProjectPage addProject2 = new AddProjectPage(driver); addProject2.ClickNotifications(); System.Threading.Thread.Sleep(5000); String path5 = TakeScreenshot(driver); createDraft2.SuccessScreenshot(path5, "Created a Blank Draft"); addProject2.BackToProject(); System.Threading.Thread.Sleep(5000); AuthoringScreenEnhancements auth2 = new AuthoringScreenEnhancements(driver); auth2.LeftDraftDropDown(draftName1); System.Threading.Thread.Sleep(5000); auth2.RightDraftDropDown(draftName1); System.Threading.Thread.Sleep(5000); auth2.ClickAcceptDraftToLive(); System.Threading.Thread.Sleep(15000); System.Threading.Thread.Sleep(5000); addProject2.ClickNotifications(); System.Threading.Thread.Sleep(5000); String path6 = TakeScreenshot(driver); createDraft2.SuccessScreenshot(path6, "Created a Blank Live Draft"); addProject2.BackToProject(); System.Threading.Thread.Sleep(5000); auth2.LeftLiveDraft(); System.Threading.Thread.Sleep(5000); auth2.MDLeftTab(); System.Threading.Thread.Sleep(5000); auth2.RightLiveDraft(); System.Threading.Thread.Sleep(5000); auth2.MDRightTab(); System.Threading.Thread.Sleep(5000); String path7 = TakeScreenshot(driver); createDraft2.SuccessScreenshot(path7, "Validating Updated Live Draft in both Editor Panes with blank message"); } catch (AssertionException) { fail("Assertion failed"); throw; } }
//[Test, Description("Verify User able to view Updated Content of Live Draft in Coder Draft and vice-versa")] public void TC_06_ValidateContentInLiveDraftShouldUpdateInCoderDraft() { 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(5000); auth.LeftLiveDraft(); System.Threading.Thread.Sleep(5000); auth.MDLeftTab(); System.Threading.Thread.Sleep(5000); CreateDraftPage createDraft = new CreateDraftPage(driver); String path1 = TakeScreenshot(driver); createDraft.SuccessScreenshot(path1, "Content in Live Draft Before Update"); System.Threading.Thread.Sleep(5000); auth.LeftCoderDraft(); System.Threading.Thread.Sleep(5000); String path2 = TakeScreenshot(driver); createDraft.SuccessScreenshot(path2, "Content in Coder Draft Before Update"); createDraft.ClickNewDraft(); System.Threading.Thread.Sleep(5000); String draftName1 = createDraft.EnterValidDraftName(); createDraft.ClickOnBlankDraft(); System.Threading.Thread.Sleep(5000); createDraft.CreateDraft(); System.Threading.Thread.Sleep(15000); System.Threading.Thread.Sleep(5000); AddProjectPage addProject = new AddProjectPage(driver); addProject.ClickNotifications(); System.Threading.Thread.Sleep(5000); String path5 = TakeScreenshot(driver); createDraft.SuccessScreenshot(path5, "Created a Blank Draft"); addProject.BackToProject(); System.Threading.Thread.Sleep(5000); AuthoringScreenEnhancements auth1 = new AuthoringScreenEnhancements(driver); auth1.LeftDraftDropDown(draftName1); auth1.GdocLeftTab(); System.Threading.Thread.Sleep(5000); IWebElement framel = auth1.EnterIntoLeftFrame(); driver.SwitchTo().Frame(framel); System.Threading.Thread.Sleep(5000); driver.SwitchTo().ActiveElement(); auth1.ClickGdocLeft(); driver.SwitchTo().ActiveElement().SendKeys("SELENIUM_TEST_123"); System.Threading.Thread.Sleep(15000); driver.SwitchTo().DefaultContent(); auth1.RightDraftDropDown(draftName1); System.Threading.Thread.Sleep(5000); auth1.ClickAcceptDraftToLive(); System.Threading.Thread.Sleep(15000); System.Threading.Thread.Sleep(15000); addProject.ClickNotifications(); System.Threading.Thread.Sleep(5000); String path6 = TakeScreenshot(driver); createDraft.SuccessScreenshot(path6, "Created a Blank Live Draft"); addProject.BackToProject(); System.Threading.Thread.Sleep(5000); auth1.LeftLiveDraft(); System.Threading.Thread.Sleep(5000); auth.MDLeftTab(); System.Threading.Thread.Sleep(5000); String path7 = TakeScreenshot(driver); createDraft.SuccessScreenshot(path7, "Content in Live Draft after Update"); System.Threading.Thread.Sleep(5000); auth.LeftCoderDraft(); System.Threading.Thread.Sleep(5000); auth.RightCoderDraft(); System.Threading.Thread.Sleep(5000); String path8 = TakeScreenshot(driver); createDraft.SuccessScreenshot(path8, "Content in Coder Draft after Update"); } catch (AssertionException) { fail("Assertion failed"); throw; } }
// [Test, Description("Verify User is able to replace an Image")] public void TC_04_ValidateUserIsAbleToReplaceImage() { 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("TestQA_CK"); CreateDraftPage createDraft = new CreateDraftPage(driver); //System.Threading.Thread.Sleep(8000); //createDraft.CLICKOPENPROJECT(); //System.Threading.Thread.Sleep(8000); //createDraft.ClikOnBackdrop(); //System.Threading.Thread.Sleep(5000); AuthoringScreenEnhancements auth = new AuthoringScreenEnhancements(driver); auth.ClickInsertImage(); System.Threading.Thread.Sleep(15000); Console.WriteLine("*******HERE iS RESULT" + result); String str = result.Split(new[] { ' ' }).Skip(2).FirstOrDefault(); Console.WriteLine("*******HERE iS RESULT" + str); auth.EnterAssetName(str); String path1 = TakeScreenshot(driver); auth.SuccessScreenshot(path1, "Select an Image from Uploads"); System.Threading.Thread.Sleep(25000); auth.SelectImageFromUpload(result); System.Threading.Thread.Sleep(5000); createDraft.ClickNewDraft(); String draftName = createDraft.EnterValidDraftName(); System.Threading.Thread.Sleep(5000); createDraft.ClickOnBlankDraft(); System.Threading.Thread.Sleep(5000); String path2 = TakeScreenshot(driver); createDraft.SuccessScreenshot(path2, "Creating Blank Draft: " + draftName + ""); createDraft.CreateDraft(); System.Threading.Thread.Sleep(15000); System.Threading.Thread.Sleep(5000); AddProjectPage addProject = new AddProjectPage(driver); addProject.ClickNotifications(); // createDraft.ClikOnBackdrop(); String path3 = TakeScreenshot(driver); createDraft.SuccessScreenshot(path3, "Created a Draft"); addProject.BackToProject(); auth.LeftDraftDropDown(draftName); System.Threading.Thread.Sleep(5000); IWebElement framel = auth.EnterIntoLeftFrame(); driver.SwitchTo().Frame(framel); System.Threading.Thread.Sleep(5000); driver.SwitchTo().ActiveElement(); auth.ClickGdocLeft(); driver.SwitchTo().ActiveElement().SendKeys(Keys.Control + "v"); System.Threading.Thread.Sleep(15000); String path4 = TakeScreenshot(driver); auth.SuccessScreenshot(path4, "pasting the image Asset Id in Gdoc"); driver.SwitchTo().DefaultContent(); System.Threading.Thread.Sleep(5000); auth.PreviewLeftTab(); String path5 = TakeScreenshot(driver); auth.SuccessScreenshot(path5, "Verifying the image got reflected in Preview Left"); auth.GdocLeftTab(); auth.ClickInsertImage(); System.Threading.Thread.Sleep(25000); Console.WriteLine("*******HERE iS RESULT" + result); String str1 = result.Split(new[] { ' ' }).Skip(2).FirstOrDefault(); Console.WriteLine("*******HERE iS RESULT" + str1); auth.EnterAssetName(str1); System.Threading.Thread.Sleep(25000); auth.ReplaceTheImage(result); String path8 = TakeScreenshot(driver); auth.SuccessScreenshot(path8, "Verifying the image got replaced with new Image"); auth.SelectImageFromUpload(result); System.Threading.Thread.Sleep(25000); auth.LeftDraftDropDown(draftName); String path6 = TakeScreenshot(driver); auth.SuccessScreenshot(path6, "The same image Url in Gdoc Which was added earlier"); driver.SwitchTo().DefaultContent(); auth.PreviewLeftTab(); String path7 = TakeScreenshot(driver); auth.SuccessScreenshot(path7, "Verifying the image got replaced Succesfully in Preview Left"); } catch (AssertionException) { fail("Assertion failed"); throw; } }
//[Test, Description("Verify New Draft Button is enabled or not")] public void TC_01_ValidateNewDraftButtonDialogBoxIsAppearedOrNot() { 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.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(3000); distmodule.ClickDistribution(); System.Threading.Thread.Sleep(8000); String expected1 = distmodule.EnterDistirbutionName(); System.Threading.Thread.Sleep(75000); distmodule.ClickBranchWithTOC(); 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 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); CreateDraftPage createDraft = new CreateDraftPage(driver); System.Threading.Thread.Sleep(8000); createDraft.CLICKOPENPROJECT(); System.Threading.Thread.Sleep(8000); createDraft.ClikOnBackdrop(); System.Threading.Thread.Sleep(5000); createDraft.ClickNewDraft(); System.Threading.Thread.Sleep(5000); Boolean flag = createDraft.isDraftPopUpEnabled(); System.Threading.Thread.Sleep(5000); String path2 = TakeScreenshot(driver); createDraft.SuccessScreenshot(path2, "Draft Dialog Box Is appeared on screen"); Assert.IsTrue(VerifyBoolean(true, flag, "Draft Dialog Box got Opened Successfully", "Draft Dialog Box is not Opened Successfully")); createDraft.CLOSEDRAFT(); } catch (AssertionException) { fail("Assertion failed"); throw; } }
//[Test, Description("Verify User is able to add Distribution for the GitLab Project with all Fields")] public void TC_01_ValidateCreateDistributionForGitLabProjectWithAllFields() { 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(5000); addProject.ClickSourceControlTypeGitLab(); System.Threading.Thread.Sleep(25000); 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(3000); distmodule.ClickDistribution(); System.Threading.Thread.Sleep(8000); String expected1 = distmodule.EnterDistirbutionName(); System.Threading.Thread.Sleep(85000); distmodule.ClickBranchWithTOC(); 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 got Created successfully With TOC Path"); Assert.IsTrue(VerifyText("Success", status1, "Distribution is Created For GitLab TOC with status:" + status1 + "", "Distribution is not created For GitLab TOC 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(path2, "Created Distribution: " + expected1 + ""); Assert.IsTrue(VerifyEquals(expected1, actual, "Create Distribution for GitLab Project With TOC is successful", "Create Distribution for GitLab Project With TOC is not successful")); System.Threading.Thread.Sleep(8000); String expected2 = distmodule.EnterDistirbutionName(); System.Threading.Thread.Sleep(85000); 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; } }
public AddProjectSteps(IWebDriver driver) : base(driver) { _addProjectPage = new AddProjectPage(Driver, true); }