Esempio n. 1
0
        public void PrepareLetter(string draftLetterTemplateName = "")
        {
            ActivitiesNav.LnkPrepareLetter.Click();
            var prepareLetterPage = new PrepareLetterPopup(this.GetStudyID(), "Prepare Letter");

            prepareLetterPage.SwitchTo();
            if (draftLetterTemplateName == "")
            {
                prepareLetterPage.CmbDraftLetterTemplate.SelectByIndex(1);
            }
            else
            {
                prepareLetterPage.CmbDraftLetterTemplate.SelectByInnerText(draftLetterTemplateName);
            }
            prepareLetterPage.BtnGenerate.Click();
            Wait.Until(d => new CCElement(By.PartialLinkText("Correspondence")).Exists);
            prepareLetterPage.BtnOk.Click();
            prepareLetterPage.SwitchBackToParent();
            Wait.Until(h => ProjectLogHistory.VerifyFirstRowLink("Prepared Letter") == true);
            //Wait.Until((d) => new CCElement(By.LinkText("Prepared Letter")).Exists);
        }
 public void PrepareLetter(string draftLetterTemplateName = "")
 {
     ActivitiesNav.LnkPrepareLetter.Click();
     var prepareLetterPage = new PrepareLetterPopup(this.GetStudyID(), "Prepare Letter");
     prepareLetterPage.SwitchTo();
     if (draftLetterTemplateName == "")
     {
         prepareLetterPage.CmbDraftLetterTemplate.SelectByIndex(1);
     }
     else
     {
         prepareLetterPage.CmbDraftLetterTemplate.SelectByInnerText(draftLetterTemplateName);
     }
     prepareLetterPage.BtnGenerate.Click();
     Wait.Until(d => new CCElement(By.PartialLinkText("Correspondence")).Exists);
     prepareLetterPage.BtnOk.Click();
     prepareLetterPage.SwitchBackToParent();
     Wait.Until(h => ProjectLogHistory.VerifyFirstRowLink("Prepared Letter") == true);
     //Wait.Until((d) => new CCElement(By.LinkText("Prepared Letter")).Exists);
 }
        public void PrepareLetter()
        {
            string targetStudy = "AutoTest-" + DataGen.String(5);
            CloneEntity("STUDY-AutoTest-hWfUU", targetStudy);

            var ActionsNav = new ActivitiesNav();
            var Inbox = new Inbox();
            var finalizeDocumentsPage = new FinalizeDocuments();
            //var prepareLetterPage = new PrepareLetterPopup();
            //var sendLetterPage = new SendLetterPopup();
            var IRBSubmissionPage = new IRBSubmissions();
            var studyworkspace = new IRBWorkspace();

            Store.LoginAsUser(Users.Irbd);

            ActionsNav.LnkSubmissions.Click();
            IRBSubmissionPage.AllSubmissionsTab.NavigateTo();
            IRBSubmissionPage.AllSubmissionsTab.ProjectsComponent.LnkAdvanced.Click();
            IRBSubmissionPage.AllSubmissionsTab.ProjectsComponent.SetCriteria("Name", targetStudy);
            IRBSubmissionPage.OpenSubmission(targetStudy);

            // finalize the documents
            ActionsNav.LnkFinalizeDocuments.Click();
            PopUpWindow.SwitchTo("Execute \"Finalize Documents\"",true);
            finalizeDocumentsPage.ChkApprove.Click();
            finalizeDocumentsPage.BtnOk.Click();
            // Assert that the "Finalized Documents" appear in History tab
            PopUpWindow.SwitchTo("AutoTest",true);
            Wait.Until((d) => new CCElement(By.LinkText("Finalized Documents")).Exists);
            Assert.IsTrue(new CCElement(By.LinkText("Finalized Documents")).Exists);
            Assert.IsTrue(ActionsNav.ContainerIRBState.Text == "Post-Review");

            // Prepare Letter
            var prepareLetterPage = new PrepareLetterPopup(studyworkspace.GetStudyID(),"Prepare Letter");
            ActionsNav.LnkPrepareLetter.Click();
            PopUpWindow.SwitchTo("Execute \"Prepare Letter\"",true);
            prepareLetterPage.CmbDraftLetterTemplate.SelectByInnerText("Approval");
            prepareLetterPage.BtnGenerate.Click();
            // wait for draft letter link to appear
            Wait.Until(d => new CCElement(By.PartialLinkText("Correspondence")).Exists);
            prepareLetterPage.BtnOk.Click();
            PopUpWindow.SwitchTo("AutoTest",true);
            Wait.Until((d) => new CCElement(By.LinkText("Prepared Letter")).Exists);
            Assert.IsTrue(new CCElement(By.LinkText("Prepared Letter")).Exists);
            Assert.IsTrue(ActionsNav.ContainerIRBState.Text == "Post-Review");

            // Send Letter
            var sendLetterPage = new SendLetterPopup(studyworkspace.GetStudyID(), "Send Letter");
            ActionsNav.LnkSendLetter.Click();
            PopUpWindow.SwitchTo("Execute \"Send Letter\"", true);
            sendLetterPage.BtnOk.Click();
            PopUpWindow.SwitchTo("AutoTest", true);
            Wait.Until((d) => new CCElement(By.LinkText("Letter Sent")).Exists);
            Assert.IsTrue(new CCElement(By.LinkText("Letter Sent")).Exists);
            Assert.IsTrue(ActionsNav.ContainerIRBState.Text == "Approved");
        }