From dc4afc5fc5bdde78466450ff4b03d3ef661570c6 Mon Sep 17 00:00:00 2001 From: Juan Huerta Date: Tue, 26 Apr 2022 11:20:30 -0700 Subject: [PATCH] Updated due to UI changes --- exActDashboard_config.js | 36 ++ exActDashboard_spec.js | 395 +++++++++++++++++ exActReport_config.js | 36 ++ exActReport_spec.js | 496 +++++++++++++++++++++ exactLandingPage_config.js | 4 +- exactLandingPage_spec.js | 49 ++- myContentWidget_config.js | 36 ++ myContentWidget_spec.js | 864 +++++++++++++++++++++++++++++++++++++ 8 files changed, 1908 insertions(+), 8 deletions(-) create mode 100644 exActDashboard_config.js create mode 100644 exActDashboard_spec.js create mode 100644 exActReport_config.js create mode 100644 exActReport_spec.js create mode 100644 myContentWidget_config.js create mode 100644 myContentWidget_spec.js diff --git a/exActDashboard_config.js b/exActDashboard_config.js new file mode 100644 index 0000000..f3533a8 --- /dev/null +++ b/exActDashboard_config.js @@ -0,0 +1,36 @@ +//exActDashboard_config.js + +exports.config = { + framework: 'jasmine', + seleniumAddress: 'http://localhost:4444/wd/hub', + specs: ['exActDashboard_spec.js'], + + jasmineNodeOpts: { + defaultTimeoutInterval: 360000 + }, + + capabilities: { + browserName: 'chrome' + }, + + onPrepare: function() { + browser.waitForAngularEnabled(false); + browser.sleep(2500); + browser.driver.manage().window().maximize(); + }, + + params: { + login: 'http://stage.edgate.com/exact/login.php' //QA + //login: 'https://correlation.edgate.com/exact/login.php' //PROD + } + + /*multiCapabilities: [{ + browserName: 'chrome' + }, { + browserName: 'firefox' + }]/*, { + browserName: 'internet explorer' + }], { + browserName: 'safari' + }]*/ +} \ No newline at end of file diff --git a/exActDashboard_spec.js b/exActDashboard_spec.js new file mode 100644 index 0000000..288d273 --- /dev/null +++ b/exActDashboard_spec.js @@ -0,0 +1,395 @@ +//exActDashboard_spec.js + +describe('ExACT Dashboard script', function () { + //login-ExACT landing page + var UserNameTextBox = element(by.name('username')); + var PasswordTextBox = element(by.name('password')); + + //Open browser + browser.get(browser.params.login); + + it('should have a title', async function () { + await expect(browser.getTitle()).toEqual('ExACT Login'); + }); + + //Sign In + ExACT(UserNameTextBox, PasswordTextBox); + + it('should have a title', async function () { + await expect(browser.getTitle()).toEqual('ExACT'); + }); + + function ExACT(UserNameTextBox, PasswordTextBox) { + it('ExACT, log in.', async function () { + var EC = protractor.ExpectedConditions; + var LoginButton = element(by.css('.btn')); + var EdGateLogo = element(by.css('p > img')); + var CopyrightText = element(by.css('#footer-branding > p:nth-child(2)')); + var CorrelationCoverageDonutChart = element(by.css('#gcanvas')); + + browser.wait(EC.visibilityOf(EdGateLogo), 30000).then(function() { + browser.sleep(2500); + }); + expect(EdGateLogo.isPresent()).toBe(true); + expect(await CopyrightText.getText()).toEqual('© Copyright 2021 EdGate Correlation Services'); + await browser.driver.getCurrentUrl().then(async function(actualURL) { + if(actualURL.indexOf('http://stage.edgate.com/exact/login.php') !== -1) { + await UserNameTextBox.sendKeys('exact_juan').then(function() { + browser.sleep(1500); + }); + await PasswordTextBox.sendKeys('ex123456').then(function() { + browser.sleep(1500); + }); + } else { + await UserNameTextBox.sendKeys('exact_admin').then(function() { + browser.sleep(1500); + }); + await PasswordTextBox.sendKeys('exadmin12').then(function() { + browser.sleep(1500); + }); + } + }); + await LoginButton.click().then(function() { + browser.sleep(2500); + }); + browser.wait(EC.visibilityOf(CorrelationCoverageDonutChart), 30000).then(function() { + browser.sleep(2500); + }); + expect(CorrelationCoverageDonutChart.isPresent()).toBe(true); + }); + } + + //Dashboard + Dashboard(); + MyContentWidget(); + MyStandardsWidget(); + CorrelationCoverageWidget(); + LatestStandardsUpdatesWidget(); + FavoriteReportsWidget(); + + //Sign Out*/ + SignOut(); +}); + +function Dashboard() { + it(': Dashboard, should verify ExACT dashboard.', async function () { + //Navigation Menu + var EC = protractor.ExpectedConditions; + var ExACTLogo = element(by.css('span:nth-child(2) > img')); + var IWantToHeader = element(by.css('h3')); + var DashboardMenuIcon = element(by.linkText('Dashboard')); + var AlignMenuIcon = element(by.linkText('Align')); + var UploadMenuIcon = element(by.linkText('Upload')); + var ReportMenuIcon = element(by.linkText('Report')); + var ApproveMenuIcon = element(by.linkText('Approve')); + var MenuBars = element(by.css('.fa-bars')); + var MiniExACTLogo = element(by.css('.sm-ver')); + var MiniDashboardMenuIcon = element(by.css('.fa-dashboard')); + var MiniAlignMenuIcon = element(by.css('.menu-left-first .fa-sitemap')); + var MiniUploadMenuIcon = element(by.css('.fa-upload')); + var MiniReportMenuIcon = element(by.css('.fa-table')); + var MiniApproveMenuIcon = element(by.css('.fa-wrench')); + var SearchIcon = element(by.css('.searchbar-icon > .fa')); + var SearchTextBox = element(by.css('.searchbar-input')); + var ExACTHelpIcon = element(by.css('.fa-question-circle')); + var UserIcon = element(by.css('.fa-user')); + var UserDropdown = element(by.css('#navbarDropdown > span')); + //Dashboard + var CorrelationDashboardHeader = element(by.css('h2')); + + //Navigation Menu + browser.wait(EC.visibilityOf(ExACTLogo), 30000).then(function() { + browser.sleep(2500); + }); + expect(ExACTLogo.isPresent()).toBe(true); + expect(await DashboardMenuIcon.getText()).toEqual('Dashboard'); + expect(await IWantToHeader.getText()).toEqual('I WANT TO'); + expect(await AlignMenuIcon.getText()).toEqual('Align'); + expect(await UploadMenuIcon.getText()).toEqual('Upload'); + expect(await ReportMenuIcon.getText()).toEqual('Report'); + expect(await ApproveMenuIcon.getText()).toEqual('Approve'); + await MenuBars.click().then(function() { + browser.sleep(2500); + }); + expect(MiniExACTLogo.isPresent()).toBe(true); + expect(MiniDashboardMenuIcon.isPresent()).toBe(true); + expect(MiniAlignMenuIcon.isPresent()).toBe(true); + expect(MiniUploadMenuIcon.isPresent()).toBe(true); + expect(MiniReportMenuIcon.isPresent()).toBe(true); + expect(MiniApproveMenuIcon.isPresent()).toBe(true); + await MenuBars.click().then(function() { + browser.sleep(2500); + }); + await SearchIcon.click().then(function() { + browser.sleep(2500); + }); + expect(await SearchTextBox.getAttribute('placeholder')).toEqual('Search...'); + expect(ExACTHelpIcon.isPresent()).toBe(true); + expect(UserIcon.isPresent()).toBe(true); + expect(await UserDropdown.getText()).toEqual('ExACT Admin'); + //Dashboard + expect(CorrelationDashboardHeader.getCssValue('color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await CorrelationDashboardHeader.getText()).toEqual('Correlation Dashboard'); + }); +} + +function MyContentWidget() { + it(': MyContentWidget, should verify widget default information.', async function () { + var MyContentWidgetTitle = element(by.css('.row:nth-child(2) > .col-lg-6:nth-child(1) .card-header')); + var BiologyHeader = element(by.css('.list-group-item:nth-child(1)')); + var BiologyCount = element(by.css('.list-group-item:nth-child(1) > .float-right')); + var English1Header = element(by.css('.list-group-item:nth-child(2)')); + var English1Count = element(by.css('.list-group-item:nth-child(2) > .float-right')); + var AlgebraHeader = element(by.css('.list-group-item:nth-child(3)')); + var AlgebraCount = element(by.css('.list-group-item:nth-child(3) > .float-right')); + var USHistoryHeader = element(by.css('.list-group-item:nth-child(4)')); + var USHistoryCount = element(by.css('.list-group-item:nth-child(4) > .float-right')); + var DemoUserSubmittedContentHeader = element(by.css('.list-group-item:nth-child(5)')); + var DemoUserSubmittedContentCount = element(by.css('.list-group-item:nth-child(5) > .float-right')); + var GeometryHeader = element(by.css('.list-group-item:nth-child(6)')); + var GeometryCount = element(by.css('.list-group-item:nth-child(6) > .float-right')); + + expect(await MyContentWidgetTitle.getText()).toEqual('My Content'); + expect(await BiologyHeader.getText()).toContain('Biology'); + expect(BiologyCount.getCssValue('background-color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await BiologyCount.getText()).toEqual('1045'); + expect(await English1Header.getText()).toContain('English I'); + expect(English1Count.getCssValue('background-color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await English1Count.getText()).toEqual('403'); + expect(await AlgebraHeader.getText()).toContain('Algebra'); + expect(AlgebraCount.getCssValue('background-color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await AlgebraCount.getText()).toEqual('183'); + expect(await USHistoryHeader.getText()).toContain('US History'); + expect(USHistoryCount.getCssValue('background-color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await USHistoryCount.getText()).toEqual('66'); + expect(await DemoUserSubmittedContentHeader.getText()).toContain('Demo - User Submitted Content'); + expect(DemoUserSubmittedContentCount.getCssValue('background-color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await DemoUserSubmittedContentCount.getText()).toEqual('16'); + expect(await GeometryHeader.getText()).toContain('Geometry'); + expect(GeometryCount.getCssValue('background-color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await GeometryCount.getText()).toEqual('1'); + }); +} + +function MyStandardsWidget() { + it(': MyStandardsWidget, should verify widget default information.', async function () { + var MyStandardsTabTitle = element(by.css('#mystd-tab')); + var OtherAvailableStandardsTabTitle = element(by.css('#availstd-tab')); + var MyStandardsDropDown = element(by.css('#stdparent')); + var OrganizationColumnHeader = element(by.css('.table:nth-child(3) th:nth-child(1)')); + var MoreInfoColumnHeader = element(by.css('.table:nth-child(3) > thead .text-center:nth-child(2)')); + var ViewColumnHeader = element(by.css('thead .text-center:nth-child(3)')); + var AlabamaStandards = element(by.css('#stdbody > tr:nth-child(1) > td:nth-child(1)')); + var AlabamaMoreInfoIcon = element(by.css('#stdbody > tr:nth-child(1) .fa-info-circle')); + var AlabamaViewIcon = element(by.css('tr:nth-child(1) .fa-sitemap')); + var ArizonaStandards = element(by.css('#stdbody > tr:nth-child(2) > td:nth-child(1)')); + var ArizonaMoreInfoIcon = element(by.css('#stdbody > tr:nth-child(2) .fa-info-circle')); + var ArizonaViewIcon = element(by.css('tr:nth-child(2) .fa-sitemap')); + var CaliforniaStandards = element(by.css('#stdbody > tr:nth-child(3) > td:nth-child(1)')); + var CaliforniaMoreInfoIcon = element(by.css('#stdbody > tr:nth-child(3) .fa-info-circle')); + var CaliforniaViewIcon = element(by.css('tr:nth-child(3) .fa-sitemap')); + var FloridaStandards = element(by.css('#stdbody > tr:nth-child(4) > td:nth-child(1)')); + var FloridaMoreInfoIcon = element(by.css('#stdbody > tr:nth-child(4) .fa-info-circle')); + var FloridaViewIcon = element(by.css('tr:nth-child(4) .fa-sitemap')); + var NewYorkStandards = element(by.css('#stdbody > tr:nth-child(5) > td:nth-child(1)')); + var NewYorkMoreInfoIcon = element(by.css('#stdbody > tr:nth-child(5) .fa-info-circle')); + var NewYorkViewIcon = element(by.css('tr:nth-child(5) .fa-sitemap')); + var TexasTeksStandards = element(by.css('#stdbody > tr:nth-child(6) > td:nth-child(1)')); + var TexasTeksMoreInfoIcon = element(by.css('#stdbody > tr:nth-child(6) .fa-info-circle')); + var TexasTeksViewIcon = element(by.css('tr:nth-child(6) .fa-sitemap')); + var WashingtonStandards = element(by.css('#stdbody > tr:nth-child(7) > td:nth-child(1)')); + var WashingtonMoreInfoIcon = element(by.css('#stdbody > tr:nth-child(7) .fa-info-circle')); + var WashingtonViewIcon = element(by.css('tr:nth-child(7) .fa-sitemap')); + + expect(MyStandardsTabTitle.getCssValue('color')).toBe('rgba(42, 55, 118, 1)'); //dark blue + expect(await MyStandardsTabTitle.getText()).toEqual('My Standards'); + expect(OtherAvailableStandardsTabTitle.getCssValue('color')).toBe('rgba(182, 186, 181, 1)'); //dimmed + expect(await OtherAvailableStandardsTabTitle.getText()).toEqual('Other Available Standards'); + expect(await MyStandardsDropDown.getAttribute('value')).toEqual('154828031'); + expect(await OrganizationColumnHeader.getText()).toEqual('Organization'); + expect(await MoreInfoColumnHeader.getText()).toEqual('More Info'); + expect(await ViewColumnHeader.getText()).toEqual('View'); + expect(await AlabamaStandards.getText()).toEqual('Alabama Standards'); + expect(AlabamaMoreInfoIcon.getCssValue('color')).toBe('rgba(42, 55, 118, 1)'); //dark blue + expect(AlabamaViewIcon.getCssValue('color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await ArizonaStandards.getText()).toEqual('Arizona Standards'); + expect(ArizonaMoreInfoIcon.getCssValue('color')).toBe('rgba(42, 55, 118, 1)'); //dark blue + expect(ArizonaViewIcon.getCssValue('color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await CaliforniaStandards.getText()).toEqual('California Standards'); + expect(CaliforniaMoreInfoIcon.getCssValue('color')).toBe('rgba(42, 55, 118, 1)'); //dark blue + expect(CaliforniaViewIcon.getCssValue('color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await FloridaStandards.getText()).toEqual('Florida Standards'); + expect(FloridaMoreInfoIcon.getCssValue('color')).toBe('rgba(42, 55, 118, 1)'); //dark blue + expect(FloridaViewIcon.getCssValue('color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await NewYorkStandards.getText()).toEqual('New York Standards'); + expect(NewYorkMoreInfoIcon.getCssValue('color')).toBe('rgba(42, 55, 118, 1)'); //dark blue + expect(NewYorkViewIcon.getCssValue('color')).toBe('rgba(1, 160, 78, 1)'); //green + browser.actions().mouseMove(WashingtonStandards).perform().then(function() { + browser.sleep(2500); + }); + expect(await TexasTeksStandards.getText()).toEqual('Texas TEKS Standards'); + expect(TexasTeksMoreInfoIcon.getCssValue('color')).toBe('rgba(42, 55, 118, 1)'); //dark blue + expect(TexasTeksViewIcon.getCssValue('color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await WashingtonStandards.getText()).toEqual('Washington Standards'); + expect(WashingtonMoreInfoIcon.getCssValue('color')).toBe('rgba(42, 55, 118, 1)'); //dark blue + expect(WashingtonViewIcon.getCssValue('color')).toBe('rgba(1, 160, 78, 1)'); //green + }); +} + +function CorrelationCoverageWidget() { + it(': CorrelationCoverageWidget, should verify widget default information.', async function () { + var CorrelationCoverageWidgetTitle = element(by.css('.row:nth-child(3) > .col-lg-6:nth-child(1) .card-header')); + var CorrelationCoverageStandardDropDown = element(by.css('#stdgap')); + var CorrelationCoverageSubjectDropDown = element(by.css('#subgap')); + var CorrelationCoverageDonutChart = element(by.css('#gcanvas')); + var CorrelationCoverageSubText = element(by.css('p:nth-child(2)')); + var StandardsCoveredIcon = element(by.css('.list-group-item:nth-child(4)')); + var StandardsCoveredLabel = element(by.css('.list-group-item:nth-child(5)')); + var NotCoveredIcon = element(by.css('.list-group-item:nth-child(6)')); + var NotCoveredLabel = element(by.css('')); + var ViewDetailsLinkText = element(by.linkText('View Details')); + var ViewDetailsArrowIcon = element(by.css('.fa-arrow-circle-right')); + + browser.executeScript('window.scrollTo(0, 563);').then(function() { + browser.sleep(2500); + }); + expect(await CorrelationCoverageWidgetTitle.getText()).toEqual('Correlation Coverage'); + expect(await CorrelationCoverageStandardDropDown.getAttribute('value')).toEqual('19928');//changes + expect(await CorrelationCoverageSubjectDropDown.getAttribute('value')).toEqual('Mathematics');//changes + expect(await CorrelationCoverageSubText.getText()).toEqual('Click anywhere on the chart to see a coverage breakdown by grade.'); + expect(ViewDetailsLinkText.getCssValue('color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await ViewDetailsLinkText.getText()).toEqual('View Details'); + expect(ViewDetailsArrowIcon.isPresent()).toBe(true); + }); +} + +function LatestStandardsUpdatesWidget() { + it(': LatestStandardsUpdatesWidget, should verify widget default information.', async function () { + var LatestStandardsUpdatesWidgetWidgetTitle = element(by.css('.row:nth-child(3) > .col-lg-6:nth-child(2) .card-header')); + var LatestStandardsUpdatesWidgetSeeMoreButton = element(by.linkText('See More')); + var LatestStandardsUpdatesLogo = element(by.css('.float-right > img')); + var LatestStandardsTitleOne = element(by.css('.mb-4:nth-child(2) > b')); + var LatestStandardsDescriptionOne = element(by.css('.mb-4:nth-child(2)')); + var LatestStandardsDateOne = element(by.css('.mb-4:nth-child(2) .text-muted')); + var LatestStandardsTitleTwo = element(by.css('.mb-4:nth-child(3) > b')); + var LatestStandardsDescriptionTwo = element(by.css('.mb-4:nth-child(3)')); + var LatestStandardsDateTwo = element(by.css('.mb-4:nth-child(3) .text-muted')); + var LatestStandardsTitleThree = element(by.css('.mb-4:nth-child(4) > b')); + var LatestStandardsDescriptionThree = element(by.css('.mb-4:nth-child(4)')); + var LatestStandardsDateThree = element(by.css('.mb-4:nth-child(4) .text-muted')); + var LatestStandardsTitleFour = element(by.css('.mb-4:nth-child(5) > b')); + var LatestStandardsDescriptionFour = element(by.css('.mb-4:nth-child(5)')); + var LatestStandardsDateFour = element(by.css('.mb-4:nth-child(5) .text-muted')); + var LatestStandardsTitleFive = element(by.css('.mb-4:nth-child(6) > b')); + var LatestStandardsDescriptionFive = element(by.css('.mb-4:nth-child(6)')); + var LatestStandardsDateFive = element(by.css('.mb-4:nth-child(6) .text-muted')); + + expect(await LatestStandardsUpdatesWidgetWidgetTitle.getText()).toContain('Latest Standards Updates'); + expect(LatestStandardsUpdatesWidgetSeeMoreButton.getCssValue('background-color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await LatestStandardsUpdatesWidgetSeeMoreButton.getText()).toContain('See More'); + expect(LatestStandardsUpdatesLogo.isPresent()).toBe(true); + expect(await LatestStandardsTitleOne.getText()).toContain('Florida Standards - Language Arts'); + expect(await LatestStandardsDescriptionOne.getText()).toContain('New adoption for Fall 2021 - test'); + expect(LatestStandardsDateOne.getCssValue('color')).toBe('rgba(108, 117, 125, 1)'); //dimmed + expect(await LatestStandardsDateOne.getText()).toEqual('March 20, 2021'); + expect(await LatestStandardsTitleTwo.getText()).toEqual('Alabama Standards - Mathematics'); + expect(await LatestStandardsDescriptionTwo.getText()).toContain('Alabama Standards - Mathematics'); + expect(LatestStandardsDateTwo.getCssValue('color')).toBe('rgba(108, 117, 125, 1)'); //dimmed + expect(await LatestStandardsDateTwo.getText()).toEqual('May 1, 2019'); + expect(await LatestStandardsTitleThree.getText()).toEqual('Alabama Standards - All'); + expect(await LatestStandardsDescriptionThree.getText()).toContain('Alabama Standards - All'); + expect(LatestStandardsDateThree.getCssValue('color')).toBe('rgba(108, 117, 125, 1)'); //dimmed + expect(await LatestStandardsDateThree.getText()).toEqual('January 1, 2019'); + expect(await LatestStandardsTitleFour.getText()).toEqual('Arkansas Standards - all'); + expect(await LatestStandardsDescriptionFour.getText()).toContain('Arkansas Standards - all'); + expect(LatestStandardsDateFour.getCssValue('color')).toBe('rgba(108, 117, 125, 1)'); //dimmed + expect(await LatestStandardsDateFour.getText()).toEqual('August 12, 2018'); + expect(await LatestStandardsTitleFive.getText()).toEqual('Montana Standards - Science'); + expect(await LatestStandardsDescriptionFive.getText()).toContain('Montana Standards - Science'); + expect(LatestStandardsDateFive.getCssValue('color')).toBe('rgba(108, 117, 125, 1)'); //dimmed + expect(await LatestStandardsDateFive.getText()).toEqual('August 9, 2018'); + }); +} + +function FavoriteReportsWidget() { + it(': FavoriteReportsWidget, should verify widget default information.', async function () { + var FavoriteReportsWidgetTitle = element(by.css('.col-lg-12 .card-header')); + var FavoriteReportsManageFavoritesButton = element(by.linkText('Manage Favorites')); + var FavoriteReportsFormatColumnHeader = element(by.css('.table:nth-child(1) > thead th:nth-child(1)')); + var FavoriteReportsReportColumnHeader = element(by.css('.table:nth-child(1) > thead th:nth-child(2)')); + var FavoriteReportsRunColumnHeader = element(by.css('.table:nth-child(1) th:nth-child(3)')); + var FavoriteReportsDownloadColumnHeader = element(by.css('thead .text-center:nth-child(4)')); + var FavoriteReportsFormatButtonOne = element(by.css('tr:nth-child(1) > td:nth-child(1) > .badge')); + var FavoriteReportsReportHandleOne = element(by.css('.table:nth-child(1) tr:nth-child(1) > td:nth-child(2)')); + var FavoriteReportsRunIconOne = element(by.css('tr:nth-child(1) .reportrun > .fa')); + var FavoriteReportsDownloadIconOne = element(by.css('tr:nth-child(1) > .text-center > .fa')); + var FavoriteReportsFormatButtonTwo = element(by.css('tr:nth-child(2) > td:nth-child(1) > .badge')); + var FavoriteReportsReportHandleTwo = element(by.css('.table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(2) > td:nth-child(2)')); + var FavoriteReportsRunIconTwo = element(by.css('tr:nth-child(2) .reportrun > .fa')); + var FavoriteReportsDownloadIconTwo = element(by.css('tr:nth-child(2) > .text-center > .fa')); + var FavoriteReportsFormatButtonThree = element(by.css('tr:nth-child(3) > td:nth-child(1) > .badge')); + var FavoriteReportsReportHandleThree = element(by.css('.table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(3) > td:nth-child(2)')); + var FavoriteReportsRunIconThree = element(by.css('tr:nth-child(3) .reportrun > .fa')); + var FavoriteReportsDownloadIconThree = element(by.css('.report-icon-download')); + var EdGateLogo = element(by.css('.pull-right img')); + + browser.executeScript('window.scrollTo(0, document.body.scrollHeight);').then(function() { + browser.sleep(2500); + }); + expect(await FavoriteReportsWidgetTitle.getText()).toContain('Favorite Reports'); + expect(FavoriteReportsManageFavoritesButton.getCssValue('background-color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await FavoriteReportsManageFavoritesButton.getText()).toContain('Manage Favorites'); + expect(await FavoriteReportsFormatColumnHeader.getText()).toEqual('Format'); + expect(await FavoriteReportsReportColumnHeader.getText()).toEqual('Report'); + expect(await FavoriteReportsRunColumnHeader.getText()).toEqual('Run'); + expect(await FavoriteReportsDownloadColumnHeader.getText()).toEqual('Download'); + expect(FavoriteReportsFormatButtonOne.getCssValue('background-color')).toBe('rgba(25, 91, 192, 1)'); //blue + expect(await FavoriteReportsFormatButtonOne.getText()).toEqual('doc'); + expect(await FavoriteReportsReportHandleOne.getText()).toEqual('Social Studies'); + expect(FavoriteReportsRunIconOne.getCssValue('color')).toBe('rgba(40, 167, 69, 1)'); //green + expect(FavoriteReportsRunIconOne.isPresent()).toBe(true); + expect(FavoriteReportsDownloadIconOne.getCssValue('color')).toBe('rgba(204, 204, 204, 1)'); //dimmed + expect(FavoriteReportsDownloadIconOne.isPresent()).toBe(true); + expect(FavoriteReportsFormatButtonTwo.getCssValue('background-color')).toBe('rgba(0, 0, 0, 1)'); //black + expect(await FavoriteReportsFormatButtonTwo.getText()).toEqual('html'); + expect(await FavoriteReportsReportHandleTwo.getText()).toEqual('Second Test'); + expect(FavoriteReportsRunIconTwo.getCssValue('color')).toBe('rgba(40, 167, 69, 1)'); //green + expect(FavoriteReportsRunIconTwo.isPresent()).toBe(true); + expect(FavoriteReportsDownloadIconTwo.getCssValue('color')).toBe('rgba(204, 204, 204, 1)'); //dimmed + expect(FavoriteReportsDownloadIconTwo.isPresent()).toBe(true); + expect(FavoriteReportsFormatButtonThree.getCssValue('background-color')).toBe('rgba(29, 111, 66, 1)'); //green + expect(await FavoriteReportsFormatButtonThree.getText()).toEqual('xls'); + expect(await FavoriteReportsReportHandleThree.getText()).toEqual('FirstQueuedReport'); + expect(FavoriteReportsRunIconThree.getCssValue('color')).toBe('rgba(40, 167, 69, 1)'); //green + expect(FavoriteReportsRunIconThree.isPresent()).toBe(true); + expect(FavoriteReportsDownloadIconThree.getCssValue('color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(FavoriteReportsDownloadIconThree.isPresent()).toBe(true); + expect(EdGateLogo.isPresent()).toBe(true); + }); +} + +function SignOut() { + it(': SignOut, should log out of ExACT.', async function () { + var ProfileImage = element(by.css('#navbarDropdown > span')); + var LogOutLinkText = element(by.linkText('Log Out')); + var EC = protractor.ExpectedConditions; + var ExACTLogo = element(by.css('#formLogin > img')); + + browser.executeScript('window.scrollTo(0, 0);').then(function() { + browser.sleep(10000); + }); + await ProfileImage.click().then(function() { + browser.sleep(2500); + }); + browser.actions().mouseMove(LogOutLinkText).perform().then(function() { + browser.sleep(2500); + }); + await LogOutLinkText.click().then(function() { + browser.sleep(2500); + }); + browser.wait(EC.visibilityOf(ExACTLogo), 30000).then(function() { + browser.sleep(2500); + }); + expect(ExACTLogo.isPresent()).toBe(true); + }); +} \ No newline at end of file diff --git a/exActReport_config.js b/exActReport_config.js new file mode 100644 index 0000000..ab8b48b --- /dev/null +++ b/exActReport_config.js @@ -0,0 +1,36 @@ +//exActReport_config.js + +exports.config = { + framework: 'jasmine', + seleniumAddress: 'http://localhost:4444/wd/hub', + specs: ['exActReport_spec.js'], + + jasmineNodeOpts: { + defaultTimeoutInterval: 360000 + }, + + capabilities: { + browserName: 'chrome' + }, + + onPrepare: function() { + browser.waitForAngularEnabled(false); + browser.sleep(2500); + browser.driver.manage().window().maximize(); + }, + + params: { + login: 'http://stage.edgate.com/exact/login.php' //QA + //login: 'https://correlation.edgate.com/exact/login.php' //PROD + } + + /*multiCapabilities: [{ + browserName: 'chrome' + }, { + browserName: 'firefox' + }]/*, { + browserName: 'internet explorer' + }], { + browserName: 'safari' + }]*/ +} \ No newline at end of file diff --git a/exActReport_spec.js b/exActReport_spec.js new file mode 100644 index 0000000..08725fc --- /dev/null +++ b/exActReport_spec.js @@ -0,0 +1,496 @@ +//exActReport_spec.js + +describe('ExACT Report script', function () { + //login-ExACT landing page + var UserNameTextBox = element(by.name('username')); + var PasswordTextBox = element(by.name('password')); + + //Open browser + browser.get(browser.params.login); + + it('should have a title', async function () { + await expect(browser.getTitle()).toEqual('ExACT Login'); + }); + + //Sign In + ExACT(UserNameTextBox, PasswordTextBox); + + it('should have a title', async function () { + await expect(browser.getTitle()).toEqual('ExACT'); + }); + + function ExACT(UserNameTextBox, PasswordTextBox) { + it('ExACT, log in.', async function () { + var EC = protractor.ExpectedConditions; + var LoginButton = element(by.css('.btn')); + var EdGateLogo = element(by.css('p > img')); + var CopyrightText = element(by.css('#footer-branding > p:nth-child(2)')); + var CorrelationCoverageDonutChart = element(by.css('#gcanvas')); + var CorrelationCoverageSubText = element(by.css('p:nth-child(2)')); + + browser.wait(EC.visibilityOf(EdGateLogo), 30000).then(function() { + browser.sleep(2500); + }); + expect(EdGateLogo.isPresent()).toBe(true); + expect(await CopyrightText.getText()).toEqual('© Copyright 2021 EdGate Correlation Services'); + await browser.driver.getCurrentUrl().then(async function(actualURL) { + if(actualURL.indexOf('http://stage.edgate.com/exact/login.php') !== -1) { + await UserNameTextBox.sendKeys('exact_juan').then(function() { + browser.sleep(1500); + }); + await PasswordTextBox.sendKeys('ex123456').then(function() { + browser.sleep(1500); + }); + } else { + await UserNameTextBox.sendKeys('exact_admin').then(function() { + browser.sleep(1500); + }); + await PasswordTextBox.sendKeys('exadmin12').then(function() { + browser.sleep(1500); + }); + } + }); + await LoginButton.click().then(function() { + browser.sleep(2500); + }); + /*browser.wait(EC.visibilityOf(CorrelationCoverageSubText), 30000).then(function() { + browser.sleep(2500); + });*/ + }); + } + + //Dashboard + Report(); + ReportPage(); + + //Sign Out*/ + SignOut(); +}); + +function Report() { + it(': Report, should verify Report page.', async function () { + //Navigation Menu + var EC = protractor.ExpectedConditions; + var ExACTLogo = element(by.css('span:nth-child(2) > img')); + var IWantToHeader = element(by.css('h3')); + var DashboardMenuIcon = element(by.linkText('Dashboard')); + var AlignMenuIcon = element(by.linkText('Align')); + var UploadMenuIcon = element(by.linkText('Upload')); + var ReportMenuIcon = element(by.linkText('Report')); + var ApproveMenuIcon = element(by.linkText('Approve')); + //Report Page + var ReportPageTitle = element(by.css('h2')); + + //Navigation Menu + browser.wait(EC.visibilityOf(ExACTLogo), 30000).then(function() { + browser.sleep(2500); + }); + expect(ExACTLogo.isPresent()).toBe(true); + expect(await DashboardMenuIcon.getText()).toEqual('Dashboard'); + expect(await IWantToHeader.getText()).toEqual('I WANT TO'); + expect(await AlignMenuIcon.getText()).toEqual('Align'); + expect(await UploadMenuIcon.getText()).toEqual('Upload'); + expect(await ReportMenuIcon.getText()).toEqual('Report'); + expect(await ApproveMenuIcon.getText()).toEqual('Approve'); + await ReportMenuIcon.click().then(function() { + browser.sleep(2500); + }); + browser.wait(EC.visibilityOf(ReportPageTitle), 30000).then(function() { + browser.sleep(2500); + }); + }); +} + +function ReportPage() { + it(': MyContentWidget, should verify widget default information.', async function () { + var ExACTLogo = element(by.css('span:nth-child(2) > img')); + var IWantToHeader = element(by.css('h3')); + var DashboardMenuIcon = element(by.linkText('Dashboard')); + var AlignMenuIcon = element(by.linkText('Align')); + var UploadMenuIcon = element(by.linkText('Upload')); + var ReportMenuIcon = element(by.linkText('Report')); + var ApproveMenuIcon = element(by.linkText('Approve')); + //Report Page Title + var ReportPageTitle = element(by.css('h2')); + //Report + var BuildYourReportHeaderButton = element(by.linkText('Build your report')); + var ViewQueuedReportsHeaderButton = element(by.linkText('View queued reports')); + //Report Type Breadcrumbs + var ReportTypeBreadcrumb = element(by.css('#crumb-rept')); + var MainCriteriaBreadcrumb = element(by.css('#crumb-main')); + var SubjectsBreadcrumb = element(by.css('#crumb-subjects')); + var GradesBreadcrumb = element(by.css('#crumb-grades')); + var CorrelationsBreadcrumb = element(by.css('#crumb-correlation')); + var OptionsBreadcrumb = element(by.css('#crumb-options')); + //Report Type + var ReportTypeTitle = element(by.css('#card-rept-head > .btn')); + var ContentReportsHeader = element(by.xpath('//*[@id="reporttype"]/optgroup[1]')); + var BasicContentReportLabel = element(by.css('optgroup:nth-child(1)')); + var StandardsReportsHeader = element(by.css('#reporttype > optgroup:nth-child(2)')); + var BasicStandardsReportLabel = element(by.css('optgroup:nth-child(2)')); + var EC = protractor.ExpectedConditions; + //Main Criteria + var MainCriteriaTitle = element(by.css('#card-main-head > .btn')); + var MainCriteriaSubtext = element(by.css('.text-instruct')); + var MainCriteriaSubjectList = element(by.css('#maincrit')); + //Subjects + var SubjectsTitle = element(by.css('#card-subjects-head > .btn')); + var SubjectsSubtext = element(by.css('#card-subjects-body .text-instruct')); + var SubjectList = element(by.css('#subject')); + //Grades + var GradesTitle = element(by.css('#card-grades-head > .btn')); + var GradessSubtext = element(by.css('#card-grades-body .text-instruct')); + var GradesList = element(by.css('#grade')); + //Correlations + var CorrelationsTitle = element(by.css('#card-correlation-head > .btn')); + var CorrelationsSubtext = element(by.css('#card-correlation-body .text-instruct')); + var CorrelationsList = element(by.css('#five_cor')); + //Options + var OptionsTitle = element(by.css('#card-options-head > .btn')); + var GAPReportingHeader = element(by.css('#card-options-body > b:nth-child(1)')); + var ContentDisplayHeader = element(by.css('#card-options-body')); + var ShowAllRadioButton = element(by.css('#showGapCorr2')); + var ShowAllLabel = element(by.css('.form-check:nth-child(4) > .form-check-label')); + var CorrelatedOnlyRadioButton = element(by.css('#showGapCorr1')); + var CorrelatedOnlyLabel = element(by.css('.form-check:nth-child(5) > .form-check-label')); + var UncorrelatedOnlyRadioButton = element(by.css('#showGapCorr0')); + var UncorrelatedOnlyLabel = element(by.css('.form-check:nth-child(6) > .form-check-label')); + var DisplayOptionsHeader = element(by.css('b:nth-child(8)')); + var UseAlternateColorsCheckbox = element(by.css('#color')); + var UseAlternateColorsLabel = element(by.css('.form-check:nth-child(10) > .form-check-label')); + var ShowTitlesAsLinksCheckbox = element(by.css('#hyperTitles')); + var ShowTitlesAsLinksLabel = element(by.css('.form-check:nth-child(11) > .form-check-label')); + var SummaryDescriptionCheckbox = element(by.css('#bIncludeUnitSummary')); + var SummaryDescriptionLabel = element(by.css('.form-check:nth-child(12) > .form-check-label')); + var ShowMetadataCheckbox = element(by.css('#bDisplayMetadata')); + var ShowMetadataLabel = element(by.css('.form-check:nth-child(13) > .form-check-label')); + var RollUpCorrelationsToHighestLevelStandardCheckbox = element(by.css('#bShowRollups')); + var RollUpCorrelationsToHighestLevelStandardLabel = element(by.css('.form-check:nth-child(14) > .form-check-label')); + var CorrelationRelevanceHeader = element(by.css('#card-options-body')); + var ShowAllRadioButtonTwo = element(by.css('#bShowWeight1')); + var ShowAllLabelTwo = element(by.css('.form-check:nth-child(16) > .form-check-label')); + var PrimaryRadioButton = element(by.css('#bShowWeight2')); + var PrimaryLabel = element(by.css('.form-check:nth-child(17) > .form-check-label')); + var SecondaryRadioButton = element(by.css('#bShowWeight3')); + var SecondaryLabel = element(by.css('.form-check:nth-child(18) > .form-check-label')); + var OffNoIndicatorsRadioButton = element(by.css('#bShowWeight0')); + var OffNoIndicatorsLabel = element(by.css('.form-check:nth-child(19) > .form-check-label')); + var StatisticsHeader = element(by.css('b:nth-child(21)')); + var IncludeCorrelationStatisticsRadioButton = element(by.css('#bShowStatistics')); + var IncludeCorrelationStatisticsLabel = element(by.css('.form-check:nth-child(23) > .form-check-label')); + var FormatHeader = element(by.css('label > b')); + var FormatDropdown = element(by.css('#format')); + var RunNowButton = element(by.css('#repsubmit')); + var RunInBackgroundButton = element(by.css('#repqsubmit')); + //Run Report In Background DIV + var RunReportInBackgroundDIVTitle = element(by.css('#myModalLabel')); + var RunReportInBackgroundDIVCloseIcon = element(by.css('.close > span')); + var ReportFileNameTitle = element(by.css('.form-group:nth-child(2) > label')); + var ReportFileNameTextbox = element(by.css('#reportName')); + var ReportFileNameValidationText = element(by.css('#validrepname')); + var ReportTitle = element(by.css('.form-group:nth-child(3) > label')); + var ReportTitleTextbox = element(by.css('#reportTitle')); + var ReportTitleValidationText = element(by.css('.form-group:nth-child(3) > .invalid-feedback')); + var AddReportToQueueButton = element(by.css('#queuebtn')); + //Run Now - Progress Bar DIV + var ProgressBarDIVTitle = element(by.css('#statustext')); + var ProgressBarSpinningWheel = element(by.css('.spinner-border')); + var ProgressBar = element(by.css('.progress-bar')); + //HTML Report + var MainCriteriaLabel = element(by.css('table:nth-child(3) tr:nth-child(1) b')); + var MainCriteriaResult = element(by.css('table:nth-child(3) tr:nth-child(1) > td')); + var SecondaryCriteriaLabel = element(by.css('tr:nth-child(2) b')); + var SecondaryCriteriaResult = element(by.css('table:nth-child(3) tr:nth-child(2) > td')); + var SubjectLabel = element(by.css('tr:nth-child(3) b')); + var SubjectResult = element(by.css('table:nth-child(3) tr:nth-child(3) > td')); + var GradeLabel = element(by.css('tr:nth-child(4) b')); + var GradeResult = element(by.css('table:nth-child(3) tr:nth-child(4) > td')); + var SubjectReportTitle = element(by.css('table:nth-child(5) b')); + var SubjectReportSubTitle = element(by.css('table:nth-child(7) td')); + var SubjectReportContent = element(by.css('table:nth-child(9) b')); + var SubjectReportSubject = element(by.css('table:nth-child(10) b')); + var SubjectReportAdopted = element(by.css('table:nth-child(11) tr:nth-child(1) > td')); + + //Navigation Menu Bars + expect(ExACTLogo.isPresent()).toBe(true); + expect(await DashboardMenuIcon.getText()).toEqual('Dashboard'); + expect(await IWantToHeader.getText()).toEqual('I WANT TO'); + expect(await AlignMenuIcon.getText()).toEqual('Align'); + expect(await UploadMenuIcon.getText()).toEqual('Upload'); + expect(await ReportMenuIcon.getText()).toEqual('Report'); + expect(await ApproveMenuIcon.getText()).toEqual('Approve'); + //Report Page Title + expect(ReportPageTitle.getCssValue('color')).toBe('rgba(1, 160, 78, 1)'); //green text + expect(await ReportPageTitle.getText()).toEqual('Report'); + expect(BuildYourReportHeaderButton.getCssValue('background-color')).toBe('rgba(42, 55, 118, 1)'); //dark blue background + expect(BuildYourReportHeaderButton.getCssValue('color')).toBe('rgba(255, 255, 255, 1)'); //white text + expect(await BuildYourReportHeaderButton.getText()).toEqual('Build your report'); + expect(ViewQueuedReportsHeaderButton.getCssValue('background-color')).toBe('rgba(0, 0, 0, 0)'); //white background + expect(ViewQueuedReportsHeaderButton.getCssValue('color')).toBe('rgba(182, 186, 181, 1)'); //grey text + expect(await ViewQueuedReportsHeaderButton.getText()).toEqual('View queued reports'); + //Report Type Breadcrums + expect(ReportTypeBreadcrumb.getCssValue('color')).toBe('rgba(1, 160, 78, 1)'); //green text + expect(await ReportTypeBreadcrumb.getText()).toEqual('Report Type'); + expect(MainCriteriaBreadcrumb.getCssValue('color')).toBe('rgba(115, 135, 156, 1)'); //grey text + expect(await MainCriteriaBreadcrumb.getText()).toEqual('Main Criteria'); + expect(SubjectsBreadcrumb.getCssValue('color')).toBe('rgba(115, 135, 156, 1)'); //grey text + expect(await SubjectsBreadcrumb.getText()).toEqual('Subjects'); + expect(GradesBreadcrumb.getCssValue('color')).toBe('rgba(115, 135, 156, 1)'); //grey text + expect(await GradesBreadcrumb.getText()).toEqual('Grades'); + expect(CorrelationsBreadcrumb.getCssValue('color')).toBe('rgba(115, 135, 156, 1)'); //green text + expect(await CorrelationsBreadcrumb.getText()).toEqual('Correlations'); + expect(OptionsBreadcrumb.getCssValue('color')).toBe('rgba(115, 135, 156, 1)'); //grey text + expect(await OptionsBreadcrumb.getText()).toEqual('Options'); + //Accordion Labels + expect(await ReportTypeTitle.getText()).toEqual('Report Type'); + expect(await MainCriteriaTitle.getText()).toEqual('Main Criteria'); + expect(await SubjectsTitle.getText()).toEqual('Subjects'); + expect(await GradesTitle.getText()).toEqual('Grades'); + expect(await CorrelationsTitle.getText()).toEqual('Correlations'); + expect(await OptionsTitle.getText()).toEqual('Options'); + //Report Type + expect(await ReportTypeTitle.getText()).toEqual('Report Type'); + //expect(await ContentReportsHeader.getText()).toEqual('unable to read'); + expect(await BasicContentReportLabel.getText()).toEqual('Basic Content Report'); + //expect(await StandardsReportsHeader.getText()).toEqual('unable to read'); + expect(await BasicStandardsReportLabel.getText()).toEqual('Basic Standards Report'); + await BasicContentReportLabel.click().then(function() { + browser.sleep(2500); + }); + browser.wait(EC.visibilityOf(ReportTypeTitle), 30000).then(function() { + browser.sleep(2500); + }); + expect(await ReportTypeTitle.getText()).toEqual('Report Type: Basic Content Report'); + //Main Criteria + expect(await MainCriteriaTitle.getText()).toEqual('Content'); + expect(await MainCriteriaSubtext.getText()).toEqual('To select multiple values, hold Ctrl or Shift before making selections'); + expect(await MainCriteriaSubjectList.getText()).toContain('Demo - User Submitted Content'); + expect(await MainCriteriaSubjectList.getText()).toContain('Algebra'); + expect(await MainCriteriaSubjectList.getText()).toContain('Biology'); + expect(await MainCriteriaSubjectList.getText()).toContain('English I'); + expect(await MainCriteriaSubjectList.getText()).toContain('Geometry'); + expect(await MainCriteriaSubjectList.getText()).toContain('US History'); + expect(await MainCriteriaSubjectList.getText()).toContain('Upload Demo'); + expect(await MainCriteriaSubjectList.getText()).toContain('Exploring - Access'); + expect(await MainCriteriaSubjectList.getText()).toContain('Exploring - PowerPoint'); + expect(await MainCriteriaSubjectList.getText()).toContain('Exploring - Word'); + element(by.cssContainingText('option', 'Geometry')).click().then(function() { + browser.sleep(1000); + }); + browser.wait(EC.visibilityOf(MainCriteriaTitle), 30000).then(function() { + browser.sleep(2500); + }); + expect(await MainCriteriaTitle.getText()).toEqual('Content: Geometry'); + //Subjects + expect(await SubjectsTitle.getText()).toEqual('Subjects'); + expect(await SubjectsSubtext.getText()).toEqual('To select multiple values, hold Ctrl or Shift before making selections'); + expect(await SubjectList.getText()).toContain('Mathematics'); + element(by.cssContainingText('option', 'Mathematics')).click().then(function() { + browser.sleep(1000); + }); + browser.wait(EC.visibilityOf(SubjectsTitle), 30000).then(function() { + browser.sleep(2500); + }); + expect(await SubjectsTitle.getText()).toEqual('Subjects: Mathematics'); + //Grades + expect(await GradesTitle.getText()).toEqual('Grades'); + expect(await GradessSubtext.getText()).toEqual('To select multiple values, hold Ctrl or Shift before making selections'); + expect(await GradesList.getText()).toContain('K'); + expect(await GradesList.getText()).toContain('1'); + expect(await GradesList.getText()).toContain('2'); + expect(await GradesList.getText()).toContain('3'); + expect(await GradesList.getText()).toContain('4'); + expect(await GradesList.getText()).toContain('5'); + expect(await GradesList.getText()).toContain('6'); + expect(await GradesList.getText()).toContain('7'); + expect(await GradesList.getText()).toContain('8'); + expect(await GradesList.getText()).toContain('9'); + expect(await GradesList.getText()).toContain('10'); + expect(await GradesList.getText()).toContain('11'); + expect(await GradesList.getText()).toContain('12'); + element(by.cssContainingText('option', '9')).click().then(function() { + browser.sleep(1000); + }); + browser.wait(EC.visibilityOf(GradesTitle), 30000).then(function() { + browser.sleep(2500); + }); + expect(await GradesTitle.getText()).toEqual('Grades: 9'); + //Correlations + expect(await CorrelationsTitle.getText()).toEqual('Correlations'); + expect(await CorrelationsSubtext.getText()).toEqual('To select multiple values, hold Ctrl or Shift before making selections'); + expect(await CorrelationsList.getText()).toContain('Alabama Standards'); + expect(await CorrelationsList.getText()).toContain('Alberta Standards'); + expect(await CorrelationsList.getText()).toContain('Arizona Standards'); + expect(await CorrelationsList.getText()).toContain('Australian Curriculum (ACARA) Standards'); + expect(await CorrelationsList.getText()).toContain('California Standards'); + expect(await CorrelationsList.getText()).toContain('Common Core State Standards'); + expect(await CorrelationsList.getText()).toContain('Florida Standards'); + expect(await CorrelationsList.getText()).toContain('New South Wales Standards'); + expect(await CorrelationsList.getText()).toContain('New York Standards'); + expect(await CorrelationsList.getText()).toContain('Ontario Standards'); + expect(await CorrelationsList.getText()).toContain('Texas TEKS Standards'); + expect(await CorrelationsList.getText()).toContain('Washington Standards'); + element(by.cssContainingText('option', 'California Standards')).click().then(function() { + browser.sleep(1000); + }); + browser.wait(EC.visibilityOf(CorrelationsTitle), 30000).then(function() { + browser.sleep(2500); + }); + expect(await CorrelationsTitle.getText()).toEqual('Correlations: California Standards'); + //Options + //Gap Reporting + expect(await OptionsTitle.getText()).toEqual('Options'); + expect(await GAPReportingHeader.getText()).toEqual('GAP Reporting'); + expect(await ContentDisplayHeader.getText()).toContain('Content Display:'); + expect(ShowAllRadioButton.isPresent()).toBe(true); + expect(await ShowAllLabel.getText()).toEqual('Show All'); + expect(CorrelatedOnlyRadioButton.isPresent()).toBe(true); + expect(await CorrelatedOnlyLabel.getText()).toEqual('Correlated Only'); + expect(UncorrelatedOnlyRadioButton.isPresent()).toBe(true); + expect(await UncorrelatedOnlyLabel.getText()).toEqual('Uncorrelated Only'); + //Display Options + expect(await DisplayOptionsHeader.getText()).toEqual('Display Options'); + expect(UseAlternateColorsCheckbox.isPresent()).toBe(true); + expect(await UseAlternateColorsLabel.getText()).toEqual('Use Alternate Colors'); + expect(ShowTitlesAsLinksCheckbox.isPresent()).toBe(true); + expect(await ShowTitlesAsLinksLabel.getText()).toEqual('Show Titles as Links'); + expect(SummaryDescriptionCheckbox.isPresent()).toBe(true); + expect(await SummaryDescriptionLabel.getText()).toEqual('Summary/Description'); + expect(ShowMetadataCheckbox.isPresent()).toBe(true); + expect(await ShowMetadataLabel.getText()).toEqual('Show Metadata'); + expect(RollUpCorrelationsToHighestLevelStandardCheckbox.isPresent()).toBe(true); + expect(await RollUpCorrelationsToHighestLevelStandardLabel.getText()).toEqual('Roll up Correlations to Highest Level Standard'); + expect(await CorrelationRelevanceHeader.getText()).toContain('Correlation Relevance:'); + expect(ShowAllRadioButtonTwo.isPresent()).toBe(true); + expect(await ShowAllLabelTwo.getText()).toEqual('Show All'); + expect(PrimaryRadioButton.isPresent()).toBe(true); + expect(await PrimaryLabel.getText()).toEqual('Primary'); + expect(SecondaryRadioButton.isPresent()).toBe(true); + expect(await SecondaryLabel.getText()).toEqual('Secondary'); + expect(OffNoIndicatorsRadioButton.isPresent()).toBe(true); + //Statistics + expect(await StatisticsHeader.getText()).toEqual('Statistics'); + expect(IncludeCorrelationStatisticsRadioButton.isPresent()).toBe(true); + expect(await IncludeCorrelationStatisticsLabel.getText()).toEqual('Include Correlation Statistics'); + //Format + expect(await FormatHeader.getText()).toEqual('Format'); + expect(await FormatDropdown.getAttribute('value')).toEqual('1'); + expect(await FormatDropdown.getText()).toContain('HTML'); + expect(RunNowButton.getCssValue('color')).toBe('rgba(255, 255, 255, 1)'); //green background + expect(await RunNowButton.getText()).toEqual('Run Now'); + expect(RunInBackgroundButton.getCssValue('color')).toBe('rgba(255, 255, 255, 1)'); //green background + expect(await RunInBackgroundButton.getText()).toEqual('Run In Background'); + await RunInBackgroundButton.click().then(function() { + browser.sleep(2500); + }); + browser.wait(EC.visibilityOf(RunReportInBackgroundDIVTitle), 30000).then(function() { + browser.sleep(2500); + }); + expect(await RunReportInBackgroundDIVTitle.getText()).toEqual('Run Report In Background'); + expect(RunReportInBackgroundDIVCloseIcon.isPresent()).toBe(true); + expect(await ReportFileNameTitle.getText()).toEqual('Report File Name (No file extention)'); + expect(ReportFileNameTextbox.isPresent()).toBe(true); + expect(await ReportTitle.getText()).toEqual('Report Title'); + expect(ReportTitleTextbox.isPresent()).toBe(true); + expect(AddReportToQueueButton.getCssValue('color')).toBe('rgba(255, 255, 255, 1)'); //green background + expect(await AddReportToQueueButton.getText()).toEqual('Add Report To Queue'); + await AddReportToQueueButton.click().then(function() { + browser.sleep(2500); + }); + //Run Report In Background DIV + expect(await RunReportInBackgroundDIVTitle.getText()).toEqual('Run Report In Background'); + expect(RunReportInBackgroundDIVCloseIcon.isPresent()).toBe(true); + expect(await ReportFileNameTitle.getText()).toEqual('Report File Name (No file extention)'); + expect(ReportFileNameTextbox.isPresent()).toBe(true); + expect(ReportFileNameValidationText.getCssValue('color')).toBe('rgba(220, 53, 69, 1)'); //red text + expect(await ReportFileNameValidationText.getText()).toEqual('Please provide a file name.'); + expect(await ReportTitle.getText()).toEqual('Report Title'); + expect(ReportTitleTextbox.isPresent()).toBe(true); + expect(ReportTitleValidationText.getCssValue('color')).toBe('rgba(220, 53, 69, 1)'); //red text + expect(await ReportTitleValidationText.getText()).toEqual('Please provide a report title.'); + expect(AddReportToQueueButton.getCssValue('color')).toBe('rgba(255, 255, 255, 1)'); //green background + expect(await AddReportToQueueButton.getText()).toEqual('Add Report To Queue'); + await RunReportInBackgroundDIVCloseIcon.click().then(function() { + browser.sleep(2500); + }); + //Accordion Labels + expect(await ReportTypeTitle.getText()).toEqual('Report Type: Basic Content Report'); + expect(await MainCriteriaTitle.getText()).toEqual('Content: Geometry'); + expect(await SubjectsTitle.getText()).toEqual('Subjects: Mathematics'); + expect(await GradesTitle.getText()).toEqual('Grades: 9'); + expect(await CorrelationsTitle.getText()).toEqual('Correlations: California Standards'); + expect(await OptionsTitle.getText()).toEqual('Options'); + await RunNowButton.click().then(function() { + browser.sleep(2500); + }); + browser.wait(EC.visibilityOf(MainCriteriaLabel), 30000).then(function() { + browser.sleep(2500); + }); + expect(await MainCriteriaLabel.getText()).toEqual('Main Criteria:'); + expect(await MainCriteriaResult.getText()).toContain(' Geometry'); + expect(await SecondaryCriteriaLabel.getText()).toEqual('Secondary Criteria:'); + expect(await SecondaryCriteriaResult.getText()).toContain(' California Content Standards'); + expect(await SubjectLabel.getText()).toEqual('Subject:'); + expect(await SubjectResult.getText()).toContain(' Mathematics'); + expect(await GradeLabel.getText()).toEqual('Grade:'); + expect(await GradeResult.getText()).toContain(' 9'); + expect(await SubjectReportTitle.getText()).toEqual('Geometry'); + expect(await SubjectReportSubTitle.getText()).toEqual('Algebraic Transformations'); + expect(await SubjectReportContent.getText()).toEqual('California Content Standards'); + expect(await SubjectReportSubject.getText()).toEqual('Mathematics'); + expect(await SubjectReportAdopted.getText()).toEqual('Grade 9 - Adopted: 2013'); + }); +} + +function CorrelationCoverageWidget() { + it(': CorrelationCoverageWidget, should verify widget default information.', async function () { + var CorrelationCoverageWidgetTitle = element(by.css('.row:nth-child(3) > .col-lg-6:nth-child(1) .card-header')); + var CorrelationCoverageStandardDropDown = element(by.css('#stdgap')); + var CorrelationCoverageSubjectDropDown = element(by.css('#subgap')); + var CorrelationCoverageDonutChart = element(by.css('#gcanvas')); + var CorrelationCoverageSubText = element(by.css('p:nth-child(2)')); + var StandardsCoveredIcon = element(by.css('.list-group-item:nth-child(4)')); + var StandardsCoveredLabel = element(by.css('.list-group-item:nth-child(5)')); + var NotCoveredIcon = element(by.css('.list-group-item:nth-child(6)')); + var NotCoveredLabel = element(by.css('')); + var ViewDetailsLinkText = element(by.linkText('View Details')); + var ViewDetailsArrowIcon = element(by.css('.fa-arrow-circle-right')); + + browser.executeScript('window.scrollTo(0, 563);').then(function() { + browser.sleep(2500); + }); + expect(await CorrelationCoverageWidgetTitle.getText()).toEqual('Correlation Coverage'); + expect(await CorrelationCoverageStandardDropDown.getAttribute('value')).toEqual('19928');//changes + expect(await CorrelationCoverageSubjectDropDown.getAttribute('value')).toEqual('Mathematics');//changes + expect(await CorrelationCoverageSubText.getText()).toEqual('Click anywhere on the chart to see a coverage breakdown by grade.'); + expect(ViewDetailsLinkText.getCssValue('color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await ViewDetailsLinkText.getText()).toEqual('View Details'); + expect(ViewDetailsArrowIcon.isPresent()).toBe(true); + }); +} + +function SignOut() { + it(': SignOut, should log out of ExACT.', async function () { + var ProfileImage = element(by.css('#navbarDropdown > span')); + var LogOutLinkText = element(by.linkText('Log Out')); + var EC = protractor.ExpectedConditions; + var ExACTLogo = element(by.css('#formLogin > img')); + + browser.executeScript('window.scrollTo(0, 0);').then(function() { + browser.sleep(10000); + }); + await ProfileImage.click().then(function() { + browser.sleep(2500); + }); + browser.actions().mouseMove(LogOutLinkText).perform().then(function() { + browser.sleep(2500); + }); + await LogOutLinkText.click().then(function() { + browser.sleep(2500); + }); + browser.wait(EC.visibilityOf(ExACTLogo), 30000).then(function() { + browser.sleep(2500); + }); + expect(ExACTLogo.isPresent()).toBe(true); + }); +} \ No newline at end of file diff --git a/exactLandingPage_config.js b/exactLandingPage_config.js index 624ee6e..71aef0d 100644 --- a/exactLandingPage_config.js +++ b/exactLandingPage_config.js @@ -1,9 +1,9 @@ -//exactLandingPage_config.js +//exActLandingPage_config.js exports.config = { framework: 'jasmine', seleniumAddress: 'http://localhost:4444/wd/hub', - specs: ['exactLandingPage_spec.js'], + specs: ['exActLandingPage_spec.js'], jasmineNodeOpts: { defaultTimeoutInterval: 360000 diff --git a/exactLandingPage_spec.js b/exactLandingPage_spec.js index 6036ad0..995d287 100644 --- a/exactLandingPage_spec.js +++ b/exactLandingPage_spec.js @@ -1,4 +1,4 @@ -//exactLandingPage_spec.js +//exActLandingPage_spec.js describe('My Journeys Widget script', function () { //login-journeysmap landing page @@ -112,7 +112,7 @@ describe('My Journeys Widget script', function () { }); expect(await PageHeaderText.getText()).toEqual('Empowering publishers with the ability to correlate their unique content to standards.'); expect(await PageSubText.getText()).toEqual('The ExACT platform is the education industry’s most trusted source to globally correlate content to standards and produce content alignment reports.'); - expect(await PageSubTextTwo.getText()).toEqual('With access to over five million learning outcomes, ExACT’s robust toolset allows end users to discover new markets for their content, find gaps, and adjust alignments for specific opportunities'); + expect(await PageSubTextTwo.getText()).toEqual('With access to over five million learning outcomes, ExACT’s robust toolset allows end users to discover new markets for their content, find gaps, and adjust alignments for specific opportunities.'); expect(AutoAlignImage.isPresent()).toBe(true); expect(await AutoAlignText.getText()).toEqual('Learn more about ExACT AutoAlign, the AI-based alignment tool'); browser.actions().mouseMove(AutoAlignLinkText).perform().then(function() { @@ -125,7 +125,7 @@ describe('My Journeys Widget script', function () { browser.driver.switchTo().window(handles[1]).then(async function () { browser.sleep(5000); expect(await browser.driver.getCurrentUrl()).toEqual('https://correlation.edgate.com/exact-alignment-platform#exact_autoalign'); - expect(await AutoAlignTitle.getText()).toEqual('ExACT AutoAlign'); + /*expect(await AutoAlignTitle.getText()).toEqual('ExACT AutoAlign'); expect(await AutoAlignDescriptionText.getText()).toEqual('EdGate’s Correlation Recommendation Tool provides a “hands-off” correlation process. As more and more content publishers have approached EdGate regarding the need to align thousands, and in some cases, millions, of educational resources, it became clear that we needed a solution that could handle high volumes of metadata, provides immediate results, and is cost-effective.'); expect(await AutoAlignSubTextOne.getText()).toEqual('ExACT AutoAlign offers the following capabilities:'); expect(await AutoAlignSubTextTwo.getText()).toEqual('Analysis of metadata associated with a resource and recommendation of educational concepts from the EdGate Taxonomy.'); @@ -134,7 +134,7 @@ describe('My Journeys Widget script', function () { expect(await AutoAlignSubTextFive.getText()).toEqual('Recommendation of relevant keywords to aid in discoverability of the resource.'); expect(await AutoAlignSubTextSix.getText()).toEqual('ExACT AutoAlign correlations are completed in a fraction of the time that a traditional correlation process takes, mapping to millions of machine readable standards in the EdGate database, including to the IMS Global CASE identifiers.'); expect(await AutoAlignSubTextSeven.getText()).toEqual('API access or via the ExACT base Correlation Tool through subscription service.'); - expect(await AutoAlignSubTextEight.getText()).toEqual('ExACT AutoAlign relies on machine learning and provides the most relevant AI-based suggestions in relation to the resource metadata. EdGate subject matter experts (SMEs) use ExACT alignment tool to tag thousands of resources each year. As content is tagged, our system becomes more and more familiar with the relationship between metadata and corresponding educational concepts, making ExACT AutoAlign increasingly accurate.'); + expect(await AutoAlignSubTextEight.getText()).toEqual('ExACT AutoAlign relies on machine learning and provides the most relevant AI-based suggestions in relation to the resource metadata. EdGate subject matter experts (SMEs) use ExACT alignment tool to tag thousands of resources each year. As content is tagged, our system becomes more and more familiar with the relationship between metadata and corresponding educational concepts, making ExACT AutoAlign increasingly accurate.');*/ browser.driver.close(); browser.driver.switchTo().window(handles[0]); browser.sleep(2500); @@ -208,6 +208,9 @@ describe('My Journeys Widget script', function () { expect(await NewZealandTitle.getText()).toEqual('New Zealand'); expect(PuertoRicoIcon.isPresent()).toBe(true); expect(await PuertoRicoTitle.getText()).toEqual('Puerto Rico'); + browser.executeScript('window.scrollTo(0, 210);').then(function() { + browser.sleep(2500); + }); expect(ScotlandIcon.isPresent()).toBe(true); expect(await ScotlandTitle.getText()).toEqual('Scotland'); expect(SignaporeIcon.isPresent()).toBe(true); @@ -237,7 +240,7 @@ describe('My Journeys Widget script', function () { }); expect(await PageHeaderText.getText()).toEqual('Empowering publishers with the ability to correlate their unique content to standards.'); expect(await PageSubText.getText()).toEqual('The ExACT platform is the education industry’s most trusted source to globally correlate content to standards and produce content alignment reports.'); - expect(await PageSubTextTwo.getText()).toEqual('With access to over five million learning outcomes, ExACT’s robust toolset allows end users to discover new markets for their content, find gaps, and adjust alignments for specific opportunities'); + expect(await PageSubTextTwo.getText()).toEqual('With access to over five million learning outcomes, ExACT’s robust toolset allows end users to discover new markets for their content, find gaps, and adjust alignments for specific opportunities.'); expect(AutoAlignImage.isPresent()).toBe(true); expect(await LostPasswordAutoAlignText.getText()).toEqual('Learn more about ExACT AutoAlign, the AI-based alignment tool'); expect(AnalyticsAndReportingImage.isPresent()).toBe(true); @@ -250,6 +253,14 @@ describe('My Journeys Widget script', function () { //expect(await LoginButton.getText()).toEqual('1'); CAN'T READ BUTTON expect(LoginButton.getCssValue('color')).toBe('rgba(233, 237, 239, 1)'); //green expect(await BackToLoginLinkText.getText()).toEqual('< Back to Login'); + await ForgotUserNameTextBox.sendKeys('exact_jhuerta').then(function() { + browser.sleep(1500); + }); + await LoginButton.click().then(function() { + browser.sleep(2500); + }); + expect(await ValidationText.getText()).toEqual('exact_jhuerta was not found. Please check the username you entered and try again.'); + browser.sleep(2500); await browser.driver.getCurrentUrl().then(async function(actualURL) { if(actualURL.indexOf('http://stage.edgate.com/exact/forgot.php') !== -1) { await ForgotUserNameTextBox.sendKeys('exact_juan').then(function() { @@ -297,4 +308,30 @@ describe('My Journeys Widget script', function () { expect(DashboardExACTLogo.isPresent()).toBe(true); }); } -}); \ No newline at end of file + + //Sign Out + SignOut(); +}); + +function SignOut() { + it(': SignOut, should log out of ExACT', async function () { + var ProfileImage = element(by.css('#navbarDropdown > span')); + var LogOutLinkText = element(by.linkText('Log Out')); + var EC = protractor.ExpectedConditions; + var ExACTLogo = element(by.css('#formLogin > img')); + + await ProfileImage.click().then(function() { + browser.sleep(2500); + }); + browser.actions().mouseMove(LogOutLinkText).perform().then(function() { + browser.sleep(2500); + }); + await LogOutLinkText.click().then(function() { + browser.sleep(2500); + }); + browser.wait(EC.visibilityOf(ExACTLogo), 30000).then(function() { + browser.sleep(2500); + }); + expect(ExACTLogo.isPresent()).toBe(true); + }); +} \ No newline at end of file diff --git a/myContentWidget_config.js b/myContentWidget_config.js new file mode 100644 index 0000000..c609d41 --- /dev/null +++ b/myContentWidget_config.js @@ -0,0 +1,36 @@ +//myContentWidget_config.js + +exports.config = { + framework: 'jasmine', + seleniumAddress: 'http://localhost:4444/wd/hub', + specs: ['myContentWidget_spec.js'], + + jasmineNodeOpts: { + defaultTimeoutInterval: 360000 + }, + + capabilities: { + browserName: 'chrome' + }, + + onPrepare: function() { + browser.waitForAngularEnabled(false); + browser.sleep(2500); + browser.driver.manage().window().maximize(); + }, + + params: { + login: 'http://stage.edgate.com/exact/login.php' //QA + //login: 'https://correlation.edgate.com/exact/login.php' //PROD + } + + /*multiCapabilities: [{ + browserName: 'chrome' + }, { + browserName: 'firefox' + }]/*, { + browserName: 'internet explorer' + }], { + browserName: 'safari' + }]*/ +} \ No newline at end of file diff --git a/myContentWidget_spec.js b/myContentWidget_spec.js new file mode 100644 index 0000000..977861f --- /dev/null +++ b/myContentWidget_spec.js @@ -0,0 +1,864 @@ +//myContentWidget_spec.js + +describe('My Content Widget script', function () { + //login-ExACT landing page + var UserNameTextBox = element(by.name('username')); + var PasswordTextBox = element(by.name('password')); + + //Open browser + browser.get(browser.params.login); + + it('should have a title', async function () { + await expect(browser.getTitle()).toEqual('ExACT Login'); + }); + + //Sign In + ExACT(UserNameTextBox, PasswordTextBox); + + it('should have a title', async function () { + await expect(browser.getTitle()).toEqual('ExACT'); + }); + + function ExACT(UserNameTextBox, PasswordTextBox) { + it('ExACT, log in.', async function () { + var EC = protractor.ExpectedConditions; + var LoginButton = element(by.css('.btn')); + var EdGateLogo = element(by.css('p > img')); + var CopyrightText = element(by.css('#footer-branding > p:nth-child(2)')); + var CorrelationCoverageSubText = element(by.css('p:nth-child(2)')); + + browser.wait(EC.visibilityOf(EdGateLogo), 30000).then(function() { + browser.sleep(2500); + }); + expect(EdGateLogo.isPresent()).toBe(true); + expect(await CopyrightText.getText()).toEqual('© Copyright 2021 EdGate Correlation Services'); + await browser.driver.getCurrentUrl().then(async function(actualURL) { + if(actualURL.indexOf('http://stage.edgate.com/exact/login.php') !== -1) { + await UserNameTextBox.sendKeys('exact_juan').then(function() { + browser.sleep(1500); + }); + } else { + await UserNameTextBox.sendKeys('exact_ctuser').then(function() { + browser.sleep(1500); + }); + } + }); + await PasswordTextBox.sendKeys('ex123456').then(function() { + browser.sleep(1500); + }); + await LoginButton.click().then(function() { + browser.sleep(5000); + }); + /*browser.wait(EC.visibilityOf(CorrelationCoverageSubText), 30000).then(function() { + browser.sleep(2500); + }); + expect(CorrelationCoverageSubText.isPresent()).toBe(true);*/ + }); + } + + //Dashboard + Dashboard(); + MyContentWidget(); + Algebra(); + /*ResultsPanel(); + DeleteSavedSearch(); + + //Sign Out*/ + SignOut(); +}); + +function Dashboard() { + it(': Dashboard, should verify ExACT dashboard.', async function () { + //Navigation Menu + var EC = protractor.ExpectedConditions; + var ExACTLogo = element(by.css('span:nth-child(2) > img')); + var IWantToHeader = element(by.css('h3')); + var DashboardMenuIcon = element(by.linkText('Dashboard')); + var AlignMenuIcon = element(by.linkText('Align')); + var UploadMenuIcon = element(by.linkText('Upload')); + var ReportMenuIcon = element(by.linkText('Report')); + var ApproveMenuIcon = element(by.linkText('Approve')); + var MenuBars = element(by.css('.fa-bars')); + var MiniExACTLogo = element(by.css('.sm-ver')); + var MiniDashboardMenuIcon = element(by.css('.fa-dashboard')); + var MiniAlignMenuIcon = element(by.css('.menu-left-first .fa-sitemap')); + var MiniUploadMenuIcon = element(by.css('.fa-upload')); + var MiniReportMenuIcon = element(by.css('.fa-table')); + var MiniApproveMenuIcon = element(by.css('.fa-wrench')); + var SearchIcon = element(by.css('.searchbar-icon > .fa')); + var ExACTHelpIcon = element(by.css('.fa-question-circle')); + var UserIcon = element(by.css('.fa-user')); + var UserDropdown = element(by.css('#navbarDropdown > span')); + //Dashboard + var CorrelationDashboardHeader = element(by.css('h2')); + + //Navigation Menu + browser.wait(EC.visibilityOf(ExACTLogo), 30000).then(function() { + browser.sleep(2500); + }); + expect(ExACTLogo.isPresent()).toBe(true); + expect(await DashboardMenuIcon.getText()).toEqual('Dashboard'); + expect(await IWantToHeader.getText()).toEqual('I WANT TO'); + expect(await AlignMenuIcon.getText()).toEqual('Align'); + expect(await UploadMenuIcon.getText()).toEqual('Upload'); + expect(await ReportMenuIcon.getText()).toEqual('Report'); + expect(await ApproveMenuIcon.getText()).toEqual('Approve'); + expect(MenuBars.isPresent()).toBe(true); + expect(MiniExACTLogo.isPresent()).toBe(true); + expect(MiniDashboardMenuIcon.isPresent()).toBe(true); + expect(MiniAlignMenuIcon.isPresent()).toBe(true); + expect(MiniUploadMenuIcon.isPresent()).toBe(true); + expect(MiniReportMenuIcon.isPresent()).toBe(true); + expect(MiniApproveMenuIcon.isPresent()).toBe(true); + expect(SearchIcon.isPresent()).toBe(true); + expect(ExACTHelpIcon.isPresent()).toBe(true); + expect(UserIcon.isPresent()).toBe(true); + expect(await UserDropdown.getText()).toEqual('ExACT Admin'); + //Dashboard + expect(CorrelationDashboardHeader.getCssValue('color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await CorrelationDashboardHeader.getText()).toEqual('Correlation Dashboard'); + }); +} + +function MyContentWidget() { + it(': MyContentWidget, should verify widget default information.', async function () { + var MyContentWidgetTitle = element(by.css('.row:nth-child(2) > .col-lg-6:nth-child(1) .card-header')); + var ExportButton = element(by.css('.col-lg-6:nth-child(1) .btn')); + var EC = protractor.ExpectedConditions; + var ExportDIVTitle = element(by.css('.modal-header:nth-child(4) > .modal-title')); + var ExportDIVXCloseIcon = element(by.css('.modal-header:nth-child(4) span')); + var ExportDIVSubText = element(by.css('#content-export-container > h5')); + var ExportDIVDropdownLabel = element(by.css('.form-label')); + var ExportDIVDropdown = element(by.css('.multiselect-selected-text')); + var ExportDIVDropdownMagnifyingGlassIcon = element(by.css('.input-group-text > .fa')); + var ExportDIVDropdownSearchTextBox = element(by.css('.multiselect-search')); + var SearchOptionCheckBoxOne = element(by.css('.multiselect-all input')); + var SearchOptionLabelOne = element(by.css('.multiselect-all > .checkbox')); + var SearchOptionCheckBoxTwo = element(by.css('li:nth-child(3) .checkbox > input')); + var SearchOptionLabelTwo = element(by.css('li:nth-child(3) .checkbox')); + var SearchOptionCheckBoxThree = element(by.css('li:nth-child(4) input')); + var SearchOptionLabelThree = element(by.css('li:nth-child(4) .checkbox')); + var SearchOptionCheckBoxFour = element(by.css('li:nth-child(5) input')); + var SearchOptionLabelFour = element(by.css('li:nth-child(5) .checkbox')); + var SearchOptionCheckBoxFive = element(by.css('li:nth-child(6) input')); + var SearchOptionLabelFive = element(by.css('li:nth-child(6) .checkbox')); + var SearchOptionCheckBoxSix = element(by.css('li:nth-child(7) input')); + var SearchOptionLabelSix = element(by.css('li:nth-child(7) .checkbox')); + var SearchOptionCheckBoxSeven = element(by.css('li:nth-child(8) input')); + var SearchOptionLabelSeven = element(by.css('li:nth-child(8) .checkbox')); + var SearchOptionCheckBoxEight = element(by.css('li:nth-child(9) input')); + var SearchOptionLabelEight = element(by.css('li:nth-child(9) .checkbox')); + var SearchOptionCheckBoxNine = element(by.css('li:nth-child(10) input')); + var SearchOptionLabelNine = element(by.css('li:nth-child(10) .checkbox')); + var SearchOptionCheckBoxTen = element(by.css('li:nth-child(11) input')); + var SearchOptionLabelTen = element(by.css('li:nth-child(11) .checkbox')); + var SearchOptionCheckBoxEleven = element(by.css('li:nth-child(12) input')); + var SearchOptionLabelEleven = element(by.css('li:nth-child(12) .checkbox')); + var ExportDIVDropdownXClearIcon = element(by.css('.fa-times-circle')); + var ExportDIVExportButton = element(by.css('.btn-primary')); + var ExporDIVCloseButton = element(by.css('.btn-secondary')); + var ContentLabelOne = element(by.css('.list-group-item:nth-child(1)')); + var ContentCountOne = element(by.css('.list-group-item:nth-child(1) .badge')); + var ContentLabelTwo = element(by.css('.list-group-item:nth-child(2)')); + var ContentCountTwo = element(by.css('.list-group-item:nth-child(2) .badge')); + var ContentLabelThree = element(by.css('.list-group-item:nth-child(3) > a')); + var ContentCountThree = element(by.css('.list-group-item:nth-child(3) .badge')); + var ContentLabelFour = element(by.css('.list-group-item:nth-child(4)')); + var ContentCountFour = element(by.css('.list-group-item:nth-child(4) .badge')); + var ContentLabelFive = element(by.css('.list-group-item:nth-child(5)')); + var ContentCountFive = element(by.css('.list-group-item:nth-child(5) .badge')); + var ContentLabelSix = element(by.css('.list-group-item:nth-child(6)')); + var ContentCountSix = element(by.css('.list-group-item:nth-child(6) .badge')); + var ExportPageTitle = element(by.css('h2')); + var ExportPageSubText = element(by.css('b')); + var ExportPageDownloadExportButton = element(by.css('.btn')); + var BackToDashboardButton = element(by.linkText('Back to Dashboard')); + + expect(await MyContentWidgetTitle.getText()).toContain('My Content'); + expect(ExportButton.getCssValue('background-color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await ExportButton.getText()).toEqual('Export'); + expect(await ContentLabelOne.getText()).toContain('Biology'); + expect(ContentCountOne.getCssValue('background-color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await ContentCountOne.getText()).toEqual('1045'); + expect(await ContentLabelTwo.getText()).toContain('Geometry'); + expect(ContentCountTwo.getCssValue('background-color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await ContentCountTwo.getText()).toEqual('985'); + expect(await ContentLabelThree.getText()).toContain('English I'); + expect(ContentCountThree.getCssValue('background-color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await ContentCountThree.getText()).toEqual('403'); + expect(await ContentLabelFour.getText()).toContain('Algebra'); + expect(ContentCountFour.getCssValue('background-color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await ContentCountFour.getText()).toEqual('184'); + expect(await ContentLabelFive.getText()).toContain('US History'); + expect(ContentCountFive.getCssValue('background-color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await ContentCountFive.getText()).toEqual('66'); + expect(await ContentLabelSix.getText()).toContain('Demo - User Submitted Content'); + expect(ContentCountSix.getCssValue('background-color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await ContentCountSix.getText()).toEqual('16'); + await ExportButton.click().then(function() { + browser.sleep(2500); + }); + browser.wait(EC.visibilityOf(ExportDIVTitle), 30000).then(function() { + browser.sleep(2500); + }); + expect(await ExportDIVTitle.getText()).toEqual('Export Content'); + expect(ExportDIVXCloseIcon.isPresent()).toBe(true); + expect(await ExportDIVSubText.getText()).toEqual('Please select one or more content sets to export:'); + expect(await ExportDIVDropdownLabel.getText()).toEqual('Content Set'); + expect(await ExportDIVDropdown.getText()).toEqual('Please select a Content Set'); + expect(ExportDIVExportButton.getCssValue('background-color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await ExportDIVExportButton.getAttribute('value')).toEqual('Export'); + expect(ExporDIVCloseButton.getCssValue('background-color')).toBe('rgba(108, 117, 125, 1)'); //grey + expect(await ExporDIVCloseButton.getText()).toEqual('Close'); + await ExportDIVDropdown.click().then(function() { + browser.sleep(2500); + }); + browser.wait(EC.visibilityOf(ExportDIVDropdownMagnifyingGlassIcon), 30000).then(function() { + browser.sleep(2500); + }); + expect(await ExportDIVDropdownSearchTextBox.getAttribute('placeholder')).toEqual('Search'); + expect(ExportDIVDropdownXClearIcon.isPresent()).toBe(true); + await ExportDIVDropdownSearchTextBox.click().then(function() { + browser.sleep(2500); + }); + browser.wait(EC.visibilityOf(SearchOptionCheckBoxOne), 30000).then(function() { + browser.sleep(2500); + }); + expect(SearchOptionCheckBoxOne.isPresent()).toBe(true); + expect(await SearchOptionLabelOne.getText()).toEqual('Select all'); + expect(SearchOptionCheckBoxTwo.isPresent()).toBe(true); + expect(await SearchOptionLabelTwo.getText()).toEqual('Demo - User Submitted Content'); + expect(SearchOptionCheckBoxThree.isPresent()).toBe(true); + expect(await SearchOptionLabelThree.getText()).toEqual('Algebra'); + expect(SearchOptionCheckBoxFour.isPresent()).toBe(true); + expect(await SearchOptionLabelFour.getText()).toEqual('Biology'); + expect(SearchOptionCheckBoxFive.isPresent()).toBe(true); + expect(await SearchOptionLabelFive.getText()).toEqual('English I'); + expect(SearchOptionCheckBoxSix.isPresent()).toBe(true); + expect(await SearchOptionLabelSix.getText()).toEqual('Geometry'); + expect(SearchOptionCheckBoxSeven.isPresent()).toBe(true); + expect(await SearchOptionLabelSeven.getText()).toEqual('US History'); + expect(SearchOptionCheckBoxEight.isPresent()).toBe(true); + expect(await SearchOptionLabelEight.getText()).toEqual('Upload Demo'); + expect(SearchOptionCheckBoxNine.isPresent()).toBe(true); + expect(await SearchOptionLabelNine.getText()).toEqual('Exploring - Access'); + expect(SearchOptionCheckBoxTen.isPresent()).toBe(true); + expect(await SearchOptionLabelTen.getText()).toEqual('Exploring - PowerPoint'); + expect(SearchOptionCheckBoxEleven.isPresent()).toBe(true); + expect(await SearchOptionLabelEleven.getText()).toEqual('Exploring - Word'); + await SearchOptionCheckBoxThree.click().then(function() { + browser.sleep(2500); + }); + await SearchOptionLabelSix.click().then(function() { + browser.sleep(2500); + }); + await ExportDIVExportButton.click().then(function() { + browser.sleep(2500); + }); + browser.wait(EC.visibilityOf(ExportPageTitle), 30000).then(function() { + browser.sleep(2500); + }); + expect(await ExportPageTitle.getText()).toEqual('Export'); + expect(await ExportPageSubText.getText()).toEqual('Export complete!'); + expect(ExportPageDownloadExportButton.getCssValue('background-color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await ExportPageDownloadExportButton.getText()).toEqual('Download Export'); + expect(BackToDashboardButton.getCssValue('background-color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await BackToDashboardButton.getText()).toEqual('1'); + await BackToDashboardButton.click().then(function() { + browser.sleep(2500); + }); + }); +} + +function Algebra() { + it(': Algebra, should verify Algebra data.', async function () { + var ContentLabelThree = element(by.css('.list-group-item:nth-child(3) > a')); + var EC = protractor.ExpectedConditions; + //Filter Results Table + var FilterResultsLabel = element(by.css('.well > b')); + //Content Set + var ContentSetLabel = element(by.css('.form-group:nth-child(1) > b')); + var AlgebraCheckBox = element(by.css('#metaorgobjectid585821586')); + var AlgebraLabel = element(by.css('.form-group:nth-child(1) > label')); + var ContentSetCount = element(by.css('.form-group:nth-child(1)')); + //Grade + var GradeLabel = element(by.css('.form-group:nth-child(3) > b')); + var NinethGradeCheckbox = element(by.css('#metagrades49')); + var NinethGradeLabel = element(by.css('.form-group:nth-child(3) > label:nth-child(4)')); + var GradeCount = element(by.css('.form-group:nth-child(3)')); + var TenthGradeCheckbox = element(by.css('#metagrades51')); + var TenthGradeLabel = element(by.css('.form-group:nth-child(3) > label:nth-child(7)')); + var EleventhGradeCheckbox = element(by.css('#metagrades52')); + var EleventhGradeLabel = element(by.css('label:nth-child(10)')); + var TwelfthGradeCheckbox = element(by.css('#metagrades53')); + var TwelfthGradeLabel = element(by.css('label:nth-child(13)')); + var EighthGradeCheckbox = element(by.css('#metagrades48')); + var EighthGradeLabel = element(by.css('label:nth-child(16)')); + var MoreLink = element(by.linkText('More>>')) + //Subject + var SubjectLabel = element(by.css('.form-group:nth-child(6) > b')); + var MathematicsCheckbox = element(by.css('#metasubjectsMathematics')); + var SubjectLabelOne = element(by.css('.form-group:nth-child(6) > label')); + var SubjectCountOne = element(by.css('.form-group:nth-child(6)')); + //Alignment Status + var AlignmentStatusLabel = element(by.css('.form-group:nth-child(8) > b')); + var NotAlignedCheckbox = element(by.css('#metaAlignmentStatusNot\\ Aligned')); + var NotAlignedLabel = element(by.css('.form-group:nth-child(8) > label')); + var CountTable = element(by.css('.form-group:nth-child(8)')); + var PendingCheckbox = element(by.css('#metaAlignmentStatusPending')); + var PendingLabel = element(by.css('.form-group:nth-child(8) > label:nth-child(7)')); + //Reset All link + var ResetAllLink = element(by.linkText('Reset All')); + + await ContentLabelThree.click().then(function() { + browser.sleep(2500); + }); + browser.wait(EC.visibilityOf(FilterResultsLabel), 30000).then(function() { + browser.sleep(2500); + }); + //Filter Results Table + expect(await FilterResultsLabel.getText()).toEqual('Filter Results'); + //Content Set + expect(await ContentSetLabel.getText()).toEqual('Content Set'); + expect(AlgebraCheckBox.isPresent()).toBe(true); + expect(await AlgebraLabel.getText()).toEqual('Algebra'); + expect(await ContentSetCount.getText()).toContain('Algebra (183)'); + //Grade + expect(await GradeLabel.getText()).toEqual('Grade'); + expect(NinethGradeCheckbox.isPresent()).toBe(true); + expect(await NinethGradeLabel.getText()).toEqual('9'); + expect(await GradeCount.getText()).toContain('9 (182)'); + expect(TenthGradeCheckbox.isPresent()).toBe(true); + expect(await TenthGradeLabel.getText()).toEqual('10'); + expect(await GradeCount.getText()).toContain('10 (182)'); + expect(EleventhGradeCheckbox.isPresent()).toBe(true); + expect(await EleventhGradeLabel.getText()).toEqual('11'); + expect(await GradeCount.getText()).toContain('11 (172)'); + expect(TwelfthGradeCheckbox.isPresent()).toBe(true); + expect(await TwelfthGradeLabel.getText()).toEqual('12'); + expect(await GradeCount.getText()).toContain('12 (172)'); + expect(EighthGradeCheckbox.isPresent()).toBe(true); + expect(await EighthGradeLabel.getText()).toEqual('8'); + expect(await GradeCount.getText()).toContain('8 (15)'); + expect(await MoreLink.getText()).toEqual('More>>'); + //Subject + expect(await SubjectLabel.getText()).toEqual('Subject'); + expect(MathematicsCheckbox.isPresent()).toBe(true); + expect(await SubjectLabelOne.getText()).toEqual('Mathematics'); + expect(await SubjectCountOne.getText()).toContain('Mathematics (183)'); + //Alignment Status + expect(await AlignmentStatusLabel.getText()).toEqual('Alignment Status'); + expect(NotAlignedCheckbox.isPresent()).toBe(true); + expect(await NotAlignedLabel.getText()).toEqual('Not Aligned'); + expect(await CountTable.getText()).toContain('Not Aligned (181)'); + expect(PendingCheckbox.isPresent()).toBe(true); + expect(await PendingLabel.getText()).toEqual('Pending'); + expect(await CountTable.getText()).toContain('Pending (2)'); + //Reset All link + expect(await ResetAllLink.getText()).toEqual('Reset All'); + }); +} + +function ResultsPanel() { + it(': ResultsPanel, should verify results panel information.', async function () { + var HomeLink = element(by.linkText('Home')); + var ContentBreadcrumb = element(by.css('.breadcrumb-item:nth-child(2)')); + var SaveIcon = element(by.css('.float-right > a:nth-child(1) > img')); + var EC = protractor.ExpectedConditions; + var SaveSearchDIVTitle = element(by.css('#myModalLabel')); + var SaveSearchDescriptionLabel = element(by.css('#save')); + var SaveSearchDescriptionTextBox = element(by.css('.form-control')); + var SaveSearchButton = element(by.css('#save > input.btn.btn-primary')); + var ValidationText = element(by.css('.alert')); + var SaveSearchDIVXCloseIcon = element(by.css('span:nth-child(1)')); + var PrintIcon = element(by.css('.icon-link > img')); + var ResultsCount = element(by.css('#pub > div:nth-child(4)')); + var PaginationOne = element(by.linkText('1')); + var PaginationTwo = element(by.linkText('2')); + var PaginationThree = element(by.linkText('3')); + var PaginationFour = element(by.linkText('4')); + var PaginationFive = element(by.linkText('5')); + var PaginationEllipsis = element(by.linkText('...')); + var PaginationEight = element(by.linkText('8')); + var PaginationShowAll = element(by.linkText('Show All')); + //Results + var Results3VariableLinearSystemWordProblem = element(by.linkText('3-variable linear system word problem')); + var Results3VariableLinearSystemWordProblemDescription = element(by.css('.card:nth-child(6) .lo-descr')); + var ResultsDesciptionOne = element(by.css('.card:nth-child(6) small')); + var ViewDetailsButton = element(by.linkText('View Details')); + + expect(await HomeLink.getText()).toEqual('Home'); + expect(ContentBreadcrumb.getCssValue('color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await ContentBreadcrumb.getText()).toContain('Content'); + await SaveIcon.click().then(function() { + browser.sleep(2500); + }); + browser.wait(EC.visibilityOf(SaveSearchDIVTitle), 30000).then(function() { + browser.sleep(2500); + }); + expect(await SaveSearchDIVTitle.getText()).toEqual('Save Search'); + expect(await SaveSearchDescriptionLabel.getText()).toEqual('Please enter a description of this search:'); + expect(SaveSearchButton.getCssValue('background-color')).toBe('rgba(1, 160, 78, 1)'); //green + //expect(await SaveSearchButton.getText()).toEqual('1a'); CAN'T CAPTURE TEXT + await SaveSearchButton.click().then(function() { + browser.sleep(2500); + }); + expect(ValidationText.getCssValue('background-color')).toBe('rgba(231, 76, 60, 0.88)'); //red + expect(await ValidationText.getText()).toEqual('You must enter a description'); + await SaveSearchDescriptionTextBox.sendKeys('My saved automated list').then(function() { + browser.sleep(1500); + }); + await SaveSearchButton.click().then(function() { + browser.sleep(2500); + }); + expect(ValidationText.getCssValue('background-color')).toBe('rgba(38, 185, 154, 0.88)'); //green + expect(await ValidationText.getText()).toEqual('Your search was saved successfully! It can now be recalled on your Saved Searches page.'); + await SaveSearchDIVXCloseIcon.click().then(function() { + browser.sleep(2500); + }); + expect(PrintIcon.isPresent()).toBe(true); + expect(await ResultsCount.getText()).toEqual('Results 1 - 25 of 183'); + /*browser.executeScript('window.scrollTo(0, document.body.scrollHeight);').then(function() { + browser.sleep(2500); + });*/ + expect(PaginationOne.getCssValue('background-color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(PaginationOne.getCssValue('color')).toBe('rgba(255, 255, 255, 1)'); //white + expect(await PaginationOne.getText()).toContain('1'); + expect(PaginationTwo.getCssValue('background-color')).toBe('rgba(255, 255, 255, 1)'); //white + expect(PaginationTwo.getCssValue('color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await PaginationTwo.getText()).toEqual('2'); + expect(PaginationThree.getCssValue('background-color')).toBe('rgba(255, 255, 255, 1)'); //white + expect(PaginationThree.getCssValue('color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await PaginationThree.getText()).toContain('3'); + expect(PaginationFour.getCssValue('background-color')).toBe('rgba(255, 255, 255, 1)'); //white + expect(PaginationFour.getCssValue('color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await PaginationFour.getText()).toEqual('4'); + expect(PaginationFive.getCssValue('background-color')).toBe('rgba(255, 255, 255, 1)'); //white + expect(PaginationFive.getCssValue('color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await PaginationFive.getText()).toEqual('5'); + expect(PaginationEllipsis.isPresent()).toBe(true); + expect(PaginationEight.getCssValue('background-color')).toBe('rgba(255, 255, 255, 1)'); //white + expect(PaginationEight.getCssValue('color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await PaginationEight.getText()).toEqual('8'); + expect(PaginationShowAll.getCssValue('background-color')).toBe('rgba(255, 255, 255, 1)'); //white + expect(PaginationShowAll.getCssValue('color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await PaginationShowAll.getText()).toEqual('Show All'); + //Results + expect(await Results3VariableLinearSystemWordProblem.getText()).toEqual('3-variable linear system word problem'); + expect(await Results3VariableLinearSystemWordProblemDescription.getText()).toContain('Learn how to make the most out of the familiar algebraic techniques in order to solve systems of three equations with three variables.'); + expect(await ResultsDesciptionOne.getText()).toEqual('Content Set: Algebra'); + expect(ViewDetailsButton.getCssValue('background-color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await ViewDetailsButton.getText()).toEqual('View Details'); + await ViewDetailsButton.click().then(function() { + browser.sleep(2500); + }); + }); +} + +function DeleteSavedSearch() { + it(': DeleteSavedSearch, should verify then delete saved search.', async function () { + var ProfileImage = element(by.css('#navbarDropdown > span')); + var SavedSearches = element(by.linkText('Saved Searches')); + var EC = protractor.ExpectedConditions; + var MySavedSearchesTitle = element(by.css('h2')); + var SavedSearchTenthGradeAligned = element(by.linkText('10th Grade Aligned')); + var SavedSearchDateOne = element(by.css('.list-group-item:nth-child(1)')); + var SavedSearchDeleteButtonOne = element(by.css('.list-group-item:nth-child(1) .btn')); + var SavedSearchLanguageOnlyFourResults = element(by.linkText('Language - Only Four Results')); + var SavedSearchDateTwo = element(by.css('.list-group-item:nth-child(2)')); + var SavedSearchDeleteButtonTwo = element(by.css('.list-group-item:nth-child(2) .btn')); + var SavedSearchMySavedAutomatedList = element(by.linkText('My saved automated list')); + var SavedSearchDateThree = element(by.css('.list-group-item:nth-child(3)')); + var SavedSearchDeleteButtonThree = element(by.css('.list-group-item:nth-child(3) .btn')); + //Filter Results Table + var FilterResultsLabel = element(by.css('.well > b')); + //Content Set + var ContentSetLabel = element(by.css('.form-group:nth-child(1) > b')); + var AlgebraCheckBox = element(by.css('#metaorgobjectid585821586')); + var ContentSetLabelOne = element(by.css('.form-group:nth-child(1) > label')); + var ContentSetCount = element(by.css('.form-group:nth-child(1)')); + //Grade + var GradeLabel = element(by.css('.form-group:nth-child(3) > b')); + var NinethGradeCheckbox = element(by.css('#metagrades49')); + var GradeLabelOne = element(by.css('.form-group:nth-child(3) > label:nth-child(4)')); + var GradeCount = element(by.css('.form-group:nth-child(3)')); + var TenthGradeCheckbox = element(by.css('#metagrades51')); + var GradeLabelTwo = element(by.css('.form-group:nth-child(3) > label:nth-child(7)')); + var EleventhGradeCheckbox = element(by.css('#metagrades52')); + var GradeLabelThree = element(by.css('label:nth-child(10)')); + var TwelfthGradeCheckbox = element(by.css('#metagrades53')); + var GradeLabelFour = element(by.css('label:nth-child(13)')); + var EighthGradeCheckbox = element(by.css('#metagrades48')); + var GradeLabelFive = element(by.css('label:nth-child(16)')); + var MoreLink = element(by.linkText('More>>')) + //Subject + var SubjectLabel = element(by.css('.form-group:nth-child(6) > b')); + var MathematicsCheckbox = element(by.css('#metasubjectsMathematics')); + var SubjectLabelOne = element(by.css('.form-group:nth-child(6) > label')); + var SubjectLabelOneTwo = element(by.css('.form-group:nth-child(6) > label:nth-child(4)')); + var SubjectCount = element(by.css('.form-group:nth-child(6)')); + var ScienceCheckbox = element(by.css('#metasubjectsScience')); + var SubjectLabelTwo = element(by.css('.form-group:nth-child(6) > label:nth-child(7)')); + var LanguageArtsCheckbox = element(by.css('#metasubjectsLanguage\\ Arts')); + var SubjectLabelThree = element(by.css('.form-group:nth-child(6) > label:nth-child(10)')); + var SocialStudiesCheckbox = element(by.css('#metasubjectsScience')); + var SubjectLabelFour = element(by.css('.form-group:nth-child(6) > label:nth-child(13)')); + //Alignment Status + var AlignmentStatusLabel = element(by.css('.form-group:nth-child(8) > b')); + var NotAlignedCheckbox = element(by.css('#metaAlignmentStatusNot\\ Aligned')); + var NotAlignedLabel = element(by.css('.form-group:nth-child(8) > label')); + var CountTable = element(by.css('.form-group:nth-child(8)')); + var PendingCheckbox = element(by.css('#metaAlignmentStatusPending')); + var PendingLabel = element(by.css('.form-group:nth-child(8) > label:nth-child(7)')); + var NotAlignedLabelTwo = element(by.linkText('Not Aligned')); + var AlignmentStatusCount = element(by.css('.form-group:nth-child(8)')); + var AlignedLabel = element(by.linkText('Aligned')); + var NeedsReviewLabel = element(by.linkText('Needs Review')); + var PendingLabelTwo = element(by.linkText('Pending')); + //Reset All link + var ResetAllLink = element(by.linkText('Reset All')); + //Content Results + var HomeLink = element(by.linkText('Home')); + var ContentLabel = element(by.css('.breadcrumb-item:nth-child(2)')); + var ResultsCountLabel = element(by.css('#pub > div:nth-child(4)')); + var ThreeVariableLinearSystemWordProblem = element(by.linkText('3-variable linear system word problem')); + var ContentDescriptionOne = element(by.css('.card:nth-child(6) .lo-descr')); + var ContentSetResultLabelOne = element(by.css('.card:nth-child(6) small')); + var ContentViewDetailsButtonOne = element(by.css('.card:nth-child(6) > .card-body > div > .btn')); + var ViewDetatilsContentOne = element(by.css('#content873065498')); + var PendingIcon = element(by.css('.alignment-pending')); + var AlignmentPendingLabel = element(by.linkText('Alignment Pending')); + var ViewStandardsButtonOne = element(by.css('.card:nth-child(6) .well > .btn')); + var DecimalOperations = element(by.linkText('Decimal Operations')); + //View Standards DIV + var ViewStandardsDIVTitle = element(by.css('.modal-title')); + var ViewStandardsDIVXCloseIcon = element(by.css('span:nth-child(1)')); + var ViewStandardsDIVText = element(by.css('.mb-1:nth-child(1)')); + var ViewStandardsDIVStandardsLabel = element(by.css('label > b')); + var ViewStandardsDIVDropDown = element(by.css('#iStateIds')); + var ViewStandardsDIVViewStandardsButton = element(by.css('.btn:nth-child(1)')); + //California Content Standards + var SearchLink = element(by.linkText('Search')); + var ResultsLink = element(by.linkText('Results')); + var CorrelatedStandardsBreadcrumb = element(by.css('.breadcrumb-item:nth-child(3)')); + var ThreeVariableLinearSystemWordProblemDescription = element(by.css('.lo-descr')); + var ViewDetailsButton = element(by.linkText('View Details')); + var ViewDetailsData = element(by.css('#content873065498')); + var CaliforniaContentStandardsLabel = element(by.css('h4')); + var SubjectAndGradeText = element(by.css('strong:nth-child(7)')); + var CAContentStandardsHeaderOne = element(by.css('.card:nth-child(8) > .card-header')); + var ACEDLabelOne = element(by.xpath('//div[2]/div/b')); + var ACEDOne = element(by.id('stdbox')); + var ACEDTwo = element(by.xpath('//div[2]/div[2]')); + var ACEDThree = element(by.xpath('//div[3]/b')); + var ACEDFour = element(by.xpath('//div[2]/div[3]')); + var ACEDFive = element(by.xpath('//div[4]/b')); + var ACEDSix = element(by.xpath('//div[4]')); + var FBFLabel = element(by.xpath('//div[5]/b')); + var FBFOne = element(by.xpath('//div[5]')); + var FBFTwo = element(by.xpath('//div[6]')); + var FBFThree = element(by.xpath('//div[7]/b')); + var FBFFour = element(by.xpath('//div[7]')); + var FBFFive = element(by.xpath('//div[8]/b')); + var FBFSix = element(by.xpath('//div[8]')); + var CAContentStandardsHeaderTwo = element(by.css('.card:nth-child(9) > .card-header')); + var ACEDLabelTwo = element(by.xpath("(//div[@id='stdbox']/b)[7]")); + var ACEDOneTwo = element(by.xpath("(//div[@id='stdbox'])[9]")); + var ACEDTwoTwo = element(by.xpath("(//div[@id='stdbox'])[10]")); + //Verify Language - Only Four Results (saved search) + + browser.executeScript('window.scrollTo(0, 0);').then(function() { + browser.sleep(2500); + }); + await ProfileImage.click().then(function() { + browser.sleep(2500); + }); + browser.actions().mouseMove(SavedSearches).perform().then(function() { + browser.sleep(2500); + }); + await SavedSearches.click().then(function() { + browser.sleep(2500); + }); + browser.wait(EC.visibilityOf(MySavedSearchesTitle), 30000).then(function() { + browser.sleep(2500); + }); + expect(await MySavedSearchesTitle.getText()).toEqual('My Saved Searches'); + expect(await SavedSearchTenthGradeAligned.getText()).toEqual('10th Grade Aligned'); + expect(await SavedSearchDateOne.getText()).toContain('Saved On: May 28, 2021 at 10:55 AM'); + expect(SavedSearchDeleteButtonOne.getCssValue('background-color')).toBe('rgba(220, 53, 69, 1)'); //red + expect(await SavedSearchDeleteButtonOne.getText()).toEqual('Delete'); + expect(await SavedSearchLanguageOnlyFourResults.getText()).toEqual('Language - Only Four Results'); + expect(await SavedSearchDateTwo.getText()).toContain('Saved On: Oct 15, 2021 at 11:12 AM'); + expect(SavedSearchDeleteButtonTwo.getCssValue('background-color')).toBe('rgba(220, 53, 69, 1)'); //red + expect(await SavedSearchDeleteButtonTwo.getText()).toEqual('Delete'); + expect(await SavedSearchMySavedAutomatedList.getText()).toEqual('My saved automated list'); + expect(await SavedSearchDateThree.getText()).toContain('Saved On: '); + expect(SavedSearchDeleteButtonThree.getCssValue('background-color')).toBe('rgba(220, 53, 69, 1)'); //red + expect(await SavedSearchDeleteButtonThree.getText()).toEqual('Delete'); + //Verify Saved Search Info + await SavedSearchMySavedAutomatedList.click().then(function() { + browser.sleep(2500); + }); + browser.wait(EC.visibilityOf(FilterResultsLabel), 30000).then(function() { + browser.sleep(2500); + }); + //Filter Results Table + expect(await FilterResultsLabel.getText()).toEqual('Filter Results'); + //Content Set + expect(await ContentSetLabel.getText()).toEqual('Content Set'); + expect(AlgebraCheckBox.isPresent()).toBe(true); + expect(await ContentSetLabelOne.getText()).toEqual('Algebra'); + expect(await ContentSetCount.getText()).toContain('Algebra (183)'); + //Grade + expect(await GradeLabel.getText()).toEqual('Grade'); + expect(NinethGradeCheckbox.isPresent()).toBe(true); + expect(await GradeLabelOne.getText()).toEqual('9'); + expect(await GradeCount.getText()).toContain('9 (182)'); + expect(TenthGradeCheckbox.isPresent()).toBe(true); + expect(await GradeLabelTwo.getText()).toEqual('10'); + expect(await GradeCount.getText()).toContain('10 (182)'); + expect(EleventhGradeCheckbox.isPresent()).toBe(true); + expect(await GradeLabelThree.getText()).toEqual('11'); + expect(await GradeCount.getText()).toContain('11 (172)'); + expect(TwelfthGradeCheckbox.isPresent()).toBe(true); + expect(await GradeLabelFour.getText()).toEqual('12'); + expect(await GradeCount.getText()).toContain('12 (172)'); + expect(EighthGradeCheckbox.isPresent()).toBe(true); + expect(await GradeLabelFive.getText()).toEqual('8'); + expect(await GradeCount.getText()).toContain('8 (15)'); + expect(await MoreLink.getText()).toEqual('More>>'); + //Subject + expect(await SubjectLabel.getText()).toEqual('Subject'); + expect(MathematicsCheckbox.isPresent()).toBe(true); + expect(await SubjectLabelOne.getText()).toEqual('Mathematics'); + expect(await SubjectCount.getText()).toContain('Mathematics (183)'); + //Alignment Status + expect(await AlignmentStatusLabel.getText()).toEqual('Alignment Status'); + expect(NotAlignedCheckbox.isPresent()).toBe(true); + expect(await NotAlignedLabel.getText()).toEqual('Not Aligned'); + expect(await CountTable.getText()).toContain('Not Aligned (181)'); + expect(PendingCheckbox.isPresent()).toBe(true); + expect(await PendingLabel.getText()).toEqual('Pending'); + expect(await CountTable.getText()).toContain('Pending (2)'); + //Reset All link + expect(await ResetAllLink.getText()).toEqual('Reset All'); + //Content Results + expect(await HomeLink.getText()).toEqual('Home'); + expect(await ContentLabel.getText()).toEqual('Content'); + expect(await ResultsCountLabel.getText()).toEqual('Results 1 - 25 of 183'); + expect(await ThreeVariableLinearSystemWordProblem.getText()).toEqual('3-variable linear system word problem'); + expect(await ContentDescriptionOne.getText()).toContain('Learn how to make the most out of the familiar algebraic techniques in order to solve systems of three equations with three variables.'); + expect(await ContentSetResultLabelOne.getText()).toEqual('Content Set: Algebra'); + expect(ContentViewDetailsButtonOne.getCssValue('background-color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await ContentViewDetailsButtonOne.getText()).toEqual('View Details'); + await ContentViewDetailsButtonOne.click().then(function() { + browser.sleep(2500); + }); + expect(await ViewDetatilsContentOne.getText()).toContain('Content Type: Tutorial'); + expect(await ViewDetatilsContentOne.getText()).toContain('Format: Online Video'); + expect(await ViewDetatilsContentOne.getText()).toContain('Free or Fee: Free'); + expect(await ViewDetatilsContentOne.getText()).toContain('Grade Range: 7 to 12'); + expect(await ViewDetatilsContentOne.getText()).toContain('Language: English'); + expect(await ViewDetatilsContentOne.getText()).toContain('Level-On Target: 9'); + expect(await ViewDetatilsContentOne.getText()).toContain('Login Required: No'); + expect(await ViewDetatilsContentOne.getText()).toContain('Printable: Yes'); + expect(await ViewDetatilsContentOne.getText()).toContain('Source: Khan Academy'); + expect(await ViewDetatilsContentOne.getText()).toContain('Subject(s): Mathematics'); + expect(await ViewDetatilsContentOne.getText()).toContain('Target Audience: Student'); + expect(await ViewDetatilsContentOne.getText()).toContain('Terms of Use: https://www.khanacademy.org/about/tos'); + expect(PendingIcon.isPresent()).toBe(true); + expect(await AlignmentPendingLabel.getText()).toEqual('Alignment Pending'); + expect(ViewStandardsButtonOne.getCssValue('background-color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await ViewStandardsButtonOne.getText()).toEqual('View Standards'); + await ViewStandardsButtonOne.click().then(function() { + browser.sleep(2500); + }); + expect(await ViewStandardsDIVTitle.getText()).toEqual('View Standards'); + expect(ViewStandardsDIVXCloseIcon.isPresent()).toBe(true); + expect(await ViewStandardsDIVText.getText()).toEqual('Please select which standards you wish to view:'); + expect(await ViewStandardsDIVStandardsLabel.getText()).toEqual('Standards'); + expect(await ViewStandardsDIVDropDown.getText()).toContain('Select standards'); + element(by.cssContainingText('option', 'California Standards')).click().then(function() { + browser.sleep(1000); + }); + await ViewStandardsDIVViewStandardsButton.click().then(function() { + browser.sleep(2500); + }); + browser.wait(EC.visibilityOf(SearchLink), 30000).then(function() { + browser.sleep(2500); + }); + //California Content Standards + expect(await SearchLink.getText()).toEqual('Search'); + expect(await ResultsLink.getText()).toEqual('Results'); + expect(await CorrelatedStandardsBreadcrumb.getText()).toEqual('Correlated Standards'); + expect(await ThreeVariableLinearSystemWordProblem.getText()).toEqual('3-variable linear system word problem'); + expect(await ThreeVariableLinearSystemWordProblemDescription.getText()).toEqual('Learn how to make the most out of the familiar algebraic techniques in order to solve systems of three equations with three variables.'); + expect(ViewDetailsButton.getCssValue('background-color')).toBe('rgba(1, 160, 78, 1)'); //green + expect(await ViewDetailsButton.getText()).toEqual('View Details'); + await ViewDetailsButton.click().then(function() { + browser.sleep(2500); + }); + browser.wait(EC.visibilityOf(ViewDetailsData), 30000).then(function() { + browser.sleep(2500); + }); + expect(await ViewDetailsData.getText()).toContain("Expected 'Content Type: Tutorial"); + expect(await ViewDetailsData.getText()).toContain('Format: Online Video'); + expect(await ViewDetailsData.getText()).toContain('Free or Fee: Free'); + expect(await ViewDetailsData.getText()).toContain('Grade Range: 7 to 12'); + expect(await ViewDetailsData.getText()).toContain('Language: English'); + expect(await ViewDetailsData.getText()).toContain('Level-On Target: 9'); + expect(await ViewDetailsData.getText()).toContain('Login Required: No'); + expect(await ViewDetailsData.getText()).toContain('Printable: Yes'); + expect(await ViewDetailsData.getText()).toContain('Source: Khan Academy'); + expect(await ViewDetailsData.getText()).toContain('Subject(s): Mathematics'); + expect(await ViewDetailsData.getText()).toContain('Target Audience: Student'); + expect(await ViewDetailsData.getText()).toContain('Terms of Use: https://www.khanacademy.org/about/tos'); + await ViewDetailsButton.click().then(function() { + browser.sleep(2500); + }); + expect(await CaliforniaContentStandardsLabel.getText()).toEqual('California Content Standards'); + expect(await SubjectAndGradeText.getText()).toEqual('Mathematics - Grade 9'); + expect(await CAContentStandardsHeaderOne.getText()).toEqual('CA.AI. Algebra I'); + expect(await ACEDLabelOne.getText()).toEqual('A-CED.'); + expect(await ACEDOne.getText()).toContain('Algebra: Creating Equations'); + expect(await ACEDTwo.getText()).toEqual('Create equations that describe numbers or relationships. [Linear, quadratic, and exponential (integer inputs only); for A.CED.3 linear only]'); + expect(await ACEDThree.getText()).toEqual('A-CED.1.'); + expect(await ACEDFour.getText()).toContain('Create equations and inequalities in one variable including ones with absolute value and use them to solve problems. Include equations arising from linear and quadratic functions, and simple rational and exponential functions. CA'); + expect(await ACEDFive.getText()).toEqual('A-CED.3.'); + expect(await ACEDSix.getText()).toContain('Represent constraints by equations or inequalities, and by systems of equations and/or inequalities, and interpret solutions as viable or non-viable options in a modeling context. For example, represent inequalities describing nutritional and cost constraints on combinations of different foods.'); + expect(await FBFLabel.getText()).toEqual('F-BF.'); + expect(await FBFOne.getText()).toContain('Functions: Building Functions'); + expect(await FBFTwo.getText()).toEqual('Build a function that models a relationship between two quantities. [For F.BF.1, 2, linear, exponential, and quadratic]'); + expect(await FBFThree.getText()).toEqual('F-BF.1.'); + expect(await FBFFour.getText()).toContain('Write a function that describes a relationship between two quantities.'); + expect(await FBFFive.getText()).toEqual('F-BF.1.a.'); + expect(await FBFSix.getText()).toContain('Determine an explicit expression, a recursive process, or steps for calculation from a context.'); + expect(await CAContentStandardsHeaderTwo.getText()).toEqual('CA.AII. Algebra II'); + expect(await ACEDLabelTwo.getText()).toEqual('A-CED.'); + expect(await ACEDOneTwo.getText()).toContain('Algebra: Creating Equations'); + expect(await ACEDTwoTwo.getText()).toEqual('Create equations that describe numbers or relationships. [Equations using all available types of expressions, including simple root functions]'); + /*Delete last saved search + await ProfileImage.click().then(function() { + browser.sleep(2500); + }); + browser.actions().mouseMove(SavedSearches).perform().then(function() { + browser.sleep(2500); + }); + await SavedSearches.click().then(function() { + browser.sleep(2500); + }); + browser.wait(EC.visibilityOf(MySavedSearchesTitle), 30000).then(function() { + browser.sleep(2500); + }); + expect(await MySavedSearchesTitle.getText()).toEqual('My Saved Searches'); + expect(await SavedSearchTenthGradeAligned.getText()).toEqual('10th Grade Aligned'); + expect(await SavedSearchDateOne.getText()).toContain('Saved On: May 28, 2021 at 10:55 AM'); + expect(SavedSearchDeleteButtonOne.getCssValue('background-color')).toBe('rgba(220, 53, 69, 1)'); //red + expect(await SavedSearchDeleteButtonOne.getText()).toEqual('Delete'); + expect(await SavedSearchLanguageOnlyFourResults.getText()).toEqual('Language - Only Four Results'); + expect(await SavedSearchDateTwo.getText()).toContain('Saved On: Oct 15, 2021 at 11:12 AM'); + expect(SavedSearchDeleteButtonTwo.getCssValue('background-color')).toBe('rgba(220, 53, 69, 1)'); //red + expect(await SavedSearchDeleteButtonTwo.getText()).toEqual('Delete'); + expect(await SavedSearchMySavedAutomatedList.getText()).toEqual('My saved automated list'); + expect(await SavedSearchDateThree.getText()).toContain('Saved On: '); + expect(SavedSearchDeleteButtonThree.getCssValue('background-color')).toBe('rgba(220, 53, 69, 1)'); //red + expect(await SavedSearchDeleteButtonThree.getText()).toEqual('Delete'); + await SavedSearchDeleteButtonThree.click().then(function() { + browser.sleep(1500); + var alertDialog = browser.switchTo().alert(); + expect(alertDialog.getText()).toEqual('Are you sure you want to delete this saved search?'); + browser.switchTo().alert().accept(); + browser.sleep(1500); + }); + //Verify Language - Only Four Results (saved search) + await SavedSearchLanguageOnlyFourResults.click().then(function() { + browser.sleep(2500); + }); + //Filter Results Table + expect(await FilterResultsLabel.getText()).toEqual('Filter Results'); + //Content Set + expect(await ContentSetLabel.getText()).toEqual('Content Set'); + //expect(AlgebraCheckBox.isPresent()).toBe(true); + expect(await ContentSetLabelOne.getText()).toEqual('Demo - User Submitted Content'); + expect(await ContentSetCount.getText()).toContain('Demo - User Submitted Content (16)'); + //Grade + expect(await GradeLabel.getText()).toEqual('Grade'); + expect(NinethGradeCheckbox.isPresent()).toBe(true); + expect(await GradeLabelOne.getText()).toEqual('5'); + expect(await GradeCount.getText()).toContain('5 (5)'); + expect(TenthGradeCheckbox.isPresent()).toBe(true); + expect(await GradeLabelTwo.getText()).toEqual('6'); + expect(await GradeCount.getText()).toContain('6 (4)'); + expect(EleventhGradeCheckbox.isPresent()).toBe(true); + expect(await GradeLabelThree.getText()).toEqual('4'); + expect(await GradeCount.getText()).toContain('4 (3)'); + expect(TwelfthGradeCheckbox.isPresent()).toBe(true); + expect(await GradeLabelFour.getText()).toEqual('2'); + expect(await GradeCount.getText()).toContain('2 (2)'); + expect(EighthGradeCheckbox.isPresent()).toBe(true); + expect(await GradeLabelFive.getText()).toEqual('3'); + expect(await GradeCount.getText()).toContain('3 (2)'); + expect(await MoreLink.getText()).toEqual('More>>'); + //Subject + expect(await SubjectLabel.getText()).toEqual('Subject'); + expect(ScienceCheckbox.isPresent()).toBe(true); + expect(await SubjectLabelOneTwo.getText()).toEqual('Science'); + expect(await SubjectCount.getText()).toContain('Science (12)'); + expect(MathematicsCheckbox.isPresent()).toBe(true); + expect(await SubjectLabelTwo.getText()).toEqual('Mathematics'); + expect(await SubjectCount.getText()).toContain('Mathematics (7)'); + expect(LanguageArtsCheckbox.isPresent()).toBe(true); + expect(await SubjectLabelThree.getText()).toEqual('Language Arts'); + expect(await SubjectCount.getText()).toContain('Language Arts (4)'); + expect(SocialStudiesCheckbox.isPresent()).toBe(true); + expect(await SubjectLabelFour.getText()).toEqual('Social Studies'); + expect(await SubjectCount.getText()).toContain('Social Studies (4)'); + //Alignment Status + expect(await AlignmentStatusLabel.getText()).toEqual('Alignment Status'); + expect(await NotAlignedLabelTwo.getText()).toEqual('Not Aligned'); + expect(await AlignmentStatusCount.getText()).toContain('Not Aligned (13)'); + expect(await AlignedLabel.getText()).toEqual('Aligned'); + expect(await AlignmentStatusCount.getText()).toContain('Aligned (1)'); + expect(await NeedsReviewLabel.getText()).toEqual('Needs Review'); + expect(await AlignmentStatusCount.getText()).toContain('Needs Review (1)'); + expect(await PendingLabelTwo.getText()).toEqual('Pending'); + expect(await AlignmentStatusCount.getText()).toContain('Pending (1)'); + //Reset All link + expect(await ResetAllLink.getText()).toEqual('Reset All'); + //Content Results + expect(await HomeLink.getText()).toEqual('Home'); + expect(await ContentLabel.getText()).toEqual('Content'); + expect(await ResultsCountLabel.getText()).toEqual('Results 1 - 16 of 16'); + expect(await DecimalOperations.getText()).toEqual('Decimal Operations'); + expect(await ContentDescriptionOne.getText()).toContain('Students will review adding, subtracting, and dividing decimals. This lesson includes a review and a quiz.'); + expect(await ContentDescriptionOne.getText()).toContain('Content Set: Demo - User Submitted Content'); + expect(await ContentSetResultLabelOne.getText()).toEqual('Content Set: Demo - User Submitted Content'); + expect(ContentViewDetailsButtonOne.getCssValue('background-color')).toBe('rgba(1, 160, 78, 1)'); //green*/ + }); +} + +function SignOut() { + it(': SignOut, should log out of ExACT.', async function () { + var ProfileImage = element(by.css('#navbarDropdown > span')); + var LogOutLinkText = element(by.linkText('Log Out')); + var EC = protractor.ExpectedConditions; + var ExACTLogo = element(by.css('#formLogin > img')); + + browser.executeScript('window.scrollTo(0, 0);').then(function() { + browser.sleep(2500); + }); + await ProfileImage.click().then(function() { + browser.sleep(2500); + }); + browser.actions().mouseMove(LogOutLinkText).perform().then(function() { + browser.sleep(2500); + }); + await LogOutLinkText.click().then(function() { + browser.sleep(2500); + }); + browser.wait(EC.visibilityOf(ExACTLogo), 30000).then(function() { + browser.sleep(2500); + }); + expect(ExACTLogo.isPresent()).toBe(true); + }); +} \ No newline at end of file