diff --git a/app_journeysmap_spec.js b/app_journeysmap_spec.js index eaf5259..a960c4c 100644 --- a/app_journeysmap_spec.js +++ b/app_journeysmap_spec.js @@ -45,7 +45,7 @@ describe('Journeysmap script', function () { }); } - /*<<<>>> + //<<<>>> ProfileWidget(); MyProgressWidget(); @@ -94,11 +94,12 @@ describe('Journeysmap script', function () { MapInteraction(); //<<<>>> - //MyActivityJourneys*/ + //MyActivityJourneys + MyActivityJourneys(); SurveyMetrics(); InstitutionMetrics(); InstitutionsOfInterest(); - /*OccupationMetrics(); + OccupationMetrics(); OccupationsOfInterest(); //<<<>>> @@ -3319,11 +3320,92 @@ function MapInteraction() { }); } -function SurveyMetrics() { - it('should navigate to My Activity Dashboard and interact with Survey Metrics widget and validate data of 07/30/2019', async function () { +function MyActivityJourneys() { + it('should scroll to My Journeys widget on dashboard select 4th journey, view, then validate journey', async function () { var DashboardHeaderLink = element(by.css('.ng-scope:nth-child(1) > a > .span-navbar-hover')); var MyDashboardLink = element(by.linkText('My Dashboards')); var MyActivityLink = element(by.linkText('My Activity')); + var WidgetTitle = element(by.css('#myjourneys > .jrnys_lead-body-copy > span:nth-child(1)')); + var ViewAllLink = element(by.css('.hover-color:nth-child(3)')); + var MySavedJourneysTitle = element(by.css('.jrnys_lead-body-copy')); + var ViewOnMapText = element(by.css('.col-md-10 .ng-scope:nth-child(1)')); + var MySavedJourneyOne = element(by.css('#ee7b663d-2f15-43cc-867c-556c7fc493a5 .cursorPointer')); + var MySavedJourneyTwo = element(by.css('#\\30 ac99d25-0cc4-4d8e-b8e4-785f8129d85e .cursorPointer')); + var MySavedJourneyThree = element(by.css('#e0049880-9613-4fd5-9ed2-eb468cdc2e55 .cursorPointer')); + var MySavedJournyeFour = element(by.css('#\\30 9731631-9cb7-449b-8a51-58d7e730e31b .cursorPointer')); + var JourneyTitleOne = element(by.css('.borderTop .jrnys_body-copy')); + var JourneyLearnMoreLinkOne = element(by.css('.borderTop > #appendHere > .jrnys_support-text')); + var JourneyLearnMoreTitle = element(by.css('.col-md-12 > .ng-binding')); + var BackLink = element(by.css('.btn-primary-back-mod')); + var JourneyProgressStepsOne = element(by.css('.borderTop')); + var JourneyTitleTwo = element(by.css('#appendHere > div.journeyListWidgetDisabled.ng-hide')); + var JourneyLearnMoreLinkTwo = element(by.css('.hideSmallRange #appendHere > .jrnys_support-text')); + var JourneyProgressStepsTwo = element(by.css('.hideSmallRange > div')); + var JourneyTitleThree = element(by.css('#appendHere > div.jrnys_body-copy.ellipsis-on-desktop-sm-view.ng-binding')); + var JourneyLearnMoreLinkThree = element(by.css('.hideMidRange #appendHere > .jrnys_support-text')); + var JourneyProgressStepsThree = element(by.css('.hideMidRange > div')); + var JourneyTitleFour = element(by.css('#appendHere > div.jrnys_body-copy.ellipsis-on-desktop-sm-view.ng-binding')); + var JourneyLearnMoreLinkFour = element(by.css('.journeyListWidgetJourneyContainer:nth-child(4) #appendHere > .jrnys_support-text')); + var JourneyProgressStepsFour = element(by.css('.journeyListWidgetJourneyContainer:nth-child(4) > div')); + var CreateAJourneyButton = element(by.css('.text-right > .btn')); + + await DashboardHeaderLink.click().then(function() { + browser.sleep(10000); + }); + browser.actions().mouseMove(element(by.css('.dashTitleBlock > .jrnys_lead-body-copy'))).perform().then(function() { + browser.sleep(1500); + }); + await MyDashboardLink.click().then(function() { + browser.sleep(1500); + }); + browser.actions().mouseMove(element(by.css('.dashboard-menu > .dropDownFAEdits:nth-child(3) > a'))).perform().then(function() { + browser.sleep(1000); + }); + await MyActivityLink.click().then(function() { + browser.sleep(5000); + }); + expect(await WidgetTitle.getText()).toEqual('My Journeys'); + await ViewAllLink.click().then(function() { + browser.sleep(5000); + }); + expect(await MySavedJourneysTitle.getText()).toEqual('My Saved Journeys'); + expect(await ViewOnMapText.getText()).toEqual('Select a Journey to show it on the map'); + expect(await MySavedJourneyOne.getText()).toEqual('11 to Fitness and Wellness Coordinators through M.U.R.P.'); + expect(await MySavedJourneyTwo.getText()).toEqual('8 to Airfield Operations Specialists through College'); + expect(await MySavedJourneyThree.getText()).toEqual('10 to Computer and Information Systems Managers through Computer Security Graduate Certificate'); + expect(await MySavedJournyeFour.getText()).toEqual('2 to Natural Sciences Managers through Geology M.A.T./M.S.T.'); + await BackLink.click().then(function() { + browser.sleep(5000); + }); + expect(await JourneyTitleOne.getText()).toEqual('11 to Fitness and Wellness Coordinators through M.U.R.P.'); + await JourneyLearnMoreLinkOne.click().then(function() { + browser.sleep(5000); + }); + expect(await JourneyLearnMoreTitle.getText()).toEqual('11 to Fitness and Wellness Coordinators through M.U.R.P.'); + await BackLink.click().then(function() { + browser.sleep(5000); + }); + expect(await JourneyProgressStepsOne.getText()).toContain('4 steps (0 Complete)'); + //expect(await JourneyTitleTwo.getText()).toEqual(''); + expect(await JourneyLearnMoreLinkTwo.getText()).toEqual('Learn More'); + expect(await JourneyProgressStepsTwo.getText()).toContain('7 steps (0 Complete)'); + //expect(await JourneyTitleThree.getText()).toEqual(''); + expect(await JourneyLearnMoreLinkThree.getText()).toEqual('Learn More'); + expect(await JourneyProgressStepsThree.getText()).toContain('5 steps (0 Complete)'); + //expect(await JourneyTitleFour.getText()).toEqual(''); + expect(await JourneyLearnMoreLinkFour.getText()).toEqual('Learn More'); + expect(await JourneyProgressStepsFour.getText()).toContain('13 steps (0 Complete)'); + browser.executeScript('window.scrollTo(0, 235);').then(function() { + browser.sleep(1000); + }); + expect(await CreateAJourneyButton.getText()).toContain('Create a Journey'); + browser.waitForAngular(); + browser.getCurrentUrl(); + }); +} + +function SurveyMetrics() { + it('should navigate to My Activity Dashboard and interact with Survey Metrics widget and validate data of 07/30/2019', async function () { var SurveyMetricsTitle = element(by.css('.widget-round-corners:nth-child(2) .fullHeight > .jrnys_lead-body-copy')); var MostRecentResultsTitle = element(by.css('.inner-content-padding:nth-child(1) > .col-sm-4')); var MostRecentResultsStat = element(by.css('.inner-content-padding:nth-child(1) > .col-sm-9')); @@ -3356,19 +3438,9 @@ function SurveyMetrics() { var SurveyResultsDivConventionalReadMore = element(by.css('.text-center:nth-child(6) > .text-color-7a')); var SurveyResultsReadMoreXCloseLink = element(by.css('.close > .fa')); - await DashboardHeaderLink.click().then(function() { - browser.sleep(10000); + browser.executeScript('window.scrollTo(0, 0);').then(function() { + browser.sleep(2500); }); - browser.actions().mouseMove(element(by.css('.dashTitleBlock > .jrnys_lead-body-copy'))).perform().then(function() { - browser.sleep(1500); - }); - await MyDashboardLink.click(); - browser.sleep(1500); - browser.actions().mouseMove(element(by.css('.dashboard-menu > .dropDownFAEdits:nth-child(3) > a'))).perform().then(function() { - browser.sleep(1000); - }); - await MyActivityLink.click(); - browser.sleep(5000); expect(await SurveyMetricsTitle.getText()).toEqual('Survey Metrics View All'); expect(await MostRecentResultsTitle.getText()).toEqual('Most Recent Result'); expect(await MostRecentResultsStat.getText()).toEqual('Enterprising, Investigative, and Conventional');