Added QA & Prod variables

This commit is contained in:
2020-08-27 10:21:03 -07:00
parent 6f03d808f1
commit 631785d7d5
18 changed files with 284 additions and 86 deletions

View File

@@ -0,0 +1,107 @@
//beginCareerExplorationWidget_spec.js
describe('Begin Career Exploration Widget script', function () {
//login-journeysmap landing page
var UserNameTextBox = element(by.css('#txtU'));
var PasswordTextBox = element(by.css('#txtP'));
//Open browser
browser.get(browser.params.login);
it('should have a title', async function () {
await expect(browser.getTitle()).toEqual('Login');
});
//Sign In
SignIn(UserNameTextBox, PasswordTextBox);
it('should have a title', async function () {
await expect(browser.getTitle()).toEqual('My Dashboard');
});
//Sign In
SignIn(UserNameTextBox, PasswordTextBox);
function SignIn(UserNameTextBox, PasswordTextBox) {
it('SignIn, should sign into journeysmap.com', async function () {
var PageGreetingText = element(by.css('//td > div > div:nth-child(1)'));
var NextButton = element(by.css('.btn'));
var JourneysGreeting = element(by.css('.dropdown'));
expect(await PageGreetingText.getText()).toEqual('Login and start exploring.');
browser.sleep(2500);
await UserNameTextBox.sendKeys(browser.params.userName).then(function() {
browser.sleep(2500);
});
await PasswordTextBox.sendKeys('3Dm!nAuto').then(function() {
browser.sleep(2500);
});
await NextButton.click().then(function() {
browser.sleep(5000);
browser.waitForAngular();
browser.getCurrentUrl();
});
expect(await JourneysGreeting.getText()).toEqual('Hi, Automated');
browser.waitForAngular();
browser.getCurrentUrl();
});
}
//<<<<DASHBOARD>>>>
//BeginCareerExplorationWidget();
SignOut();
});
function BeginCareerExplorationWidget() {
it(': BeginCareerExplorationWidget, should interact with Begin Career Exploration widget', async function () {
var BeginCareerExplorationTitle = element(by.css('tbody .jrnys_lead-body-copy'));
var BeginCareerExplorationDescription = element(by.css('.fullHeight:nth-child(1) > table > tbody > tr:nth-child(3) > td'));
var ExploreCareersButton = element(by.css('td > .btn'));
var CareerExplorationPageTitle = element(by.css('.col-sm-12'));
var SearchOccupationsTextBox = element(by.css('.ng-dirty'));
var SkillsFilterButton = element(by.css('div:nth-child(3) > .filter-category:nth-child(3)'));
var InterestsFilterButton = element(by.css('.filter-category:nth-child(4)'));
var WidgetText = element(by.css('.row > .jrnys_lead-body-copy'));
var WidgetSubText = element(by.css('.row > span:nth-child(2)'));
var DashboardHeaderLink = element(by.css('.ng-scope:nth-child(1) > a > .span-navbar-hover'));
browser.executeScript('window.scrollTo(0, 610);').then(function() {
browser.sleep(5000);
});
expect(await BeginCareerExplorationTitle.getText()).toEqual('Begin Career Exploration');
expect(await BeginCareerExplorationDescription.getText()).toEqual('We like your adventurous spirit. Search for a career that aligns with your interests and Learn More about it.');
await ExploreCareersButton.click().then(function() {
browser.sleep(10000);
});
expect(await CareerExplorationPageTitle.getText()).toEqual('1');
expect(await SkillsFilterButton.getText()).toEqual('2');
expect(await InterestsFilterButton.getText()).toEqual('3');
expect(await WidgetText.getText()).toEqual('4');
expect(await WidgetSubText.getText()).toEqual('5');
await DashboardHeaderLink.click().then(function() {
browser.sleep(10000);
});
browser.waitForAngular();
browser.getCurrentUrl();
});
}
function SignOut() {
it(': SignOut, should log out of journeysmap', async function () {
var ProfileImage = element(by.css('.roundCenterBackgroundImage'));
var SignOutButton = element(by.css('.dropDownFAEdits:nth-child(5) > .btn'));
browser.waitForAngular();
browser.sleep(1000);
await ProfileImage.click();
browser.sleep(1000);
browser.waitForAngular();
browser.getCurrentUrl();
await SignOutButton.click().then(function() {
browser.sleep(2500);
});
});
}