Updated SignIn and SignOut calls

This commit is contained in:
2020-11-13 12:30:27 -08:00
parent 9ead4d157f
commit f6eaf6b361
13 changed files with 256 additions and 246 deletions

View File

@@ -15,6 +15,10 @@ describe('Interest Survey Results Widget Script', function () {
//Sign In
SignIn(UserNameTextBox, PasswordTextBox);
it('should have a title', async function () {
await expect(browser.getTitle()).toEqual('My Dashboard');
});
function SignIn(UserNameTextBox, PasswordTextBox) {
it('SignIn, should sign into journeysmap.com', async function () {
var PageGreetingText = element(by.css('td > div > div:nth-child(1)'));
@@ -22,17 +26,15 @@ describe('Interest Survey Results Widget Script', function () {
var JourneysGreeting = element(by.css('.dropdown'));
expect(await PageGreetingText.getText()).toEqual('Login and start exploring.');
browser.sleep(2500);
browser.sleep(1500);
await UserNameTextBox.sendKeys(browser.params.username).then(function() {
browser.sleep(2500);
browser.sleep(1500);
});
await PasswordTextBox.sendKeys('3Dm!nAuto').then(function() {
browser.sleep(2500);
browser.sleep(1500);
});
await NextButton.click().then(function() {
browser.sleep(5000);
browser.waitForAngular();
browser.getCurrentUrl();
});
expect(await JourneysGreeting.getText()).toContain('Hi, ');
expect(await JourneysGreeting.getText()).toContain('_Automated');
@@ -41,7 +43,6 @@ describe('Interest Survey Results Widget Script', function () {
});
}
//<<<<DASHBOARD>>>>
InterestSurveyResultsWidget();
InterestSurveyResultsWidgetRetake();
InterestSurveyResultsWidgetEdit();
@@ -130,6 +131,7 @@ function InterestSurveyResultsWidgetRetake() {
var CancelTestButton = element(by.css('.btn-md'));
var PageTitle = element(by.css('.surveyContainer > .col-xs-offset-1'));
var DashboardHeaderLink = element(by.css('.navbar-brand > img'));
var MyCareersWidgetTitle = element(by.css('.fullHeight > .jrnys_lead-body-copy'));
var AdministrativeLawJudgesAdjudicatorsAndHearingOfficers = element(by.xpath('//div[3]/div/div[2]/span'));
var AdministrativeServicesManagers = element(by.xpath('//div[2]/div/career-territory-card/territory-card/div/div/div[3]/div/div[2]/span'));
var AirTrafficControllers = element(by.xpath('//div[3]/div/career-territory-card/territory-card/div/div/div[3]/div/div[2]/span'));
@@ -207,8 +209,9 @@ function InterestSurveyResultsWidgetRetake() {
await LoveItEmoji.click();
await LikeItEmoji.click();
await LoveItEmoji.click();
await LikeItEmoji.click();//60
browser.sleep(5000);
await LikeItEmoji.click().then(function() {
browser.sleep(5000);
});
expect(await PageTitle.getText()).toEqual('Interest Survey Results');
browser.sleep(5000);
await DashboardHeaderLink.click().then(function() {
@@ -217,6 +220,7 @@ function InterestSurveyResultsWidgetRetake() {
browser.executeScript('window.scrollTo(0, 1250);').then(function() {
browser.sleep(5000);
});
expect(await MyCareersWidgetTitle.getText()).toEqual('1');
expect(await AdministrativeLawJudgesAdjudicatorsAndHearingOfficers.getText()).not.toEqual('Administrative Law Judges, Adjudicators, and Hearing Officers');
expect(await AdministrativeServicesManagers.getText()).not.toEqual('Administrative Services Managers');
expect(await AirTrafficControllers.getText()).not.toEqual('Air Traffic Controllers');
@@ -248,6 +252,7 @@ function InterestSurveyResultsWidgetEdit() {
var EditConventionalTextBox = element(by.id('Conventional'));
var EditConventionalDescription = element(by.css('.ng-scope:nth-child(6) .color3a-color'));
var EditInterestSurveyDIVSaveButton = element(by.css('.btn-info:nth-child(2)'));
var MyCareersWidgetTitle = element(by.css('.fullHeight > .jrnys_lead-body-copy'));
var AdministrativeLawJudgesAdjudicatorsAndHearingOfficers = element(by.css('#\\39 d53706e-b04f-4fcb-a36e-d9c48934c2e1 > #territoryCardContainer .territoryCardTitleText > .ng-binding'));
var AdministrativeLawJudgesAdjudicatorsAndHearingOfficersAtAGlanceIcon = element(by.css('#\\39 d53706e-b04f-4fcb-a36e-d9c48934c2e1 > #territoryCardContainer > div > div > div .territoryCardItemText'));
var AdministrativeLawJudgesAdjudicatorsAndHearingOfficersAtBestFitIcon = element(by.css('#\\39 d53706e-b04f-4fcb-a36e-d9c48934c2e1 > #territoryCardContainer .ng-scope > div > div:nth-child(1) > .territoryCardItemText'));
@@ -289,41 +294,50 @@ function InterestSurveyResultsWidgetEdit() {
expect(await EditInterestDIVTitle.getText()).toEqual('Interests');
expect(await EditRealisticTitle.getText()).toEqual('Realistic');
await EditRealisticTextBox.clear();
await EditRealisticTextBox.sendKeys('21');
await EditRealisticTextBox.sendKeys('21').then(function() {
browser.sleep(1000);
});
//await EditRealisticTextBox.sendKeys(protractor.Key.CONTROL, "a", protractor.Key.DELETE).sendKeys('21').sendKeys(protractor.Key.TAB); SAMPLE
browser.sleep(1000);
expect(await EditRealisticDescription.getText()).toEqual('You see things as they are and rely most heavily on your sense of sight and touch.');
expect(await EditInvestigativeTitle.getText()).toEqual('Investigative');
await EditInvestigaviveTextBox.clear();
await EditInvestigaviveTextBox.sendKeys('25');
browser.sleep(1000);
await EditInvestigaviveTextBox.sendKeys('25').then(function() {
browser.sleep(1000);
});
expect(await EditInvestigativeDescription.getText()).toEqual('You’re a super sleuth who loves to solve math and science problems.');
expect(await EditArtisticTitle.getText()).toEqual('Artistic');
await EditArtisticTextBox.clear();
await EditArtisticTextBox.sendKeys('17');
browser.sleep(1000);
await EditArtisticTextBox.sendKeys('17').then(function() {
browser.sleep(1000);
});
expect(await EditArtisticDescription.getText()).toEqual('Your electives are full of art, drama, creative writing, and music classes.');
expect(await EditSocialTitle.getText()).toEqual('Social');
await EditSocialTextBox.clear();
await EditSocialTextBox.sendKeys('22');
browser.sleep(1000);
await EditSocialTextBox.sendKeys('22').then(function() {
browser.sleep(1000);
});
expect(await EditSocialDescription.getText()).toEqual('You’re a friend to everyone. You like to help, interact and share information.');
expect(await EditEnterprisingTitle.getText()).toEqual('Enterprising');
await EditEnterprisingTextBox.clear();
await EditEnterprisingTextBox.sendKeys('27');
browser.sleep(1000);
await EditEnterprisingTextBox.sendKeys('27').then(function() {
browser.sleep(1000);
});
expect(await EditEnterprisingDescription.getText()).toEqual('You’re persuasive and could sell just about anything to anyone.');
expect(await EditConventionalTitle.getText()).toEqual('Conventional');
await EditConventionalTextBox.clear();
await EditConventionalTextBox.sendKeys('23');
browser.sleep(1000);
expect(await EditConventionalDescription.getText()).toEqual('People might call you TYPE A, but they’re just jealous of your ability to get things done.');
browser.sleep(1000);
await EditInterestSurveyDIVSaveButton.click();
browser.sleep(1000);
await EditConventionalTextBox.sendKeys('23').then(function() {
browser.sleep(1000);
});
expect(await EditConventionalDescription.getText()).toEqual('People might call you TYPE A, but they’re just jealous of your ability to get things done.').then(function() {
browser.sleep(1000);
});
await EditInterestSurveyDIVSaveButton.click().then(function() {
browser.sleep(1000);
});
browser.executeScript('window.scrollTo(0, 1250);').then(function() {
browser.sleep(5000);
});
expect(await MyCareersWidgetTitle.getText()).toEqual('1');
expect(await AdministrativeLawJudgesAdjudicatorsAndHearingOfficers.getText()).toEqual('Administrative Law Judges, Adjudicators, and Hearing Officers');
expect(await AdministrativeLawJudgesAdjudicatorsAndHearingOfficersAtAGlanceIcon.getText()).toContain('At a');
expect(await AdministrativeLawJudgesAdjudicatorsAndHearingOfficersAtAGlanceIcon.getText()).toContain('Glance');
@@ -354,32 +368,39 @@ function InterestSurveyResultsWidgetEdit() {
expect(await TopTraitsDescriptionSix.getText()).toEqual('People who are creative, intuitive, sensitive, articulate, expressive, unstructured, original, nonconforming, and innovative who rely on feelings, imagination, inspiration and who are spontaneous and open-minded. They prefer to work with ideas, abstractions, and concepts. They also enjoy work that is literary, verbal, visual and aesthetic. They typically excel in art, music, dance, drawing, painting, sculpting, drafting, writing, drama, communicating, design, fashion.');
await ShareResultsIcon.click();
expect(await ShareResultsDIVTitle.getText()).toEqual('Email Your Results');
await SendButton.click();
browser.sleep(1000);
await SendButton.click().then(function() {
browser.sleep(1000);
});
expect(await DIVAlertTitle.getText()).toEqual('No Email');
expect(await DIVAlertMessage.getText()).toEqual('Please provide at least one email address to send.');
await DIVOKButton.click();
browser.waitForAngular();
await DIVOKButton.click().then(function() {
browser.waitForAngular();
});
await ToTextBox.sendKeys('jhuerta@edmin');
await SendButton.click();
browser.sleep(1000);
await SendButton.click().then(function() {
browser.sleep(1000);
});
expect(await DIVAlertTitle.getText()).toEqual('Invalid Email');
expect(await DIVAlertMessage.getText()).toEqual('jhuerta@edmin is not a valid email address.');
await DIVOKButton.click();
browser.sleep(1000);
await DIVOKButton.click().then(function() {
browser.sleep(1000);
});
await CancelButton.click();
/*browser.waitForAngular();//INCONSISTENT
await ShareResultsIcon.click();
await FromTextBox.clear();
await FromTextBox.sendKeys("Juan's Automated Regression");
await ToTextBox.sendKeys('jhuerta@edmin.com');
browser.sleep(1000);
await SendButton.click();
browser.sleep(2500);
await ToTextBox.sendKeys('jhuerta@edmin.com').then(function() {
browser.sleep(1000);
});
await SendButton.click().then(function() {
browser.sleep(25000);
});
await expect(DIVAlertTitle.getText()).toEqual('Your interest survey results are in flight!');
await expect(DIVAlertMessage.getText()).toEqual('Trouble receiving the email? Have your recipient check their spam folder for an email from hi@journeysmap.com');
await DIVOKButton.click();
browser.waitForAngular();
await DIVOKButton.click().then(function() {
browser.waitForAngular();
});
browser.wait(EC.elementToBeClickable(ShareResultsIcon));*/
browser.waitForAngular();
browser.getCurrentUrl();
@@ -671,8 +692,8 @@ function InterestSurveyResultsWidgetResults() {
expect(await HydroelectricProductionManagersEllipsisAtAGlanceIcon.getText()).toEqual('At A Glance');
await HydroelectricProductionManagersEllipsisJourneymanIcon.click().then(function() {
browser.sleep(5000);
browser.waitForAngular();
});
browser.waitForAngular();
browser.wait(EC.elementToBeClickable(HydroelectricProductionManagersJourneyInfoIcon));
browser.waitForAngular();
browser.getCurrentUrl();
@@ -745,9 +766,9 @@ function InterestSurveyResultsCreateJourney() {
expect(await JourneyResultTitleOne.getText()).toEqual('9 to Hydroelectric Production Managers through Business Administration B.A./B.S.');
await DashboardHeaderLink.click().then(function() {
browser.sleep(5000);
browser.waitForAngular();
browser.getCurrentUrl();
});
browser.waitForAngular();
browser.getCurrentUrl();
});
}
@@ -908,12 +929,14 @@ function SignOut() {
var ProfileImage = element(by.css('.roundCenterBackgroundImage'));
var SignOutButton = element(by.css('.dropDownFAEdits:nth-child(5) > .btn'));
browser.waitForAngular();
browser.sleep(1000);
await ProfileImage.click();
browser.sleep(1000);
browser.waitForAngular();
browser.getCurrentUrl();
browser.waitForAngular().then(function() {
browser.sleep(1000);
});
await ProfileImage.click().then(function() {
browser.sleep(1000);
browser.waitForAngular();
browser.getCurrentUrl();
});
await SignOutButton.click().then(function() {
browser.sleep(2500);
});