//SCENARIO 10. CRS describe('Create a CRS Funding Proposal Role Verification', function() { var FPTitle = '10_Automated Test NonGov Clinical Res Agreement'; //globals var testdata = global.testdata; //points to a folder containing various files for upgrade var siteimpersonate = testdata.siteimpersonnate; var sitelogoff = testdata.sitelogoff; var DocsPath = testdata.docsPath; var searchForPI = "Appelbaum"; var searchForPIUserID = "JPPATCHES"; var searchForPreAwardAdminUserID = "GUERTRUDE"; var searchForPreAwardAdmin = "Olson"; var searchForPostAwardAdmin = "Kraus"; var searchForAdditionalEditors = "Smith"; var searchForAdditionalStaff = "JONES"; var searchForAdditionalNonStaff = ["Stan", "George"]; var searchForApproverUserID = "POPEYE"; ; var searchForSpecialistUserID = "OLIVEOIL"; var FPID; // populated at end of FP creation function testDoc() { return DocsPath + 'scratchNotes.txt'; } function specificAims() { return DocsPath +'SpecAims.pdf'; } function resStrat() { return DocsPath +'ResStrat.pdf'; } function vertAnim() { return DocsPath +'VertAnim.pdf'; } function abstract() { return DocsPath +'Abstract.pdf'; } function projNarrative() { return DocsPath +'projNarrative.pdf'; } function bioSketchPI() { return DocsPath +'Bio_JH.pdf'; } function bioSketchOther() { return DocsPath +'Bio_SB.pdf'; } function budgetJustification() { return DocsPath +'BudgetJustification.pdf'; } function bibliographyReferences() { return DocsPath +'BibRef.pdf'; } function multiPILeadershipPlan() { return DocsPath +'Leadership.pdf'; } function ProtectionsOfHumanSubjectsPlan() { return DocsPath +'ProtectionsOfHumanSubjectsPlan.pdf'; } function InclusionOfWomenMinoritiesChildren() { return DocsPath +'InclusionWomenMinor.pdf'; } function IRBPlan() { return DocsPath +'IRBPlan.pdf'; } function impersonnate( WHO ) { browser.get(siteimpersonate, 5000); var username = element(by.name('username')).sendKeys( testdata.adminID ); browser.sleep(500); var password = element(by.name('password')).sendKeys( testdata.adminPW ); browser.sleep(500); var defocus = element(by.xpath('//*[@id="loginForm"]/table/tbody/tr[2]/td/div/table[1]/tbody/tr[3]/td[2]/input[1]')).click(); browser.sleep(1500); var chooserPopup = element(by.xpath('//*[@id="chooserPopup"]')).click(); selectWindow(1); browser.sleep(500); var userID = element(by.xpath('//*[@id="_webrRSV_FilterValue_0_0"]')).sendKeys( WHO ); GoBtn = element(by.name('webrRSV__FilterGo_0')).click(); browser.sleep(500); Person = element(by.xpath('//*[@id="_webrRSV_DIV_0"]/table/tbody/tr[2]/td[1]/label')).click();; OK = element(by.buttonText('OK')).click(); browser.sleep(500); selectWindow(0); var Impersonnate = element(by.name('action')).click(); browser.sleep(6000); } beforeAll(function() { /** * http://stackoverflow.com/questions/31806393/how-to-access-a-textbox-in-a-pop-up-window-using-protractor *[selectWindow Focus the browser to the index window. * @param {[Object]} index [Is the index of the window. E.g., 0=browser, 1=FBpopup] * @return {[!webdriver.promise.Promise.]} */ global.selectWindow = function(index) { // wait for handles[index] to exist browser.wait(function() { return browser.getAllWindowHandles().then(function(handles) { /** * Assume that handles.length >= 1 and index >=0. * So when calling selectWindow(index) return * true if handles contains that window. */ if (handles.length > index) { return true; } }); }, 3000); // here i know that the requested window exists // switch to the window return browser.getAllWindowHandles().then(function(handles) { return browser.switchTo().window(handles[index]); }); }; browser.driver.manage().window().maximize(); jasmine.DEFAULT_TIMEOUT_INTERVAL = 120000; //tell protractor not to look for Angular return browser.ignoreSynchronization = true; }); //end of beforeAll it('should impersonate logging in as Research Assistant aka Pre Award Admin', function() { impersonnate( searchForPreAwardAdminUserID ); }); it('should create a funding proposal', function() { var GrantsTab = element(by.xpath('.//*[.="Grants"]')).click(); browser.sleep(2500); var CreateFundingSubmission = element(by.xpath('/html/body/main/table/tbody/tr[1]/td/table/tbody/tr[2]/td[1]/span[1]/div/form/span/a')).click(); browser.sleep(2500); var InstrumentType = element(by.cssContainingText('option', 'Clin Res Agreement')).click(); var TypeOfApplication = element(by.xpath('//*[@id="__FundingProposal.customAttributes.customExtension.customAttributes.fhChecklistApplicationType_container"]')).element(by.tagName('table')).element(by.xpath('tbody/tr[1]/td[1]')).click(); browser.sleep(2500); var PeopleSoftAwardNumber = element(by.name('_FundingProposal.customAttributes.customExtension.customAttributes.fhPeopleSoftAward')).clear().sendKeys('20011915'); var SponsorNumber = element(by.name('_FundingProposal.customAttributes.primarySponsorNbr')).clear().sendKeys('5 U24 CA086368-18'); browser.sleep(500); var IsAwardTransferringYes = element(by.xpath('//*[@id="__FundingProposal.customAttributes._attribute10.customAttributes.transferFromOtherInst_container"]/input[1]')).click(); var TitleOfProposal = element(by.name('_FundingProposal.name')).sendKeys( FPTitle ); var pi = element(by.xpath('//*[@id="__FundingProposal.customAttributes._attribute0_container"]')).element(by.className('chooserInputContainer')).click(); selectWindow(1); browser.sleep(500); var filterbySelect = element(by.xpath('//*[@id="_webrRSV_FilterField_0_0"]')).element(by.cssContainingText('option', 'User ID')).click();; browser.sleep(500); var PIFind = element(by.id('_webrRSV_FilterValue_0_0')).sendKeys( searchForPIUserID ); browser.sleep(500); GoBtn = element(by.name('webrRSV__FilterGo_0')).click(); Person = element(by.xpath('//*[@id="_webrRSV_DIV_0"]/table/tbody/tr[2]/td[1]/label')).click();; OK = element(by.buttonText('OK')).click(); browser.sleep(500); selectWindow(0); browser.sleep(8000); //takes a while to load var PreawardAdminSelect = element(by.xpath('//*[@id="__FundingProposal.customAttributes._attribute10.customAttributes.researchCoordinator_container"]')).element(by.className('chooserInputContainer')).element(by.tagName('button')).click(); selectWindow(1); var PreawardAdminFind = element(by.id('_webrRSV_FilterValue_0_0')).sendKeys( searchForPreAwardAdmin ); var GoBtn = element(by.name('webrRSV__FilterGo_0')).click(); var Person = element(by.xpath('//*[@id="_webrRSV_DIV_0"]/table/tbody/tr[2]/td[1]/label')).click(); var OK = element(by.buttonText('OK')).click(); browser.sleep(500); selectWindow(0); var multiPISubmission = element(by.xpath('//*[@id="__FundingProposal.customAttributes._attribute10.customAttributes.multiPISubmission_container"]/label[2]')).click(); browser.sleep(500); var PostAwardSelect = element(by.xpath('//*[@id="__FundingProposal.customAttributes._attribute10.customAttributes.adminContract_container"]')).element(by.className('chooserInputContainer')).element(by.tagName('button')).click(); selectWindow(1); var PostawardAdminFind = element(by.id('_webrRSV_FilterValue_0_0')).sendKeys( searchForPostAwardAdmin ); GoBtn = element(by.name('webrRSV__FilterGo_0')).click(); Person = element(by.xpath('//*[@id="_webrRSV_DIV_0"]/table/tbody/tr[2]/td[1]/label')).click();; OK = element(by.buttonText('OK')).click(); browser.sleep(500); selectWindow(0); var PrimeSponsor = element(by.xpath('//*[@id="__FundingProposal.customAttributes.PrimarySponsor_container"]')).element(by.className('chooserInputContainer')).element(by.tagName('button')).click(); selectWindow(1); var Organization = element(by.id('_webrRSV_FilterValue_0_0')).sendKeys('Pfizer'); GoBtn = element(by.name('webrRSV__FilterGo_0')).click(); Person = element(by.xpath('//*[@id="_webrRSV_DIV_0"]/table/tbody/tr[2]/td[1]/label')).click(); OK = element(by.buttonText('OK')).click(); browser.sleep(1000); selectWindow(0); browser.sleep(500); var SelectAdditionalPeople = element(by.xpath('//*[@id="__FundingProposal.customAttributes._attribute10.customAttributes.editorsInput_container"]')).element(by.className('chooserInputContainer')).element(by.tagName('button')).click(); selectWindow(1); var SelectAdditionalPeople = element(by.id('_webrRSV_FilterValue_0_0')).sendKeys( searchForAdditionalEditors ); GoBtn = element(by.name('webrRSV__FilterGo_0')).click(); Person = element(by.xpath('//*[@id="_webrRSV_DIV_0"]/table/tbody/tr[2]/td[1]/label')).click(); OK = element(by.buttonText('OK')).click(); browser.sleep(1000); selectWindow(0); //save the page and look for validation errors element(by.xpath('//*[@id="lnkSaveProjectEditor_Top"]')).click().then(function (){ console.log("after Proposal and Contacts") var errMsg = element(by.id('pageClientSideError')); expect(errMsg.getText()).toEqual(''); browser.sleep(500); }) }) it('should continue to page 2', function() { //////////////////GRANTS 8.4 dependent var Continue = element(by.id('continue_btn_Top')).click(); //check for presence of 'Additional Personnel' browser.sleep(5000); var PageTitle = element(by.xpath('//*[@id="_webr_EntityView"]/table/tbody/tr[1]/td')); PageTitle.getText().then(function(text){expect(text).toContain("Additional Personnel")}); var AddFHBtn = element(by.xpath('//*[@id="__FundingProposal.customAttributes._attribute10.customAttributes.affiliatedPersonnel_container"]')).element(by.tagName('table')).element(by.tagName('button')).click(); selectWindow(1); browser.sleep(3500); var StaffMember =element(by.xpath('//*[@id="__FP_AdditionalPersonnel.customAttributes.personSelectionData.customAttributes.staffMember_container"]')).element(by.className('chooserInputContainer')).element(by.className('input-chooser-popup-ellipse')).click(); selectWindow(2); browser.sleep(1500); var FilterBy = element(by.id('_webrRSV_FilterValue_0_0')).sendKeys( searchForAdditionalStaff ); var GoBtn = element(by.name('webrRSV__FilterGo_0')).click(); var Selection = element(by.xpath('//*[@id="_webrRSV_DIV_0"]/table/tbody/tr[2]/td[1]/label')).click(); var OK = element(by.buttonText('OK')).click(); browser.sleep(500); selectWindow(1); var SelectProjectRole = element(by.cssContainingText('option', 'Co-PD/PI')).click(); var IndividualIsA = element(by.xpath('//*[@id="__FP_AdditionalPersonnel.customAttributes.key_container"]')).element(by.tagName('table')).element(by.xpath('tbody/tr[1]/td[1]')).click(); var CoveredIndividual = element(by.xpath('//*[@id="__FP_AdditionalPersonnel.customAttributes.isDisclosureRequired_container"]/label[1]')).click(); var OKBtn = element(by.xpath('//*[@id="navigation"]/input[2]')).click(); browser.sleep(500); selectWindow(0); var AddNonFHBtn = element(by.xpath('//*[@id="__FundingProposal.customAttributes._attribute10.customAttributes.nonAffiliatedPersonnel_container"]')).element(by.tagName('table')).element(by.tagName('button')).click(); browser.sleep(500); selectWindow(1); var FirstName = element(by.xpath('//*[@id="__FP_AdditionalPersonnel.customAttributes.personInformation.customAttributes.firstName_container"]/input[1]')).sendKeys("Stan"); var LastName = element(by.xpath('//*[@id="__FP_AdditionalPersonnel.customAttributes.personInformation.customAttributes.lastName_container"]/input[1]')).sendKeys("George"); var phone = element(by.name('_FP_AdditionalPersonnel.customAttributes.personInformation.customAttributes.phone')).sendKeys("206-555-1212"); var email = element(by.xpath('//*[@id="__FP_AdditionalPersonnel.customAttributes.personInformation.customAttributes.email_container"]/input[1]')).sendKeys("aaa@bbb.com"); var street1 = element(by.name('_FP_AdditionalPersonnel.customAttributes.personInformation.customAttributes.streetAddress1')).sendKeys("555 Broad Street"); var city = element(by.name('_FP_AdditionalPersonnel.customAttributes.personInformation.customAttributes.city')).sendKeys("Carlsbad"); var state = element(by.cssContainingText('option','WA')).click(); var zip = element(by.name('_FP_AdditionalPersonnel.customAttributes.personInformation.customAttributes.zipCode')).sendKeys('92009'); //var country = element(by,className("_FP_AdditionalPersonnel.customAttributes.personInformation.customAttributes.country"); var country = element(by.cssContainingText('option','USA')).click(); var SelectProjectRoleOther = element(by.cssContainingText('option', 'Consultant')).click(); var Organization = element(by.xpath('//*[@id="__FP_AdditionalPersonnel.customAttributes.personInformation.customAttributes.organization_container"]/input[1]')).clear().sendKeys("ViaSat"); var Credential = element(by.xpath('//*[@id="__FP_AdditionalPersonnel.customAttributes.personInformation.customAttributes.credential_container"]/input')).sendKeys("YabaDabaDoo"); var thisIndividualIsA = element(by.id('__FP_AdditionalPersonnel.customAttributes.key_container')).element(by.tagName('table')).element(by.xpath('tbody/tr[1]/td[1]/label')).click(); var CoveredIndividual = element(by.xpath('//*[@id="__FP_AdditionalPersonnel.customAttributes.isDisclosureRequired_container"]/label[1]')).click(); var OK2Btn = element(by.xpath('//*[@id="navigation"]/input[2]')).click(); browser.sleep(500); selectWindow(0); element(by.xpath('//*[@id="lnkSaveProjectEditor_Top"]')).click().then(function (){ console.log("after Additional Personnel"); var errMsg = element(by.id('pageClientSideError')); expect(errMsg.getText()).toEqual(''); browser.sleep(1000); }) }); it('should continue on page 3 of SF, General Proposal Information', function() { var Continue = element(by.id('continue_btn_Top')).click(); browser.sleep(3500); var PageTitle = element(by.xpath('//*[@id="_webr_EntityView"]/table/tbody/tr[1]/td')); PageTitle.getText().then(function(text){expect(text).toContain("General Proposal Information")}); var SubmitToSponsor = element(by.xpath('//*[@id="__FundingProposal.customAttributes.customExtension.customAttributes.fhChecklistApplicationSent_container"]')).element(by.tagName('table')).element(by.xpath('tbody/tr[5]/td[1]')).click(); browser.sleep(3500); browser.sleep(500); //ModularBudgete needs a pause //var ModularBudget = element(by.xpath('//*[@id="__FundingProposal.customAttributes._attribute29.customAttributes._attribute5_container"]/label[2]')).click(); var ClinicalTrial = element(by.xpath('//*[@id="__FundingProposal.customAttributes._attribute10.customAttributes.isClinicalTrial_container"]/label[2]')).click(); browser.sleep(3500); var Administrative = element(by.xpath('//*[@id="__FundingProposal.customAttributes.customExtension.customAttributes.fhSalariesApproved_container"]/label[2]')).click(); browser.sleep(3500); var SubrecipientDetermination = element(by.xpath('//*[@id="__FundingProposal.customAttributes.customExtension.customAttributes.fhSubsValid_container"]/label[2]')).click(); //var LimitedApplication = element(by.xpath('//*[@id="__FundingProposal.customAttributes.customExtension.customAttributes.fhLimitedApplication_container"]/label[1]')).click(); //browser.sleep(500); //SelectProgram needs a few ms to re-build itself. //var SelectProgram = element(by.cssContainingText('option', 'TBD')).click(); browser.sleep(4000); element(by.xpath('//*[@id="lnkSaveProjectEditor_Top"]')).click().then(function (){ console.log("after Save click General Proposal Info") var errMsg = element(by.id('pageClientSideError')); expect(errMsg.getText()).toEqual(''); browser.sleep(500); }) }); it('should continue on page 4 of SF, Research Department Determination', function() { var Continue = element(by.id('continue_btn_Top')).click(); browser.sleep(500); var PageTitle = element(by.xpath('//*[@id="_webr_EntityView"]/table/tbody/tr[1]/td')); PageTitle.getText().then(function(text){expect(text).toContain("Research Department Determination")}); var selectedDept = element(by.xpath('//*[@id="__FundingProposal.customAttributes.customExtension.customAttributes.fhResearchDepartmentsInFMS_container"]')).element(by.tagName('button')).click(); browser.sleep(500); selectWindow(1); var FilterBy = element(by.xpath('//*[@id="_webrRSV_FilterValue_0_0"]')).sendKeys('CRD Research'); var GoBtn = element(by.name('webrRSV__FilterGo_0')).click(); var Selection = element(by.xpath('//*[@id="_webrRSV_DIV_0"]/table/tbody/tr[2]/td[1]/label')).click(); var OK = element(by.buttonText('OK')).click(); browser.sleep(500); selectWindow(0); var ReviewingOrganization = element(by.cssContainingText('option', 'CRD')).click(); var SponsoredResearchLocation = element(by.xpath('//*[@id="__FundingProposal.customAttributes._attribute10.customAttributes.institutionInformation.customAttributes.institution_container"]')).element(by.tagName('table')).element(by.xpath('tbody/tr[1]/td[1]')).click(); element(by.xpath('//*[@id="lnkSaveProjectEditor_Top"]')).click().then(function (){ console.log("after Research Department Determination") var errMsg = element(by.id('pageClientSideError')); expect(errMsg.getText()).toEqual(''); browser.sleep(500); }) }); it('should continue on page 5 of SF, Compliance Review', function() { var Continue = element(by.id('continue_btn_Top')).click(); var PageTitle = element(by.xpath('//*[@id="_webr_EntityView"]/table/tbody/tr[1]/td')); PageTitle.getText().then(function(text){expect(text).toContain("Compliance Review")}); var HumanSubjects = element(by.xpath(' //*[@id="__FundingProposal.customAttributes._attribute10.customAttributes.compliance.customAttributes.humanSubjects_container"]/td[3]/label[1]')).click(); var LaboratoryAnimals = element(by.xpath('//*[@id="__FundingProposal.customAttributes._attribute10.customAttributes.compliance.customAttributes.laboratoryAnimals_container"]/td[3]/label[2]')).click(); var RecombinateDNA = element(by.xpath('//*[@id="__FundingProposal.customAttributes._attribute10.customAttributes.compliance.customAttributes.recombinantDNA_container"]/td[3]/label[2]')).click(); var RadioActiveMaterials = element(by.xpath('//*[@id="__FundingProposal.customAttributes._attribute10.customAttributes.compliance.customAttributes.radioactiveMaterials_container"]/td[3]/label[2]')).click(); var Carcinogens = element(by.xpath('//*[@id="__FundingProposal.customAttributes._attribute10.customAttributes.compliance.customAttributes.hazardousMaterials_container"]/td[3]/label[2]')).click(); //var IntellectualPropertyInterest = element(by.xpath('//*[@id="__FundingProposal.customAttributes._attribute10.customAttributes.compliance.customAttributes.institutionalInterest_container"]/input[3]')).click(); element(by.xpath('//*[@id="lnkSaveProjectEditor_Top"]')).click().then(function (){ console.log("after Compliance Review") var errMsg = element(by.id('pageClientSideError')); expect(errMsg.getText()).toEqual(''); browser.sleep(500); }) }); //it('should continue on page 6 of SF, EH&S Review', function() { //var Continue = element(by.id('continue_btn_Top')).click(); //var PageTitle = element(by.xpath('//*[@id="_webr_EntityView"]/table/tbody/tr[1]/td')); //PageTitle.getText().then(function(text){expect(text).toContain("EH&S Review")}); //var DNAApproved = element(by.xpath('//*[@id="__FundingProposal.customAttributes._attribute10.customAttributes.ibcStatus.customAttributes.irbStatus_container"]')).element(by.tagName('table')).element(by.xpath('tbody/tr[1]/td[1]')).click(); //var DNAProtocolNumber = element(by.xpath('//*[@id="__FundingProposal.customAttributes._attribute10.customAttributes.ibcStatus.customAttributes.irbProtocolNumber_container"]/input')).sendKeys('D16-00142'); //var radioActiveApproved = element(by.xpath('//*[@id="__FundingProposal.customAttributes.customExtension.customAttributes.fhRadioLogicStatus.customAttributes.irbStatus_container"]')).element(by.tagName('table')).element(by.xpath('tbody/tr[1]/td[1]')).click(); //var radioActiveProtocolNumber = element(by.xpath('//*[@id="__FundingProposal.customAttributes.customExtension.customAttributes.fhRadioLogicStatus.customAttributes.irbProtocolNumber_container"]/input')).sendKeys("D16-00142"); //var Carcinogens = element(by.xpath('//*[@id="__FundingProposal.customAttributes._attribute10.customAttributes.safetyStatus.customAttributes.irbStatus_container"]')).element(by.tagName('table')).element(by.xpath('tbody/tr[1]/td[1]')).click(); //var carcinogenProtocolNumber = element(by.xpath('//*[@id="__FundingProposal.customAttributes._attribute10.customAttributes.safetyStatus.customAttributes.irbProtocolNumber_container"]/input')).sendKeys('D16-00142'); //element(by.xpath('//*[@id="lnkSaveProjectEditor_Top"]')).click().then(function (){ //console.log("after EH&S Review") //var errMsg = element(by.id('pageClientSideError')); //expect(errMsg.getText()).toEqual(''); //browser.sleep(500); //}) //}); it('should continue on page 7 of SF, Commitment of Additional Resources', function() { var Continue = element(by.id('continue_btn_Top')).click(); var PageTitle = element(by.xpath('//*[@id="_webr_EntityView"]/table/tbody/tr[1]/td')); PageTitle.getText().then(function(text){expect(text).toContain("Commitment of Additional Resources")}); var AdditionalSpace = element(by.xpath('//*[@id="__FundingProposal.customAttributes.customExtension.customAttributes.fhResourcesAdditionalSpace_container"]/label[2]')).click(); var Renovation = element(by.xpath('//*[@id="__FundingProposal.customAttributes.customExtension.customAttributes.fhResourcesRenovation_container"]/label[2]')).click(); var AdditionalStaff = element(by.xpath('//*[@id="__FundingProposal.customAttributes.customExtension.customAttributes.fhResourcesRecruited_container"]/label[2]')).click(); element(by.xpath('//*[@id="lnkSaveProjectEditor_Top"]')).click().then(function (){ console.log("after Save click Additional Resources"); var errMsg = element(by.id('pageClientSideError')); expect(errMsg.getText()).toEqual(''); browser.sleep(500); }) }); it('should continue on page 8 of SF, Program Income', function() { var Continue = element(by.id('continue_btn_Top')).click(); browser.sleep(2000); var PageTitle = element(by.xpath('//*[@id="_webr_EntityView"]/table/tbody/tr[1]/td')); PageTitle.getText().then(function(text){expect(text).toContain("Program Income")}); var ProgramIncome = element(by.xpath('//*[@id="__FundingProposal.customAttributes._attribute29.customAttributes._attribute10_container"]/label[1]')).click(); browser.sleep(600); var AddDetails = element(by.xpath('//*[@id="__FundingProposal.customAttributes._attribute29.customAttributes._attribute12_container"]')).element(by.className('ViewSetToolArea')).element(by.tagName('button')).click(); selectWindow(1); var BudgetPeriodNumber = element(by.xpath('//*[@id="__NIHProgramIncome.customAttributes._attribute3_container"]/input')).sendKeys(1); var SourceOfFunding = element(by.xpath('//*[@id="__NIHProgramIncome.customAttributes._attribute2_container"]/input')).sendKeys("Sell data clustering algorithm"); var Amount = element(by.xpath('//*[@id="__NIHProgramIncome.customAttributes._attribute1_container"]/input[1]')).sendKeys(100001); var OK = element(by.buttonText('OK')).click(); selectWindow(0); browser.sleep(600); element(by.xpath('//*[@id="lnkSaveProjectEditor_Top"]')).click().then(function (){ console.log("after Program Income"); var errMsg = element(by.id('pageClientSideError')); expect(errMsg.getText()).toEqual(''); browser.sleep(500); }) }); it('should continue on page 9 of SF, General Submission Information', function() { var Continue = element(by.id('continue_btn_Top')).click(); var PageTitle = element(by.xpath('//*[@id="_webr_EntityView"]/table/tbody/tr[1]/td')); PageTitle.getText().then(function(text){expect(text).toContain("General Submission Information")}); var applicationNumber = element(by.xpath('//*[@id="__FundingProposal.customAttributes.customExtension.customAttributes.fhApplicationIdentNonGrants_container"]/input')).sendKeys("1234"); var applicationTitle = element(by.xpath('//*[@id="__FundingProposal.customAttributes.customExtension.customAttributes.fhApplicationTitleNonGrants_container"]/input')).sendKeys("TBS FOA Title"); var upload = element(by.id('__FundingProposal.customAttributes.customExtension.customAttributes.fhFOAAttachGuidelines_container')).element(by.tagName('button')).click(); browser.sleep(500); selectWindow(1); //THIS IS A TRICK. FOUND THE REAL type=file input on the page. var fileinput = element(by.name('Document\.targetURL')).sendKeys(testDoc()); OK = element(by.id('OK')).click(); selectWindow(0); browser.sleep(500); element(by.xpath('//*[@id="lnkSaveProjectEditor_Top"]')).click().then(function (){ var errMsg = element(by.id('pageClientSideError')); expect(errMsg.getText()).toEqual(''); console.log("after General Submission Information"); browser.sleep(1000); }) }); //it('should continue on page 10 of SF, Funding Opportunity Announcement', function() { // var Continue = element(by.id('continue_btn_Top')).click(); // // var PageTitle = element(by.xpath('//*[@id="_webr_EntityView"]/table/tbody/tr[1]/td')); // PageTitle.getText().then(function(text){expect(text).toContain("Funding Opportunity Announcement")}); // var upload = element(by.className('SimpleFileUploadRevisionButton')).click(); // browser.sleep(500); // selectWindow(1); //THIS IS A TRICK. FOUND THE REAL type=file input on the page. // var fileinput = element(by.name('Document\.targetURL')).sendKeys(testDoc()); // OK = element(by.id('OK')).click(); // selectWindow(0); // browser.sleep(500); // element(by.xpath('//*[@id="lnkSaveProjectEditor_Top"]')).click().then(function (){ // console.log("after Save Funding Opportunity Announcement"); // var errMsg = element(by.id('pageClientSideError')); // expect(errMsg.getText()).toEqual(''); // browser.sleep(500); // }) //}); it('should continue on page 11 of SF, Submission Dates', function() { var Continue = element(by.id('continue_btn_Top')).click(); var PageTitle = element(by.xpath('//*[@id="_webr_EntityView"]/table/tbody/tr[1]/td')); PageTitle.getText().then(function(text){expect(text).toContain("Submission Dates")}); var applicationDeadline = element(by.name('_FundingProposal.customAttributes.pageNonIndustry.customAttributes._attribute1')).clear().sendKeys('09/08/2018'); var continuous = element(by.xpath('//*[@id="__FundingProposal.customAttributes.customExtension.customAttributes.fhContinuousSubmission_container"]/label[2]')).click(); browser.sleep(500); var OSRDeadline = element(by.xpath('//*[@id="__FundingProposal.customAttributes.pageNonIndustry.customAttributes.internalSubmissionDeadline_container"]/span[3]')); expect(OSRDeadline.getText()).toContain('9/5/2018'); var startDate = element(by.name('_FundingProposal.customAttributes._attribute3')).clear().sendKeys("1/1/2019"); element(by.xpath('//*[@id="lnkSaveProjectEditor_Top"]')).click().then(function (){ console.log("after Save Submission Dates"); var errMsg = element(by.id('pageClientSideError')); expect(errMsg.getText()).toEqual(''); browser.sleep(500); }) }); it('should continue on page 12 of SF, Budget Periods', function() { var Continue = element(by.id('continue_btn_Top')).click(); browser.sleep(2500); var PageTitle = element(by.xpath('//*[@id="_webr_EntityView"]/div/h1')); PageTitle.getText().then(function(text){expect(text).toContain("Budget Periods")}); element(by.xpath('//*[@id="lnkSaveProjectEditor_Top"]')).click().then(function (){ console.log("after Save Budget Page"); var errMsg = element(by.id('pageClientSideError')); expect(errMsg.getText()).toEqual(''); browser.sleep(500); }) }); it('should continue on page 13 of SF, Completion Instructions', function() { var Continue = element(by.id('continue_btn_Top')).click(); browser.sleep(2500); var PageTitle = element(by.xpath('//*[@id="_webr_EntityView"]/table/tbody/tr[1]/td')); PageTitle.getText().then(function(text){expect(text).toContain("Completion Instructions")}); element(by.xpath('//*[@id="finish_btn_Top"]')).click().then(function (){ console.log("==>specGov proposal draft completed"); browser.sleep(1000); var status = element(by.xpath('//*[@id="__FundingProposal.status.ID_container"]/span[3]')); expect(status.getText()).toEqual('Draft'); }) }); it('should continue to the FP Workspace', function() { //var Finish = element(by.id('finish_btn_Top')).click(); //var logoffSelectlor = element(by.xpath('//*[@id="AccountDropDownLink"]')).click(); //browser.sleep(500); //var logoff = element(by.id("LogOffLink")).click(); browser.sleep(2000); console.log("after exit of FP SmartForm to workspace"); }); it('should Capture the FP ID', function() { element(by.id('__FundingProposal.ID_container')).getText().then(function(text){ FPID = text.trim(); console.log("FPID: " + FPID); }); }); // budget start // budget start it('Find and Open the Associated Budget', function() { browser.sleep(8000); var Budget = element(by.cssContainingText('.textControl', FPTitle )).click(); browser.sleep(1000); var EditBudget = element(by.xpath('/html/body/main/table/tbody/tr[1]/td/table/tbody/tr[1]/td/span[2]/div/table/tbody/tr[1]/td/a')).click(); browser.sleep(4000); //time sensitive, can receive stale element error var budgetTitle = element(by.xpath('//*[@id="_webr_EntityView"]/div/h1')); budgetTitle.getText().then(function(text){expect(text).toContain("General Budget Information")}); console.log("after finding and opening a budget"); }); it('Complete the first page of the budget', function() { browser.sleep(500); var Department = element(by.className('input-chooser-popup-ellipse')).click(); browser.sleep(500); selectWindow(1); var Filter = element(by.xpath('//*[@id="_webrRSV_FilterValue_0_0"]')).sendKeys('BS'); var Go = element(by.partialButtonText('Go')).click(); browser.sleep(1800); //time sensitive, can receive stale element error var org = element(by.xpath('//*[@id="_webrRSV_DIV_0"]/table/tbody/tr[3]/td[1]/label')).click(); OK = element(by.buttonText('OK')).click(); browser.sleep(500); selectWindow(0); var TypeOfApplication = element(by.xpath('//*[@id="__Budget.customAttributes.customExtension.customAttributes.researchLocations_container"]')).element(by.tagName('table')).element(by.xpath('tbody/tr[1]/td[1]')).click(); browser.sleep(500); element(by.xpath('//*[@id="lnkSaveProjectEditor_Top"]')).click().then(function (){ var errMsg = element(by.id('pageClientSideError')); expect(errMsg.getText()).toEqual(''); console.log("after General Budget"); var continueBtn = element(by.xpath('//*[@id="continue_btn_Top"]')).click(); browser.sleep(3800); }) }); it('Should Proceed to Personnel Costs', function() { var importButton = element(by.xpath('//*[@id="importBtn"]')).click(); browser.sleep(5000); var update1 = element(by.className('DataTable')).element(by.xpath('tbody/tr[1]/td[2]/button')).click(); browser.sleep(500); selectWindow(1); var salaryApplied = element(by.xpath('//*[@id="__PersonnelCost.customAttributes.baseSalaryIfInflationApplied_container"]/input')).clear().sendKeys('180000'); var OK = element(by.name('ok_btnName')).click(); browser.sleep(2500); selectWindow(0); var update2 = element(by.className('DataTable')).element(by.xpath('tbody/tr[2]/td[2]/button')).click(); browser.sleep(500); selectWindow(1); var salaryApplied = element(by.xpath('//*[@id="__PersonnelCost.customAttributes.baseSalaryIfInflationApplied_container"]/input')).clear().sendKeys('90000'); var OK = element(by.name('ok_btnName')).click(); browser.sleep(2500); selectWindow(0); element(by.xpath('//*[@id="lnkSaveProjectEditor_Top"]')).click().then(function (){ var errMsg = element(by.id('pageClientSideError')); console.log("after Budget Personnel Cost People list"); expect(errMsg.getText()).toEqual(''); var continueBtn = element(by.xpath('//*[@id="continue_btn_Top"]')).click(); browser.sleep(2800); }) }); it('Should Proceed to Personnel Costs Summary', function() { var showEffort = element(by.xpath('//*[@id="costTable"]/tbody/tr[1]/th[1]/div[1]/input')).click(); browser.sleep(1000); var effort1 = element(by.xpath('//*[@id="costTable"]/tbody/tr[2]/td[2]/div[1]/div[1]/span/input')).sendKeys('\b100'); var extendEffort1 = element(by.xpath('//*[@id="costTable"]/tbody/tr[2]/td[2]/div[1]/div[1]/span/img')).click(); var salReq1 = element(by.xpath('//*[@id="costTable"]/tbody/tr[2]/td[2]/div[1]/div[2]/span/input')).sendKeys('\b100'); var extendSalReq1 = element(by.xpath('//*[@id="costTable"]/tbody/tr[2]/td[2]/div[1]/div[2]/span/img')).click(); var effort2 = element(by.xpath('//*[@id="costTable"]/tbody/tr[3]/td[2]/div[1]/div[1]/span/input')).sendKeys('\b100'); var extendEffort2 = element(by.xpath('//*[@id="costTable"]/tbody/tr[3]/td[2]/div[1]/div[1]/span/img')).click(); var salReq2 = element(by.xpath('//*[@id="costTable"]/tbody/tr[3]/td[2]/div[1]/div[2]/span/input')).sendKeys('\b100'); var extendSalReq2 = element(by.xpath('//*[@id="costTable"]/tbody/tr[3]/td[2]/div[1]/div[2]/span/img')).click(); element(by.xpath('//*[@id="lnkSaveProjectEditor_Top"]')).click().then(function (){ var errMsg = element(by.id('pageClientSideError')); console.log("after Budget Personnel Cost Summary"); expect(errMsg.getText()).toEqual(''); var continueBtn = element(by.xpath('//*[@id="continue_btn_Top"]')).click(); browser.sleep(2800); }) }); it('Add a General Cost', function() { var addBtn = element(by.className('entity-action-button')).click(); browser.sleep(3000); selectWindow(1); var costType = element(by.cssContainingText('option', 'ADP/Computer Services')).click(); var costAmount = element(by.xpath('//*[@id="__GeneralCost.customAttributes._attribute10_container"]/input')).clear().sendKeys('10000'); var description = element(by.xpath('//*[@id="__GeneralCost.customAttributes._attribute5_container"]/textarea')).sendKeys('AWS'); var OK = element(by.name('ok_btnName')).click(); selectWindow(0); element(by.xpath('//*[@id="lnkSaveProjectEditor_Top"]')).click().then(function (){ var errMsg = element(by.id('pageClientSideError')); console.log("after Budget General Cost Definition"); expect(errMsg.getText()).toEqual(''); var continueBtn = element(by.xpath('//*[@id="continue_btn_Top"]')).click(); browser.sleep(2800); }) }); it('Proceed to the General Cost Summary', function() { var Savebtn = element(by.xpath('//*[@id="costTable"]/tbody/tr[1]/th[1]/input')).click(); browser.sleep(3000); element(by.xpath('//*[@id="lnkSaveProjectEditor_Top"]')).click().then(function (){ var errMsg = element(by.id('pageClientSideError')); console.log("after Budget General Cost Summary"); expect(errMsg.getText()).toEqual(''); var continueBtn = element(by.xpath('//*[@id="continue_btn_Top"]')).click(); browser.sleep(2800); }) }); it('Proceed to F&A Cost Overrides', function() { browser.sleep(3500); element(by.xpath('//*[@id="finish_btn_Top"]')).click().then(function (){ //var errMsg = element(by.id('pageClientSideError')); console.log("after Budget F&A Cost Overrides"); //expect(errMsg.getText()).toEqual(''); //var ExitBtn = element(by.xpath('//*[@id="lnkExitProjectEditor_Top"]')).click(); browser.sleep(2800); }) }); //budget end it('should Navigate back to the FP Workspace', function() { var BreadCrumbs = element(by.xpath('//*[@id="BreadCrumbOpener"]/span')).click(); browser.sleep(1000); var Breadcrumb = element(by.cssContainingText('.Breadcrumb', 'Grants')).element(by.xpath('following-sibling::a[1]')).click(); console.log("==> Budget Completed. BreadCrumb navigate to FP Workspace"); browser.sleep(3000); }); it('should Run the Upload Assurance Activity on everyone except the PI', function() { var UploadAssuranceActivity = element(by.xpath('.//*[text()[contains(.,"Assurance - Upload")]]')).click(); browser.sleep(500); selectWindow(1); var updateRow = element(by.xpath('//*[@id="__FundingProposal_fhAssuranceUpload.loggedFor.customAttributes.customExtension.customAttributes.fhPIList_container"]')).element(by.className('DataTable')).element(by.xpath('tbody/tr[1]/td[2]/button')).click(); browser.sleep(800); selectWindow(2); var assuranceProvided = element(by.xpath('//*[@id="__fhPIs.customAttributes.assuranceMethod_container"]')).element(by.tagName('table')).element(by.xpath('tbody/tr[1]/td[1]')).click(); var OK = element(by.buttonText('OK')).click(); selectWindow(1); var OK = element(by.buttonText('OK')).click(); console.log("after Upload Assurace by Admin"); browser.sleep(800); selectWindow(0); }); it('should Run the PI Assurance Request Activity', function() { browser.sleep(800); var PIAssuranceRequestActivity = element(by.xpath('.//*[text()[contains(.,"PI Assurance Request")]]')).click(); browser.sleep(800); selectWindow(1); browser.sleep(800); var ackCheckbox = element(by.name('pid')).click(); //ackCheckbox = element(by.xpath('//*[@id="PIList"]/tbody/tr[3]/td[1]/input')).click(); //only one PI now, other is CO-PI var okbtn = element(by.id('okBtn')).click(); console.log("after PI Assurance Request Activity"); selectWindow(0); browser.sleep(800); }); it('Research Assistant logout, PI login', function() { browser.get( sitelogoff, 3000); browser.sleep(4000); impersonnate( searchForPIUserID ); console.log("==>Inbox Test Activity"); browser.sleep(4000); }); it('PI should find an Automated Test Proposal to Assure in the Inbox', function() { browser.sleep(3500); var InboxTab = element(by.id("myDashboardLink")).click(); browser.sleep(2500); var Find = element(by.className('DRSV-QueryCriteria')).clear().sendKeys(FPID); var Go = element(by.partialButtonText('Go')).click(); browser.sleep(4000); //temp delay to observe var FP = element(by.className('DRSV-DataArea')).element(by.className('DataTable')).element(by.xpath('tbody/tr/td[1]')).click(); browser.sleep(1000); console.log("after PI found FP to assure"); }); it('The PI should Run the PI Assurance Activity', function() { browser.sleep(3000); var PIAssuranceActivity = element(by.xpath('.//*[(contains(text(),"PI Assurance") and not(contains(text(),"PI Assurance Request")))]')).click(); //too close to PI Assurance selectWindow(1); browser.sleep(2500); var ackCheckbox = element(by.xpath('//*[@id="__FundingProposal_fhPIAssurance.customAttributes.piProvidedAssurance_container"]/label')).click(); var okbtn = element(by.id('okBtn')).click(); browser.sleep(500); selectWindow(0); console.log("after PI Assurance Acitivity"); browser.sleep(1500); }); it('The PI should Submit For Departmental Approval', function() { //var SubmitForDeptApprovalActivity = element(by.xpath('/html/body/main/table/tbody/tr[1]/td/table/tbody/tr[1]/td/span[4]/div/table/tbody/tr/td/div/table/tbody/tr[8]/td[2]/a')).click(); var SubmitForDeptApprovalActivity = element(by.xpath('.//*[text()[contains(.,"Submit For Departmental Review")]]')).click(); browser.sleep(1500); selectWindow(1); browser.sleep(3000); var OK = element(by.buttonText('OK')).click(); //NOT FINDING ... TIME? selectWindow(0); browser.sleep(2800); //verify state changed var status = element(by.xpath('//*[@id="__FundingProposal.status.ID_container"]/span[3]')); expect(status.getText()).toEqual('Department Review'); browser.sleep(4000); console.log("after Submit For Departmental Approval"); }); it('User should logout as PI and login as the Approver', function() { browser.get( sitelogoff, 3000); browser.sleep(4000); impersonnate( searchForApproverUserID ); console.log("after Approver logs in"); browser.sleep(2000); }); it('Approver should find an Automated Test Proposal in their Inbox', function() { var InboxTab = element(by.id("myDashboardLink")).click(); browser.sleep(2000); var Find = element(by.className('DRSV-QueryCriteria')).clear().sendKeys(FPID); var Go = element(by.partialButtonText('Go')).click(); browser.sleep(2000); //temp delay to observe var FP = element(by.className('DRSV-DataArea')).element(by.className('DataTable')).element(by.xpath('tbody/tr/td[1]')).click(); console.log("after Approver finds an Automated Test Proposal in their Inbox"); browser.sleep(2000); }); it('The Approver should be able to request changes', function() { browser.sleep(2000); var RequestChangesActivity = element(by.xpath('.//*[text()[contains(.,"Request Changes")]]')).click(); selectWindow(1); var ackCheckbox = element(by.xpath('//*[@id="__FundingProposal_fhRequestChanges.notesAsStr_container"]/textarea')).sendKeys('This is an Approver Comment'); var okBtn = element(by.id('okBtn')).click(); browser.sleep(1000); selectWindow(0); console.log("after Approver Requests Changes"); }); it('Approver logout. Admin login for Dept Changes', function() { browser.get( sitelogoff, 4000); browser.sleep(4000); impersonnate( searchForPreAwardAdminUserID ); browser.sleep(2000); console.log("after Admin logs in"); }); it('Admin should find an Automated Test Proposal to submit changes', function() { var InboxTab = element(by.id("myDashboardLink")).click(); browser.sleep(2000); var Find = element(by.className('DRSV-QueryCriteria')).clear().sendKeys(FPID); var Go = element(by.partialButtonText('Go')).click(); browser.sleep(2000); //temp delay to observe var FP = element(by.className('DRSV-DataArea')).element(by.className('DataTable')).element(by.xpath('tbody/tr/td[1]')).click(); console.log("after Admin Finds FP in Inbox"); browser.sleep(3000); }); it('Admin should be able to submit Changes', function() { var RequestChangesActivity = element(by.xpath('.//*[text()[contains(.,"Submit Changes To Department Reviewer")]]')).click(); selectWindow(1); browser.sleep(3000); var comment = element(by.xpath('//*[@id="__FundingProposal_SubmitChangesToDepartmentReviewer.notesAsStr_container"]/textarea')).sendKeys('PI Response For Approver Review: blah blah blah'); var okbtn = element(by.id('okBtn')).click(); browser.sleep(3000); console.log("after Admin Submits Changes ---watch"); selectWindow(0); }); it('Admin Logout. Approver login for approval', function() { browser.get( sitelogoff, 6000); browser.sleep(5000); impersonnate( searchForApproverUserID ); element(by.xpath('//*[@id="myDashboardLink"]')).isDisplayed().then(function (){ console.log("after Approver logs in -- watch"); }) }); it('Approver should find an Automated Test Proposal To Approve', function() { //var InboxTab = element(by.id("myDashboardLink")).click(); browser.sleep(3000); var Find = element(by.className('DRSV-QueryCriteria')).clear().sendKeys(FPID); var Go = element(by.partialButtonText('Go')).click(); browser.sleep(2000); //temp delay to observe var FP = element(by.className('DRSV-DataArea')).element(by.className('DataTable')).element(by.xpath('tbody/tr/td[1]')).click(); console.log("after Department Approver Finds FP in Inbox"); browser.sleep(5000); }); it('Approved by Department Step', function() { var SubmitForDeptApprovalActivity = element(by.xpath('.//*[text()[contains(.,"Approve")]]')).click(); browser.sleep(500); selectWindow(1); var comment = element(by.xpath('//*[@id="__FundingProposal_fhApprove.notesAsStr_container"]/textarea')).sendKeys("This is a Departmental Approval comment") var OK = element(by.buttonText('OK')).click(); browser.sleep(1500); selectWindow(0); browser.sleep(2500); //verify state changed var status = element(by.xpath('//*[@id="__FundingProposal.status.ID_container"]/span[3]')); expect(status.getText()).toEqual('Specialist Review'); console.log("after Department Approved FP"); }); it('Approver logs out. Specialist logs in.', function() { browser.get( sitelogoff, 5000); browser.sleep(4000); impersonnate( searchForSpecialistUserID ); console.log("after OSR type logs in"); browser.sleep(5000); }); it('OSR Officer should find an Automated Test Proposal on the Grants Tab', function() { element(by.xpath('.//*[.="Grants"]')).isDisplayed().click().then(function (){ browser.sleep(5000); console.log("after navigating to the Grants Tab"); }) var filterbySelect = element(by.cssContainingText('option', 'ID')).click(); browser.sleep(2500); var Find = element(by.className('DRSV-QueryCriteria')).clear().sendKeys(FPID); var Go = element(by.partialButtonText('Go')).click(); browser.sleep(5000); //temp delay to observe var FP = element(by.className('DRSV-DataArea')).element(by.className('DataTable')).element(by.xpath('tbody/tr/td[1]')).click(); console.log("after OSR finds Proposal via ID search"); browser.sleep(5000); }); it('Specialist should be Assignable', function() { var SubmitForDeptApprovalActivity = element(by.xpath('.//*[text()[contains(.,"Assign Specialist")]]')).click(); browser.sleep(1000); selectWindow(1); browser.sleep(500); var assignedSpecialist = element(by.xpath('//*[@id="__FundingProposal_fhAssignToSpecialist.loggedFor.owner_container"]')).element(by.cssContainingText('.List', 'Schurman')).element(by.xpath('preceding-sibling::td')).click(); browser.sleep(500); var OK = element(by.buttonText('OK')).click(); selectWindow(0); browser.sleep(1000); //verify state changed var status = element(by.xpath('//*[@id="__FundingProposal.status.ID_container"]/span[3]')); expect(status.getText()).toEqual('Specialist Review'); console.log("after OSR assigns specialist"); }); it('should Capture PSDF Data', function() { browser.sleep(1000); var PSDFCaptureActivity = element(by.xpath('.//*[text()[contains(.,"PSDF Data Capture")]]')).click(); browser.sleep(1000); selectWindow(1); browser.sleep(500); var person1 = element(by.className('DataTable')).element(by.xpath('tbody/tr[1]/td[2]/button')).click(); browser.sleep(500); selectWindow(2); var PSDFReceived = element(by.xpath('//*[@id="__fhPSDFInfo.customAttributes.fhPSDFReceived_container"]')).element(by.tagName("table")).element(by.xpath('tbody/tr[1]/td[1]/label')).click(); var PSDFType= element(by.xpath('//td[contains(text(), "PSDF - Other")]')).element(by.xpath('preceding-sibling::td')).click(); var DatePSDFRcv = element(by.name('_fhPSDFInfo.customAttributes.signatureDate')).clear().sendKeys("12/12/2017"); var conflictStatus = element(by.xpath('//*[@id="__fhPSDFInfo.customAttributes.fhConflictStatusType_container"]')).element(by.tagName('table')).element(by.xpath('tbody/tr[2]/td[1]')).click(); var OK = element(by.name('ok_btnName')).click(); browser.sleep(500); selectWindow(1); browser.sleep(500); //////NEXT var person2 = element(by.className('DataTable')).element(by.xpath('tbody/tr[2]/td[2]/button')).click(); browser.sleep(500); selectWindow(2); PSDFReceived = element(by.xpath('//*[@id="__fhPSDFInfo.customAttributes.fhPSDFReceived_container"]')).element(by.tagName("table")).element(by.xpath('tbody/tr[1]/td[1]/label')).click(); //var PSDFType = element(by.name('_fhPSDFInfo.customAttributes.fhPSDFType')).element(by.xpath('following-sibling::label')).click(); PSDFType= element(by.xpath('//td[contains(text(), "PSDF - Fred Hutch")]')).element(by.xpath('preceding-sibling::td')).click(); var DatePSDFRcv = element(by.name('_fhPSDFInfo.customAttributes.signatureDate')).clear().sendKeys("12/12/2017"); conflictStatus = element(by.xpath('//*[@id="__fhPSDFInfo.customAttributes.fhConflictStatusType_container"]')).element(by.tagName('table')).element(by.xpath('tbody/tr[2]/td[1]')).click(); var OK = element(by.name('ok_btnName')).click(); browser.sleep(500); selectWindow(1); browser.sleep(500); /////// var person3 = element(by.className('DataTable')).element(by.xpath('tbody/tr[3]/td[2]/button')).click(); selectWindow(2); browser.sleep(500); PSDFReceived = element(by.xpath('//*[@id="__fhPSDFInfo.customAttributes.fhPSDFReceived_container"]')).element(by.tagName("table")).element(by.xpath('tbody/tr[1]/td[1]/label')).click(); PSDFType= element(by.xpath('//td[contains(text(), "PSDF - Fred Hutch")]')).element(by.xpath('preceding-sibling::td')).click(); var DatePSDFRcv = element(by.name('_fhPSDFInfo.customAttributes.signatureDate')).clear().sendKeys("12/12/2017"); conflictStatus = element(by.xpath('//*[@id="__fhPSDFInfo.customAttributes.fhConflictStatusType_container"]')).element(by.tagName('table')).element(by.xpath('tbody/tr[2]/td[1]')).click(); var OK = element(by.name('ok_btnName')).click(); browser.sleep(500); selectWindow(1); browser.sleep(500); //done with PSDF Capture var OK = element(by.id('okBtn')).click(); browser.sleep(5000); console.log("after Specialist Uploads the PSDFs"); selectWindow(0); }); it('Specialist should be able to request changes', function() { browser.sleep(1000); var SubmitForDeptApprovalActivity = element(by.xpath('.//*[text()[contains(.,"Specialist Requests Changes")]]')).click(); browser.sleep(1000); selectWindow(1); browser.sleep(500); var comment = element(by.xpath('//*[@id="__FundingProposal_Changes-Requested-By-FGS.notesAsStr_container"]/textarea')).sendKeys("This is a Specialist comment") var OK = element(by.buttonText('OK')).click(); browser.sleep(500); selectWindow(0); browser.sleep(1000); //verify state changed var status = element(by.xpath('//*[@id="__FundingProposal.status.ID_container"]/span[3]')); expect(status.getText()).toEqual('Specialist Review: Pending Changes by PI'); console.log("after Specialist requests changes"); }); it('Specialist logs out. Admin logs in.', function() { browser.get( sitelogoff, 3000); browser.sleep(4000); impersonnate( searchForPreAwardAdminUserID ); browser.sleep(1000); console.log("after Admin Logs In"); }); it('RA should find Proposal', function() { var InboxTab = element(by.id("myDashboardLink")).click(); browser.sleep(1000); var Find = element(by.className('DRSV-QueryCriteria')).clear().sendKeys(FPID); var Go = element(by.partialButtonText('Go')).click(); browser.sleep(2000); //temp delay to observe var FP = element(by.className('DRSV-DataArea')).element(by.className('DataTable')).element(by.xpath('tbody/tr/td[1]')).click(); browser.sleep(2000); console.log("after Admin Finds FP in their Inbox"); }); it('RA Submits Changes To Specialist', function() { var SubmitForDeptApprovalActivity = element(by.xpath('.//*[text()[contains(.,"Submit Changes To Specialist")]]')).click(); browser.sleep(500); selectWindow(1); browser.sleep(2000); var comment = element(by.xpath('//*[@id="__FundingProposal_fhSubmitChangesToSpecialist.notesAsStr_container"]/textarea')).sendKeys("This is a response to the Specialst comment") var OK = element(by.buttonText('OK')).click(); browser.sleep(500); selectWindow(0); browser.sleep(500); //verify state changed var status = element(by.xpath('//*[@id="__FundingProposal.status.ID_container"]/span[3]')); expect(status.getText()).toEqual('Specialist Review'); console.log("after Admins Submits Changes"); }); it('RA logs out. Specialist logs in again to Complete Review.', function() { browser.get( sitelogoff, 3000); browser.sleep(4000); impersonnate( searchForSpecialistUserID ); console.log("after Specialist logs in"); browser.sleep(1000); }); it('Specialist should find an Automated Test Proposal that contains the requested changes', function() { var InboxTab = element(by.id("myDashboardLink")).click(); browser.sleep(1000); var Find = element(by.className('DRSV-QueryCriteria')).clear().sendKeys(FPID); var Go = element(by.partialButtonText('Go')).click(); browser.sleep(2000); //temp delay to observe var FP = element(by.className('DRSV-DataArea')).element(by.className('DataTable')).element(by.xpath('tbody/tr/td[1]')).click(); browser.sleep(5000); console.log("after Specialist finds FP in Inbox to Review Changes"); }); it('Specialist should add the OSR Review Documents', function() { var OSRReviewDocActivity = element(by.xpath('.//*[text()[contains(.,"OSR Review Documents")]]')).click(); browser.sleep(500); selectWindow(1); var Add = element(by.buttonText('Add')).click(); selectWindow(2); browser.sleep(500); //THIS IS A TRICK. FOUND THE REAL type=file input on the page. var fileinput = element(by.name('Document\.targetURL')).sendKeys(testDoc()); var OK = element(by.id('OK')).click(); selectWindow(1); var OK = element(by.buttonText('OK')).click(); selectWindow(0); console.log("after Specialist adds OSR Review Document"); browser.sleep(5200); }); it('Specialist should perform Second Level Review', function() { var SubmitForDeptApprovalActivity = element(by.xpath('.//*[text()[contains(.,"Request Second Level Review")]]')).click(); browser.sleep(1000); selectWindow(1); browser.sleep(500); var assignedSpecialist = element(by.xpath('//*[@id="__FundingProposal_fhRequestSecondLevelReview.forPerson_container"]')).element(by.cssContainingText('.List', 'Schurman')).element(by.xpath('preceding-sibling::td')).click(); var comments = element(by.xpath('//*[@id="__FundingProposal_fhRequestSecondLevelReview.notesAsStr_container"]/textarea')).sendKeys("Second level comment"); browser.sleep(500); var OK = element(by.buttonText('OK')).click(); selectWindow(0); browser.sleep(1000); //verify state changed var status = element(by.xpath('//*[@id="__FundingProposal.status.ID_container"]/span[3]')); expect(status.getText()).toEqual('Specialist Review'); console.log("after Second Level Review Starting"); }); it('Specialist should complete the Second Level Review Complete', function() { var SpecialistReviewActivity = element(by.xpath('.//*[text()[contains(.,"Second Level Review Complete")]]')).click(); browser.sleep(500); selectWindow(1); var comments = element(by.xpath('//*[@id="__FundingProposal_fhSecondLevelReviewComplete.notesAsStr_container"]/textarea')).sendKeys("Alright, alright, alright.") var OK = element(by.buttonText('OK')).click(); selectWindow(0); browser.sleep(500); //verify state changed var status = element(by.xpath('//*[@id="__FundingProposal.status.ID_container"]/span[3]')); expect(status.getText()).toEqual('Specialist Review'); console.log("after 2nd Level Specialist Review Complete"); }); it('Specialist should perform the Specialist Review Complete Activity', function() { var SpecialistReviewActivity = element(by.xpath('.//*[text()[contains(.,"Specialist Review Complete")]]')).click(); browser.sleep(500); selectWindow(1); var OK = element(by.buttonText('OK')).click(); selectWindow(0); browser.sleep(500); //verify state changed var status = element(by.xpath('//*[@id="__FundingProposal.status.ID_container"]/span[3]')); expect(status.getText()).toEqual('Final SPO Review'); console.log("after Specialist Review Complete"); }); it('Specialist Logout, Preaward Admin login', function() { browser.get( sitelogoff, 3000); browser.sleep(4000); impersonnate( searchForPreAwardAdminUserID ); browser.sleep(4000); console.log("after Admin logs in"); }); it('Preaward Admin should find an Automated Test Proposal', function() { browser.sleep(1000); var GrantsTab = element(by.xpath('.//*[.="Grants"]')).click(); browser.sleep(1000); var filterbySelect = element(by.cssContainingText('option', 'ID')).click(); browser.sleep(500); var Find = element(by.className('DRSV-QueryCriteria')).clear().sendKeys(FPID); var Go = element(by.partialButtonText('Go')).click(); browser.sleep(1500); var FP = element(by.className('DRSV-DataArea')).element(by.className('DataTable')).element(by.xpath('tbody/tr/td[1]')).click(); browser.sleep(1000); console.log("after Admin finds FP via ID search (not in Inbox) on Grants Tab"); }); it('Preaward Admin should add the Final Proposal Copy via Add Attachments', function() { var AddAttachmentsActivity = element(by.xpath('.//*[text()[contains(.,"Add Attachments")]]')).click(); browser.sleep(500); selectWindow(1); var AddFinalProposalCopy = element(by.xpath('//*[@id="__FundingProposal_fhAddAttachments.loggedFor.customAttributes.customExtension.customAttributes.fhFinalProposal_container"]')).element(by.tagName('table')).element(by.tagName('button')).click(); selectWindow(2); browser.sleep(500); //THIS IS A TRICK. FOUND THE REAL type=file input on the page. var fileinput = element(by.name('Document\.targetURL')).sendKeys(testDoc()); var OK = element(by.id('OK')).click(); selectWindow(1); browser.sleep(500); var OK = element(by.id('okBtn')).click(); selectWindow(0); console.log("after Admin adds the Final Proposal via Add Attachments"); browser.sleep(500); }); it('Preaward Admin Logout, Specialist login', function() { browser.get( sitelogoff, 3000); browser.sleep(4000); impersonnate( searchForSpecialistUserID ); browser.sleep(1000); console.log("after Specialist logs in"); }); it('Specialist should find an Automated Test Proposal to submit to sponsor', function() { var InboxTab = element(by.id("myDashboardLink")).click(); browser.sleep(1000); var Find = element(by.className('DRSV-QueryCriteria')).clear().sendKeys(FPID); var Go = element(by.partialButtonText('Go')).click(); browser.sleep(2000); //temp delay to observe var FP = element(by.className('DRSV-DataArea')).element(by.className('DataTable')).element(by.xpath('tbody/tr/td[1]')).click(); browser.sleep(2000); console.log("after Specialist finds FP via Inbox Search"); }); it('Specialist should perform the Submit to Sponsor Activity', function() { var ProposalReadySubmitActivity = element(by.xpath('.//*[text()[contains(.,"Submit to Sponsor")]]')).click(); browser.sleep(500); selectWindow(1); var BySponsoredProgram = element(by.xpath('//*[@id="__FundingProposal_fhSubmitToSponsor.loggedFor.customAttributes.customExtension.customAttributes.fhProposalSubmitted_container"]')).element(by.tagName('table')).element(by.xpath('tbody/tr[1]/td[1]')).click(); var ackCheckbox = element(by.xpath('//*[@id="__FundingProposal_fhSubmitToSponsor.notesAsStr_container"]/textarea')).sendKeys('This is an Proposal Submission Comment'); browser.sleep(1200); var OK = element(by.buttonText('OK')).click(); browser.sleep(2000); selectWindow(0); browser.sleep(1200); //verify state changed var status = element(by.xpath('//*[@id="__FundingProposal.status.ID_container"]/span[3]')); expect(status.getText()).toEqual('Pending Sponsor Review'); //app shouldlet this pass since no SF424 is involved browser.sleep(12000); console.log("after Specialist Submits To Sponsor"); }); it('Specialist should perform the JIT Post Submit Materials Request', function() { var JITactivity = element(by.xpath('.//*[text()[contains(.,"JIT Post Submission Materials Request")]]')).click(); browser.sleep(500); selectWindow(1); var Mech1 = element(by.xpath('//*[@id="__FundingProposal_fhJITPostSubmissionMaterialsRequest.customAttributes.fhPostSubmissionMaterials_container"]')).element(by.tagName('table')).element(by.tagName('table')).element(by.xpath('tbody/tr/td[1]')).click(); var Mech2 = element(by.xpath('//*[@id="__FundingProposal_fhJITPostSubmissionMaterialsRequest.customAttributes.fhPostSubmissionMaterials_container"]')).element(by.tagName('table')).element(by.tagName('table')).element(by.xpath('tbody/tr[2]/td[1]')).click(); browser.sleep(500); var systemGen = element(by.xpath('//*[@id="__FundingProposal_fhJITPostSubmissionMaterialsRequest.customAttributes.fhJITSource_container"]')).element(by.tagName('table')).element(by.xpath('tbody/tr[1]/td[1]')).click(); var postSubMaterials = element(by.xpath('//*[@id="__FundingProposal_fhJITPostSubmissionMaterialsRequest.customAttributes.fhPostSubmissionNotes_container"]/textarea')).sendKeys("This is a test, only a test.") var OK = element(by.buttonText('OK')).click(); selectWindow(0); browser.sleep(500); console.log("after Specialist performs JIT Post Submit Materials Request"); }); it('Specialist Logout, Preaward Admin login', function() { browser.get( sitelogoff, 3000); browser.sleep(4000); impersonnate( searchForPreAwardAdminUserID ); console.log("after Admin logs in"); }); it('RA should find an Automated Test Proposal for JIT stuff', function() { browser.sleep(1000); var GrantsTab = element(by.xpath('.//*[.="Grants"]')).click(); browser.sleep(1000); var filterbySelect = element(by.cssContainingText('option', 'ID')).click(); browser.sleep(500); var Find = element(by.className('DRSV-QueryCriteria')).clear().sendKeys(FPID); var Go = element(by.partialButtonText('Go')).click(); browser.sleep(1500); var FP = element(by.className('DRSV-DataArea')).element(by.className('DataTable')).element(by.xpath('tbody/tr/td[1]')).click(); browser.sleep(1000); console.log("after Admin finds FP via ID search (not in Inbox) on Grants Tab"); }); it('Preaward admin should perform the JIT Post Submit Materials Response', function() { var JITactivity = element(by.xpath('.//*[text()[contains(.,"JIT Post Submission Materials Response")]]')).click(); browser.sleep(500); selectWindow(1); var Mech1 = element(by.id('__FundingProposal_fhJITPostSubmissionMaterialsResponse.customAttributes.fhPostSubmissionMaterials_container')).element(by.className('DataTable')).element(by.xpath('tbody/tr[1]/td[1]/table/tbody/tr/td[1]')).click(); var Mech2 = element(by.id('__FundingProposal_fhJITPostSubmissionMaterialsResponse.customAttributes.fhPostSubmissionMaterials_container')).element(by.className('DataTable')).element(by.xpath('tbody/tr[2]/td[1]/table/tbody/tr/td[1]')).click(); browser.sleep(1500); var resp1 = element(by.id('__FundingProposal_fhJITPostSubmissionMaterialsResponse.customAttributes.fhSponsorResponseJIT_container')).element(by.tagName('table')).element(by.xpath('tbody/tr[3]/td[1]')).click(); var resp1Date = element(by.name('_FundingProposal_fhJITPostSubmissionMaterialsResponse\.customAttributes.fhJITExtension')).sendKeys("10/29/2018"); var resp2 = element(by.id('__FundingProposal_fhJITPostSubmissionMaterialsResponse.customAttributes.fhSponsorResponseMaterials_container')).element(by.tagName('table')).element(by.xpath('tbody/tr[3]/td[1]')).click(); var OK = element(by.buttonText('OK')).click(); selectWindow(0); browser.sleep(500); console.log("after Admin performs JIT Post Submit Materials Response"); }); it('Preaward Admin Logout, Specialist login', function() { browser.get( sitelogoff, 3000); browser.sleep(4000); impersonnate( searchForSpecialistUserID ); browser.sleep(1000); console.log("after Specialist logs in"); }); ///continue here Monday, need to Attach Final Proposal Copy it('OSR Specialist should find an Automated Test Proposal for Award Notification', function() { browser.sleep(2000); var GrantsTab = element(by.xpath('.//*[.="Grants"]')).click(); browser.sleep(4000); var filterbySelect = element(by.cssContainingText('option', 'ID')).click(); browser.sleep(500); var Find = element(by.xpath('//*[@id="DD8BEBFF0EC7154DA4CB13E033FC82C0_queryCriteria0"]')).clear().sendKeys(FPID); var Go = element(by.xpath('//*[@id="DD8BEBFF0EC7154DA4CB13E033FC82C0_requery"]')).click(); browser.sleep(2500); var FP = element(by.xpath('//*[@id="DD8BEBFF0EC7154DA4CB13E033FC82C0"]/table/tbody/tr[1]/td[2]/span')).click(); browser.sleep(2000); console.log("after Specialist finds FP via Grants Tab ID Search which has an award"); }); it('OSR should perform the Award Notification Received Activity', function() { var AwardLetterActivity = element(by.xpath('.//*[text()[contains(.,"Award Notification Received")]]')).click(); browser.sleep(500); selectWindow(1); var awardNumber = element(by.xpath('//*[@id="__FundingProposal_fhAwardLetterReceived.loggedFor.customAttributes._attribute27.customAttributes.pageAwardInformation.customAttributes.sponsorAwardID_container"]/input')).clear().sendKeys('1234'); var actualdate = element(by.className('hasDatepicker')).clear().sendKeys("04/01/2017"); var comment = element(by.xpath('//*[@id="__FundingProposal_fhAwardLetterReceived.loggedFor.customAttributes._attribute27.customAttributes.pageAwardInformation.customAttributes.comments_container"]/textarea')).clear().sendKeys("This is a test. Only a test."); var OK = element(by.buttonText('OK')).click(); selectWindow(0); browser.sleep(500); //verify state changed var status = element(by.xpath('//*[@id="__FundingProposal.status.ID_container"]/span[3]')); expect(status.getText()).toEqual('Award Notification Received'); console.log("after Specialist performs Award Notification Received Activity"); }); it('OSR should perform the Award Amount entry Activity', function() { var AwardAmountActivity = element(by.xpath('.//*[text()[contains(.,"Award Amount Entry")]]')).click(); browser.sleep(200); selectWindow(1); browser.sleep(200); var AmountTotalDirectCost = element(by.name('_FundingProposal_fhAwardAmountEntry.loggedFor.customAttributes.customExtension.customAttributes.fhAwardData.customAttributes.awardTotalDirectCost')).clear().sendKeys("10001"); var AwardTotalSubaward = element(by.name('_FundingProposal_fhAwardAmountEntry.loggedFor.customAttributes.customExtension.customAttributes.fhAwardData.customAttributes.awardTotalSubaward')).clear().sendKeys("10001"); var AmountTotalCost = element(by.name('_FundingProposal_fhAwardAmountEntry.loggedFor.customAttributes.customExtension.customAttributes.fhAwardData.customAttributes.awardTotalCost')).clear().sendKeys("1010001"); var PeopleSoftAwardNum = element(by.xpath('//*[@id="__FundingProposal_fhAwardAmountEntry.loggedFor.customAttributes.customExtension.customAttributes.fhAwardData.customAttributes.peopleSoftAwardNum_container"]/input[1]')).clear().sendKeys("12345678"); var PrimaryPSProjectID = element(by.xpath('//*[@id="__FundingProposal_fhAwardAmountEntry.loggedFor.customAttributes.customExtension.customAttributes.fhAwardData.customAttributes.primaryPeopleSoftProjectID_container"]/input[1]')).clear().sendKeys("777555"); var PeopleSoftFnABase = element(by.cssContainingText('option', 'MTDC1')).click(); element(by.xpath('//*[@id="__FundingProposal_fhAwardAmountEntry.loggedFor.customAttributes.customExtension.customAttributes.fhAwardData.customAttributes.flowThruPI_container"]/input')).isDisplayed().then(function (isVisible) { if (isVisible) { // element is visible var FlowThruPI = element(by.xpath('//*[@id="__FundingProposal_fhAwardAmountEntry.loggedFor.customAttributes.customExtension.customAttributes.fhAwardData.customAttributes.flowThruPI_container"]/input')).clear().sendKeys("Pablo Smith"); var FlowThruSponsorNum = element(by.xpath('//*[@id="__FundingProposal_fhAwardAmountEntry.loggedFor.customAttributes.customExtension.customAttributes.fhAwardData.customAttributes.flowThroughSponsorNumber_container"]/input')).clear().sendKeys("420"); var PrimeAwardNumber = element(by.xpath('//*[@id="__FundingProposal_fhAwardAmountEntry.loggedFor.customAttributes.customExtension.customAttributes.fhAwardData.customAttributes.primeAwardNumber_container"]/input')).clear().sendKeys("2018-01-18PCS"); var OK = element(by.buttonText('OK')).click(); } else { // flow elements not visible, just click ok var OK = element(by.buttonText('OK')).click(); } }); selectWindow(0); browser.sleep(500); //verify state changed var status = element(by.xpath('//*[@id="__FundingProposal.status.ID_container"]/span[3]')); expect(status.getText()).toEqual('Award Notification Received'); console.log("after Specialist performs Award Amount Entry Activity"); }); it('OSR should perform the Award Setup Complete Activity', function() { var AwardLetterActivity = element(by.xpath('.//*[text()[contains(.,"Award Setup Complete")]]')).click(); browser.sleep(500); selectWindow(1); browser.sleep(500); var OK = element(by.buttonText('OK')).click(); selectWindow(0); browser.sleep(500); //verify state changed var status = element(by.xpath('//*[@id="__FundingProposal.status.ID_container"]/span[3]')); expect(status.getText()).toEqual('Awarded'); console.log("after Specialist performs Award Setup Complete Activity"); }); afterAll (function() { // console.log("after all spec Gov") // element(by.xpath('/html/body/table[1]/tbody/tr/td[2]/span/a[4]')).click(); // browser.sleep(2000); }) });