From a046294002fecfae604afd938ee8b0fda70f20fd Mon Sep 17 00:00:00 2001 From: Juan Huerta Date: Thu, 5 Nov 2020 15:00:28 -0800 Subject: [PATCH] Updated to run on prod --- myJourneysWidget_config.js | 35 ++++ myJourneysWidget_spec.js | 419 +++++++++++++++++++++++++++++++++++++ 2 files changed, 454 insertions(+) create mode 100644 myJourneysWidget_config.js create mode 100644 myJourneysWidget_spec.js diff --git a/myJourneysWidget_config.js b/myJourneysWidget_config.js new file mode 100644 index 0000000..8a6d5b0 --- /dev/null +++ b/myJourneysWidget_config.js @@ -0,0 +1,35 @@ +//myJourneysWidget_config.js + +exports.config = { + framework: 'jasmine', + seleniumAddress: 'http://localhost:4444/wd/hub', + specs: ['myJourneysWidget_spec.js'], + + jasmineNodeOpts: { + defaultTimeoutInterval: 360000 + }, + + capabilities: { + browserName: 'chrome' + }, + + onPrepare: function() { + browser.sleep(2500); + browser.driver.manage().window().maximize(); + }, + + params: { + login: 'https://app-qa.journeysmap.com/Journey/index.html#/login', + username: 'QA_AutomatedRegression' + } + + /*multiCapabilities: [{ + browserName: 'chrome' + }, { + browserName: 'firefox' + }]/*, { + browserName: 'internet explorer' + }], { + browserName: 'safari' + }]*/ +} \ No newline at end of file diff --git a/myJourneysWidget_spec.js b/myJourneysWidget_spec.js new file mode 100644 index 0000000..2f49f2c --- /dev/null +++ b/myJourneysWidget_spec.js @@ -0,0 +1,419 @@ +//myJourneysWidget_spec.js + +describe('My Journeys Widget script', function () { + //login-journeysmap landing page + var UserNameTextBox = element(by.css('#txtU')); + var PasswordTextBox = element(by.css('#txtP')); + + //Open browser + browser.get(browser.params.login); + + it('should have a title', async function () { + await expect(browser.getTitle()).toEqual('Login'); + }); + + //Sign In + SignIn(UserNameTextBox, PasswordTextBox); + + it('should have a title', async function () { + await expect(browser.getTitle()).toEqual('My Dashboard'); + }); + + function SignIn(UserNameTextBox, PasswordTextBox) { + it('should sign into journeysmap.com', async function () { + var PageGreetingText = element(by.css('td > div > div:nth-child(1)')); + var NextButton = element(by.css('.btn')); + var JourneysGreeting = element(by.css('.dropdown')); + + expect(await PageGreetingText.getText()).toEqual('Login and start exploring.'); + await UserNameTextBox.sendKeys(browser.params.username); + browser.sleep(1000); + await PasswordTextBox.sendKeys('3Dm!nAuto'); + browser.sleep(1000); + await NextButton.click().then(function() { + browser.waitForAngular(); + browser.getCurrentUrl(); + }); + expect(await JourneysGreeting.getText()).toContain('Hi, '); + expect(await JourneysGreeting.getText()).toContain('_Automated'); + browser.waitForAngular(); + browser.getCurrentUrl(); + }); + } + + MyJourneysWidget(); + MyJourneysPage(); + + //Sign Out*/ + SignOut(); +}); + +function MyJourneysWidget() { + it(': MyJourneys, should scroll to My Journeys widget on dashboard select 4th journey, view, then validate journey', async function () { + var WidgetTitle = element(by.css('#myjourneys > .jrnys_lead-body-copy > span:nth-child(1)')); + var LatestJourneyTitle = element(by.css('.borderTop .jrnys_body-copy')); + var LatestJourneyLearnMoreLink = element(by.css('.borderTop > #appendHere > .jrnys_support-text')); + var LatestJourneyStepCount = element(by.css('.borderTop')); + var ThirdJourneyInfo = element(by.css('.hideSmallRange > div')); + var SecondJourneyInfo = element(by.css('.hideMidRange > div')); + var SelectedJourneyTitle = element(by.css('.col-md-12 > .ng-binding')); + var SelectedJourneySubTitle = element(by.css('.select-waypointTitle')); + var SelectedJourneySubText = element(by.css('.details-resourceRowTitle')) + var JourneysGreeting = element(by.css('.dropdown')); + var SelectedJourneyResourceTitleOne = element(by.css('.col-md-12:nth-child(2) > .col-md-10 > .relatedResourceTitleRow')); + var SelectedJourneyResourceTypeOne = element(by.css('.col-md-12:nth-child(2) > .col-md-10 > .relatedResourceTypeRow')); + var SelectedJourneyResourceTitleTwo = element(by.css('.col-md-12:nth-child(3) > .col-md-10 > .relatedResourceTitleRow')); + var SelectedJourneyResourceTypeTwo = element(by.css('.col-md-12:nth-child(3) > .col-md-10 > .relatedResourceTypeRow')); + var SelectedJourneyResourceTitleThree = element(by.css('.col-md-12:nth-child(4) > .col-md-10 > .relatedResourceTitleRow')); + var SelectedJourneyResourceTypeThree = element(by.css('.col-md-12:nth-child(4) > .col-md-10 > .relatedResourceTypeRow')); + var SelectedJourneyResourceTitleFour = element(by.css('.col-md-12:nth-child(5) > .col-md-10 > .relatedResourceTitleRow')); + var SelectedJourneyResourceTypeFour = element(by.css('.col-md-12:nth-child(5) > .col-md-10 > .relatedResourceTypeRow')); + var SelectedJourneyResourceTitleFive = element(by.css('.col-md-12:nth-child(6) > .col-md-10 > .relatedResourceTitleRow')); + var SelectedJourneyResourceTypeFive = element(by.css('.col-md-12:nth-child(6) > .col-md-10 > .relatedResourceTypeRow')); + var SelectedJourneyResourceTitleSix = element(by.css('.col-md-12:nth-child(7) > .col-md-10 > .relatedResourceTitleRow')); + var SelectedJourneyResourceTypeSix = element(by.css('.col-md-12:nth-child(7) > .col-md-10 > .relatedResourceTypeRow')); + var SelectedJourneyResourceTitleSeven = element(by.css('.col-md-12:nth-child(8) > .col-md-10 > .relatedResourceTitleRow')); + var SelectedJourneyResourceTypeSeven = element(by.css('.col-md-12:nth-child(8) > .col-md-10 > .relatedResourceTypeRow')); + var SelectedJourneyResourceTitleEight = element(by.css('.col-md-12:nth-child(9) > .col-md-10 > .relatedResourceTitleRow')); + var SelectedJourneyResourceTypeEight = element(by.css('.col-md-12:nth-child(9) > .col-md-10 > .relatedResourceTypeRow')); + var SelectedJourneyResourceTitleNine = element(by.css('.col-md-12:nth-child(10) > .col-md-10 > .relatedResourceTitleRow')); + var SelectedJourneyResourceTypeNine = element(by.css('.col-md-12:nth-child(10) > .col-md-10 > .relatedResourceTypeRow')); + var SelectedJourneyResourceNone = element(by.css('.col-md-12 > .col-md-12')); + var SelectedJourneyRightArrow = element(by.css('.glyphicon-menu-right')); + var OldestJourneyInfo = element(by.css('.journeyListWidgetJourneyContainer:nth-child(4) > div')); + var BackLink = element(by.css('.btn-primary-back-mod')); + + browser.executeScript('window.scrollTo(0, 3473);').then(function() { + browser.sleep(2500); + }); + expect(await WidgetTitle.getText()).toEqual('My Journeys'); + expect(await LatestJourneyTitle.getText()).toContain('11 to Fitness and Wellness Coordinators through M.U.R.P.'); + expect(await LatestJourneyLearnMoreLink.getText()).toContain('Learn More'); + expect(await LatestJourneyStepCount.getText()).toContain('5 steps (0 Complete)'); + expect(await ThirdJourneyInfo.getText()).toContain('8 to Airfield Operations Specialists through College'); + expect(await ThirdJourneyInfo.getText()).toContain('Learn More'); + expect(await ThirdJourneyInfo.getText()).toContain('7 steps (0 Complete)'); + expect(await SecondJourneyInfo.getText()).toContain('10 to Computer and Information Systems Managers through Computer Security Graduate Certificate'); + expect(await SecondJourneyInfo.getText()).toContain('Learn More'); + expect(await SecondJourneyInfo.getText()).toContain('5 steps (0 Complete)'); + expect(await OldestJourneyInfo.getText()).toContain('2 to Natural Sciences Managers through Geology M.A.T./M.S.T.'); + expect(await OldestJourneyInfo.getText()).toContain('Learn More'); + expect(await OldestJourneyInfo.getText()).toContain('13 steps (0 Complete)'); + await SecondJourneyInfo.click().then(function() { + browser.sleep(5000); + }); + expect(await SelectedJourneyTitle.getText()).toEqual('10 to Computer and Information Systems Managers through Computer Security Graduate Certificate'); + expect(await SelectedJourneySubTitle.getText()).toEqual('10'); + expect(await SelectedJourneySubText.getText()).toEqual('Try these resources'); + await JourneysGreeting.getText().then(async function(actualText) { + if(actualText.indexOf('Qa_Automated') !== -1) { + expect(await SelectedJourneyResourceTitleOne.getText()).toEqual('cnn'); + expect(await SelectedJourneyResourceTypeOne.getText()).toEqual('Type:'); + expect(await SelectedJourneyResourceTitleTwo.getText()).toEqual('10th Grade Class Science Project'); + expect(await SelectedJourneyResourceTypeTwo.getText()).toEqual('Type:'); + } else { + expect(await SelectedJourneyResourceNone.getText()).toEqual('Sorry, no related resources!'); + } + }); + await SelectedJourneyRightArrow.click().then(function() { + browser.sleep(2500); + }); + expect(await SelectedJourneySubTitle.getText()).toEqual('11'); + await JourneysGreeting.getText().then(async function(actualText) { + if(actualText.indexOf('Qa_Automated') !== -1) { + expect(await SelectedJourneyResourceTitleOne.getText()).toEqual('This is CNN'); + expect(await SelectedJourneyResourceTypeOne.getText()).toEqual('Type:'); + expect(await SelectedJourneyResourceTitleTwo.getText()).toEqual('just juan testing'); + expect(await SelectedJourneyResourceTypeTwo.getText()).toEqual('Type:'); + expect(await SelectedJourneyResourceTitleThree.getText()).toEqual('fdg'); + expect(await SelectedJourneyResourceTypeThree.getText()).toEqual('Type:'); + expect(await SelectedJourneyResourceTitleFour.getText()).toEqual('cnn'); + expect(await SelectedJourneyResourceTypeFour.getText()).toEqual('Type:'); + } else { + expect(await SelectedJourneyResourceNone.getText()).toEqual('Sorry, no related resources!'); + } + }); + await SelectedJourneyRightArrow.click().then(function() { + browser.sleep(2500); + }); + expect(await SelectedJourneySubTitle.getText()).toEqual('12'); + await JourneysGreeting.getText().then(async function(actualText) { + if(actualText.indexOf('Qa_Automated') !== -1) { + expect(await SelectedJourneyResourceTitleOne.getText()).toEqual('cnn'); + expect(await SelectedJourneyResourceTypeOne.getText()).toEqual('Type:'); + } else { + expect(await SelectedJourneyResourceNone.getText()).toEqual('Sorry, no related resources!'); + } + }); + await SelectedJourneyRightArrow.click().then(function() { + browser.sleep(2500); + }); + expect(await SelectedJourneySubTitle.getText()).toEqual('Computer Security Graduate Certificate'); + expect(await SelectedJourneyResourceNone.getText()).toEqual('Sorry, no related resources!'); + await SelectedJourneyRightArrow.click().then(function() { + browser.sleep(2500); + }); + expect(await SelectedJourneySubTitle.getText()).toEqual('Computer and Information Systems Managers'); + await JourneysGreeting.getText().then(async function(actualText) { + if(actualText.indexOf('Qa_Automated') !== -1) { + expect(await SelectedJourneyResourceTitleOne.getText()).toEqual('Computer and Information Systems Managers (Business, Management and Administration)'); + expect(await SelectedJourneyResourceTypeOne.getText()).toEqual('Type: HTML'); + expect(await SelectedJourneyResourceTitleTwo.getText()).toEqual('Save'); + expect(await SelectedJourneyResourceTypeTwo.getText()).toEqual('Type:'); + expect(await SelectedJourneyResourceTitleThree.getText()).toEqual('Gave'); + expect(await SelectedJourneyResourceTypeThree.getText()).toEqual('Type:'); + expect(await SelectedJourneyResourceTitleFour.getText()).toEqual('Computer and Information Systems Managers'); + expect(await SelectedJourneyResourceTypeFour.getText()).toEqual('Type:'); + expect(await SelectedJourneyResourceTitleFive.getText()).toEqual('Computer and Information Systems Managers'); + expect(await SelectedJourneyResourceTypeFive.getText()).toEqual('Type:'); + expect(await SelectedJourneyResourceTitleSix.getText()).toEqual('Computer and Information Systems Managers'); + expect(await SelectedJourneyResourceTypeSix.getText()).toEqual('Type:'); + expect(await SelectedJourneyResourceTitleSeven.getText()).toEqual('Computer and Information Systems Managers'); + expect(await SelectedJourneyResourceTypeSeven.getText()).toEqual('Type:'); + } else { + expect(await SelectedJourneyResourceTitleOne.getText()).toEqual('Computer and Information Systems Managers (Business, Management and Administration)'); + expect(await SelectedJourneyResourceTypeOne.getText()).toEqual('Type: HTML'); + expect(await SelectedJourneyResourceTitleTwo.getText()).toEqual('Computer and Information Systems Managers'); + expect(await SelectedJourneyResourceTypeTwo.getText()).toEqual('Type:'); + expect(await SelectedJourneyResourceTitleThree.getText()).toEqual('Computer and Information Systems Managers'); + expect(await SelectedJourneyResourceTypeThree.getText()).toEqual('Type:'); + expect(await SelectedJourneyResourceTitleFour.getText()).toEqual('Computer and Information Systems Managers'); + expect(await SelectedJourneyResourceTypeFour.getText()).toEqual('Type:'); + expect(await SelectedJourneyResourceTitleFive.getText()).toEqual('Computer and Information Systems Managers'); + expect(await SelectedJourneyResourceTypeFive.getText()).toEqual('Type:'); + expect(await SelectedJourneyResourceTitleSix.getText()).toEqual('Computer and Information Systems Managers'); + expect(await SelectedJourneyResourceTypeSix.getText()).toEqual('Type:'); + expect(await SelectedJourneyResourceTitleSeven.getText()).toEqual('Computer and Information Systems Managers'); + expect(await SelectedJourneyResourceTypeSeven.getText()).toEqual('Type:'); + expect(await SelectedJourneyResourceTitleEight.getText()).toEqual('Computer and Information Systems Managers'); + expect(await SelectedJourneyResourceTypeEight.getText()).toEqual('Type:'); + expect(await SelectedJourneyResourceTitleNine.getText()).toEqual('Computer and Information Systems Managers'); + expect(await SelectedJourneyResourceTypeNine.getText()).toEqual('Type:'); + } + }); + await SelectedJourneyRightArrow.click().then(function() { + browser.sleep(2500); + }); + await BackLink.click().then(function() { + browser.sleep(2500); + }); + browser.executeScript('window.scrollTo(0, 3473);').then(function() { + browser.sleep(2500); + }); + expect(await WidgetTitle.getText()).toEqual('My Journeys'); + expect(await LatestJourneyTitle.getText()).toContain('11 to Fitness and Wellness Coordinators through M.U.R.P.'); + expect(await LatestJourneyLearnMoreLink.getText()).toContain('Learn More'); + expect(await LatestJourneyStepCount.getText()).toContain('5 steps (0 Complete)'); + expect(await ThirdJourneyInfo.getText()).toContain('8 to Airfield Operations Specialists through College'); + expect(await ThirdJourneyInfo.getText()).toContain('Learn More'); + expect(await ThirdJourneyInfo.getText()).toContain('7 steps (0 Complete)'); + expect(await SecondJourneyInfo.getText()).toContain('10 to Computer and Information Systems Managers through Computer Security Graduate Certificate'); + expect(await SecondJourneyInfo.getText()).toContain('Learn More'); + expect(await SecondJourneyInfo.getText()).toContain('5 steps (0 Complete)'); + expect(await OldestJourneyInfo.getText()).toContain('2 to Natural Sciences Managers through Geology M.A.T./M.S.T.'); + expect(await OldestJourneyInfo.getText()).toContain('Learn More'); + expect(await OldestJourneyInfo.getText()).toContain('13 steps (0 Complete)'); + browser.waitForAngular(); + browser.getCurrentUrl(); + }); +} + +function MyJourneysPage() { + it(': MyJourneysPage, should navigate to My Journeys page view and delete 1st journey', async function () { + var MyJourneysHeaderLink = element(by.css('#nbMyJourneys span')); + var PageTitle = element(by.css('.jrnys_lead-body-copy')); + var PageSubTitle = element(by.css('.col-md-10 .ng-scope:nth-child(1)')); + var SavedJourneyTitleOne = element(by.xpath("//span[contains(.,'11 to Fitness and Wellness Coordinators through M.U.R.P.')]")); + var SelectedJourneyBubbleOne = element(by.css('#mCSB_6_container > .firstWaypoint .lblClass')); + var SelectedJourneyBubbleTwo = element(by.css('#mCSB_6_container > .fullSize-Journey:nth-child(2) .lblClass')); + var SelectedJourneyBubbleThree = element(by.css('#mCSB_6_container > .fullSize-Journey:nth-child(3) .lblClass')); + var SelectedJourneyBubbleFourOne = element(by.css('#mCSB_6_container > .fullSize-Journey:nth-child(4) .lblClass:nth-child(1)')); + var SelectedJourneyBubbleFourTwo = element(by.css('#mCSB_6_container > .fullSize-Journey:nth-child(4) .lblClass:nth-child(2)')); + var SelectedJourneyBubbleFourThree = element(by.css('#mCSB_6_container > .fullSize-Journey:nth-child(4) .lblClass:nth-child(3)')); + var SelectedJourneyBubbleFiveOne = element(by.css('#mCSB_6_container > .fullSize-Journey:nth-child(5) .lblClass:nth-child(1)')); + var SelectedJourneyBubbleFiveTwo = element(by.css('#mCSB_6_container > .fullSize-Journey:nth-child(5) .lblClass:nth-child(2)')); + var SelectedJourneyBubbleFiveThree = element(by.css('#mCSB_6_container > .fullSize-Journey:nth-child(5) .lblClass:nth-child(3)')); + var SavedJourneyTitleTwo = element(by.xpath("//span[contains(.,'8 to Airfield Operations Specialists through College')]")); + var SavedJourneyTitleThree = element(by.xpath("//span[contains(.,'10 to Computer and Information Systems Managers through Computer Security Graduate Certificate')]")); + var SavedJourneyTitleFour = element(by.xpath("//span[contains(.,'2 to Natural Sciences Managers through Geology M.A.T./M.S.T.')]")); + var SelectedJourneyTitle = element(by.css('.col-md-12 > .ng-binding')); + var SelectedJourneySubTitle = element(by.css('.select-waypointTitle')); + var SelectedJourneySubText = element(by.css('.details-resourceRowTitle')) + var JourneysGreeting = element(by.css('.dropdown')); + var SelectedJourneyResourceTitleOne = element(by.css('.col-md-12:nth-child(2) > .col-md-10 > .relatedResourceTitleRow')); + var SelectedJourneyResourceTypeOne = element(by.css('.col-md-12:nth-child(2) > .col-md-10 > .relatedResourceTypeRow')); + var SelectedJourneyResourceTitleTwo = element(by.css('.col-md-12:nth-child(3) > .col-md-10 > .relatedResourceTitleRow')); + var SelectedJourneyResourceTypeTwo = element(by.css('.col-md-12:nth-child(3) > .col-md-10 > .relatedResourceTypeRow')); + var SelectedJourneyResourceTitleThree = element(by.css('.col-md-12:nth-child(4) > .col-md-10 > .relatedResourceTitleRow')); + var SelectedJourneyResourceTypeThree = element(by.css('.col-md-12:nth-child(4) > .col-md-10 > .relatedResourceTypeRow')); + var SelectedJourneyResourceTitleFour = element(by.css('.col-md-12:nth-child(5) > .col-md-10 > .relatedResourceTitleRow')); + var SelectedJourneyResourceTypeFour = element(by.css('.col-md-12:nth-child(5) > .col-md-10 > .relatedResourceTypeRow')); + var SelectedJourneyResourceNone = element(by.css('.col-md-12 > .col-md-12')); + var SelectedJourneyRightArrow = element(by.css('.glyphicon-menu-right')); + var JourneyLearnMoreSubTitle = element(by.css('.details-resourceRowTitle')); + var ViewOnMapButton = element(by.css('.col-md-4 > .btn-info')); + var JourneyViewOnMapTitle = element(by.css('div:nth-child(2) > .ng-binding')); + var JourneyTitleOnMap = element(by.css('#journey-view-single > .side-bar-child-text')); + var EditJourneyLinkText = element(by.linkText('Edit Journey')); + var JourneyClusterOne = element(by.css('#journeyViewToolTip_0 .sidebarDescriptionAncestorTxt > .sidebarDescriptionAncestorTxt')); + var JourneyPathwayOne = element(by.css('#journeyViewToolTip_0 .side-bar-journey-detail-child-txt:nth-child(5)')); + var JourneyClusterTwo = element(by.css('#journeyViewToolTip_1 .sidebarDescriptionAncestorTxt > .sidebarDescriptionAncestorTxt')); + var JourneyPathwayTwo = element(by.css('#journeyViewToolTip_1 .side-bar-journey-detail-child-txt:nth-child(5)')); + var JourneyClusterThree = element(by.css('#journeyViewToolTip_2 .sidebarDescriptionAncestorTxt > .sidebarDescriptionAncestorTxt')); + var JourneyPathwayThree = element(by.css('#journeyViewToolTip_2 .side-bar-journey-detail-child-txt:nth-child(5)')); + var JourneyClusterFour = element(by.css('#journeyViewToolTip_3 .sidebarDescriptionAncestorTxt > .sidebarDescriptionAncestorTxt')); + var JourneyPathwayFour = element(by.css('#journeyViewToolTip_3 .side-bar-journey-detail-child-txt:nth-child(5)')); + var JourneyClusterFive = element(by.css('#journeyViewToolTip_4 .sidebarDescriptionAncestorTxt > .sidebarDescriptionAncestorTxt')); + var JourneyPathwayFive = element(by.css('#journeyViewToolTip_4 .side-bar-journey-detail-child-txt:nth-child(5)')); + var HowAmIDoingButton = element(by.css('.btn-success')); + var DIVTitle = element(by.css('h2')); + var DIVSubTitle = element(by.css('p:nth-child(7)')); + var DIVOKButton = element(by.css('.confirm')); + var DIVCancelButton = element(by.css('.cancel')); + var RemoveJourneyButton = element(by.css('#saveJourneyButton')); + + await MyJourneysHeaderLink.click().then(function() { + browser.sleep(5000); + }); + await expect(PageTitle.getText()).toEqual('My Saved Journeys'); + expect(await PageSubTitle.getText()).toEqual('Select a Journey to show it on the map'); + expect(await SavedJourneyTitleOne.getText()).toEqual('11 to Fitness and Wellness Coordinators through M.U.R.P.'); + expect(await SelectedJourneyBubbleOne.getText()).toEqual('11'); + expect(await SelectedJourneyBubbleTwo.getText()).toEqual('12'); + expect(await SelectedJourneyBubbleThree.getText()).toEqual('M.U.R.P.'); + expect(await SelectedJourneyBubbleFourOne.getText()).toEqual('Personal'); + expect(await SelectedJourneyBubbleFourTwo.getText()).toEqual('Fitness'); + expect(await SelectedJourneyBubbleFourThree.getText()).toEqual('Trainer'); + expect(await SelectedJourneyBubbleFiveOne.getText()).toEqual('Fitness and'); + expect(await SelectedJourneyBubbleFiveTwo.getText()).toEqual('Wellness'); + expect(await SelectedJourneyBubbleFiveThree.getText()).toEqual('Coordinators'); + expect(await SavedJourneyTitleTwo.getText()).toEqual('8 to Airfield Operations Specialists through College'); + expect(await SavedJourneyTitleThree.getText()).toEqual('10 to Computer and Information Systems Managers through Computer Security Graduate Certificate'); + expect(await SavedJourneyTitleFour.getText()).toEqual('2 to Natural Sciences Managers through Geology M.A.T./M.S.T.'); + await SavedJourneyTitleOne.click().then(function() { + browser.sleep(5000); + }); + expect(await SelectedJourneyTitle.getText()).toEqual('11 to Fitness and Wellness Coordinators through M.U.R.P.'); + expect(await SelectedJourneySubTitle.getText()).toEqual('11'); + expect(await SelectedJourneySubText.getText()).toEqual('Try these resources'); + await JourneysGreeting.getText().then(async function(actualText) { + if(actualText.indexOf('Qa_Automated') !== -1) { + expect(await SelectedJourneyResourceTitleOne.getText()).toEqual('This is CNN'); + expect(await SelectedJourneyResourceTypeOne.getText()).toEqual('Type:'); + expect(await SelectedJourneyResourceTitleTwo.getText()).toEqual('just juan testing'); + expect(await SelectedJourneyResourceTypeTwo.getText()).toEqual('Type:'); + expect(await SelectedJourneyResourceTitleThree.getText()).toEqual('fdg'); + expect(await SelectedJourneyResourceTypeThree.getText()).toEqual('Type:'); + expect(await SelectedJourneyResourceTitleFour.getText()).toEqual('cnn'); + expect(await SelectedJourneyResourceTypeFour.getText()).toEqual('Type:'); + } else { + expect(await SelectedJourneyResourceNone.getText()).toEqual('Sorry, no related resources!'); + } + }); + await SelectedJourneyRightArrow.click().then(function() { + browser.sleep(2500); + }); + expect(await SelectedJourneySubTitle.getText()).toEqual('12'); + expect(await SelectedJourneySubText.getText()).toEqual('Try these resources'); + await JourneysGreeting.getText().then(async function(actualText) { + if(actualText.indexOf('Qa_Automated') !== -1) { + expect(await SelectedJourneyResourceTitleOne.getText()).toEqual('cnn'); + expect(await SelectedJourneyResourceTypeOne.getText()).toEqual('Type:'); + } else { + expect(await SelectedJourneyResourceNone.getText()).toEqual('Sorry, no related resources!'); + } + }); + await SelectedJourneyRightArrow.click().then(function() { + browser.sleep(2500); + }); + expect(await SelectedJourneySubTitle.getText()).toEqual('M.U.R.P.'); + expect(await SelectedJourneySubText.getText()).toEqual('Try these resources'); + expect(await SelectedJourneyResourceNone.getText()).toEqual('Sorry, no related resources!'); + await SelectedJourneyRightArrow.click().then(function() { + browser.sleep(2500); + }); + expect(await SelectedJourneySubTitle.getText()).toEqual('Personal Fitness Trainer'); + expect(await SelectedJourneySubText.getText()).toEqual('Try these resources'); + expect(await SelectedJourneyResourceNone.getText()).toEqual('Sorry, no related resources!'); + await SelectedJourneyRightArrow.click().then(function() { + browser.sleep(2500); + }); + expect(await SelectedJourneySubTitle.getText()).toEqual('Fitness and Wellness Coordinators'); + expect(await SelectedJourneySubText.getText()).toEqual('Try these resources'); + await JourneysGreeting.getText().then(async function(actualText) { + if(actualText.indexOf('Qa_Automated') !== -1) { + expect(await SelectedJourneyResourceTitleOne.getText()).toEqual('Fitness and Wellness Coordinators (Education and Training)'); + expect(await SelectedJourneyResourceTypeOne.getText()).toEqual('Type: HTML'); + expect(await SelectedJourneyResourceTitleTwo.getText()).toEqual('test'); + expect(await SelectedJourneyResourceTypeTwo.getText()).toEqual('Type:'); + expect(await SelectedJourneyResourceTitleThree.getText()).toEqual('222'); + expect(await SelectedJourneyResourceTypeThree.getText()).toEqual('Type:'); + } else { + expect(await SelectedJourneyResourceTitleOne.getText()).toEqual('Fitness and Wellness Coordinators (Education and Training)'); + expect(await SelectedJourneyResourceTypeOne.getText()).toEqual('Type: HTML'); + } + }); + await SelectedJourneyRightArrow.click().then(function() { + browser.sleep(2500); + }); + expect(await JourneyLearnMoreSubTitle.getText()).toEqual('Try these resources'); + await ViewOnMapButton.click().then(function() { + browser.sleep(5000); + }); + expect(await JourneyViewOnMapTitle.getText()).toEqual('Journey View'); + expect(await JourneyTitleOnMap.getText()).toEqual('11 to Fitness and Wellness Coordinators through M.U.R.P.'); + expect(await EditJourneyLinkText.getText()).toEqual('Edit Journey'); + expect(await JourneyClusterOne.getText()).toEqual('HS'); + expect(await JourneyPathwayOne.getText()).toEqual('11'); + expect(await JourneyClusterTwo.getText()).toEqual('HS'); + expect(await JourneyPathwayTwo.getText()).toEqual('12'); + expect(await JourneyClusterThree.getText()).toEqual('Public Administration'); + expect(await JourneyPathwayThree.getText()).toEqual('M.U.R.P.'); + expect(await JourneyClusterFour.getText()).toEqual('International Fitness Professional Association'); + expect(await JourneyPathwayFour.getText()).toEqual('Personal Fitness Trainer'); + expect(await JourneyClusterFive.getText()).toEqual('Administration & Admin Support'); + expect(await JourneyPathwayFive.getText()).toEqual('Fitness and Wellness Coordinators'); + await MyJourneysHeaderLink.click().then(function() { + browser.sleep(5000); + }); + await SavedJourneyTitleOne.click().then(function() { + browser.sleep(5000); + }); + await HowAmIDoingButton.click().then(function() { + browser.sleep(5000); + }); + expect(await DIVTitle.getText()).toEqual('Oops!'); + expect(await DIVSubTitle.getText()).toEqual("Sorry, we can't give you a quiz for this."); + await DIVOKButton.click().then(function() { + browser.sleep(2500); + }); + await RemoveJourneyButton.click().then(function() { + browser.sleep(2500); + }); + expect(await DIVTitle.getText()).toEqual('Are you sure?'); + expect(await DIVSubTitle.getText()).toEqual('You will not be able to recover this journey!'); + await DIVCancelButton.click().then(function() { + browser.sleep(2500); + }); + expect(await SelectedJourneyTitle.getText()).toEqual('11 to Fitness and Wellness Coordinators through M.U.R.P.'); + browser.waitForAngular(); + browser.getCurrentUrl(); + }); +} + +function SignOut() { + it(': SignOut, should log out of journeysmap', async function () { + var ProfileImage = element(by.css('.roundCenterBackgroundImage')); + var SignOutButton = element(by.css('.dropDownFAEdits:nth-child(5) > .btn')); + + browser.waitForAngular(); + browser.sleep(1000); + await ProfileImage.click(); + browser.sleep(1000); + browser.waitForAngular(); + browser.getCurrentUrl(); + await SignOutButton.click().then(function() { + browser.sleep(2500); + }); + }); +} \ No newline at end of file