Skip to content

Commit a4962d5

Browse files
committed
Add automation script for Project Setting page.
Add automation script for Project Setting page.
1 parent 7d8d768 commit a4962d5

File tree

11 files changed

+965
-8
lines changed

11 files changed

+965
-8
lines changed

connect-automation/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Chrome Browser
1111
`npm install`
1212

1313
- To run tests
14-
`cd connect-app-e2e-test`
14+
`cd connect-automation`
1515
`npm run test`
1616

1717
- Test results are generated in test-results/ folder

connect-automation/conf.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ exports.config = {
4141
'../temp/test-suites/project-creation-flow/create-project.spec.js',
4242
'../temp/test-suites/project-creation-flow/invite-copilot.spec.js',
4343
'../temp/test-suites/project-creation-flow/projects.spec.js',
44-
'../temp/test-suites/phase-creation-flow/create-new-phase.spec.js'
44+
'../temp/test-suites/phase-creation-flow/create-new-phase.spec.js',
45+
'../temp/test-suites/project-settings-flow/project-settings.spec.js'
4546
],
4647

4748
// Options to be passed to Jasmine.

connect-automation/config/config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@
2222
"notificationSettingsUrl": "https://connect.topcoder-dev.com/settings/notifications",
2323
"accountAndSecurityUrl": "https://connect.topcoder-dev.com/settings/account",
2424
"notificationsUrl": "https://connect.topcoder-dev.com/notifications",
25-
"allProjectsUrl": "https://connect.topcoder-dev.com/projects"
25+
"allProjectsUrl": "https://connect.topcoder-dev.com/projects",
26+
"givenProjectUrl": "https://connect.topcoder-dev.com/projects/17236"
2627
}

connect-automation/page-objects/common-page/common.helper.ts

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import moment = require('moment');
2-
import { BrowserStack } from 'protractor/built/driverProviders';
32
import { BrowserHelper, ElementHelper } from 'topcoder-testing-lib';
43
import * as appconfig from '../../config/app-config.json';
54
import { logger } from '../../logger/logger';
@@ -27,8 +26,8 @@ const waitUntil = async (
2726
(isPageLoad
2827
? appconfig.LoggerErrors.PageLoad
2928
: appconfig.LoggerErrors.ElementVisibilty) +
30-
'.' +
31-
extraMessage
29+
'.' +
30+
extraMessage
3231
);
3332
};
3433

@@ -108,8 +107,8 @@ export const CommonHelper = {
108107
(isPageLoad
109108
? appconfig.LoggerErrors.PageLoad
110109
: appconfig.LoggerErrors.ElementPresence) +
111-
'.' +
112-
extraMessage
110+
'.' +
111+
extraMessage
113112
);
114113
},
115114

@@ -324,4 +323,48 @@ export const CommonHelper = {
324323
get createPhasePageTitle() {
325324
return ElementHelper.getElementByClassName('_2edGvU');
326325
},
326+
327+
/**
328+
* Wait for Page Element to be displayed
329+
*/
330+
async waitForElementToGetDisplayed(element) {
331+
await CommonHelper.waitUntilVisibilityOf(
332+
() => element,
333+
'Wait for Element To get Displayed',
334+
true
335+
);
336+
return element;
337+
},
338+
339+
/**
340+
* Get Alert Box
341+
*/
342+
get getAlertBox() {
343+
BrowserHelper.sleep(1000);
344+
return ElementHelper.getElementByXPath('//div[@class="s-alert-box-inner"]/span');
345+
},
346+
347+
/**
348+
* Checks if element is present or not on page
349+
*
350+
* @param identifierType Type of Identifier
351+
* @param identifierValue Identifier Value to search
352+
*
353+
* @returns Either True or False
354+
*/
355+
async isElementPresent(identifierType: string, identifierValue: string) {
356+
let isElementPresent = true;
357+
let element: TcElementImpl;
358+
try {
359+
switch(identifierType.toLowerCase()) {
360+
case 'xpath': element = ElementHelper.getElementByXPath(identifierValue); break;
361+
}
362+
const isElementDisplayed = await element.isDisplayed();
363+
const isElementEnabled = await element.isEnabled();
364+
isElementPresent = (isElementDisplayed && isElementEnabled) ? true: false;
365+
} catch(error) {
366+
isElementPresent = false;
367+
}
368+
return isElementPresent;
369+
},
327370
};

0 commit comments

Comments
 (0)