Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ npm-debug.log
.history
.build-info
.idea

# e2e test case
connect-automation/temp
connect-automation/test-results
39 changes: 39 additions & 0 deletions connect-automation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Topcoder Connect App - E2E Tests

#### Software Required

Nodejs v8.11.4+
Chrome Browser

#### Installation:

- Installs
`npm install`

- To run tests
`cd connect-app-e2e-test`
`npm run test`

- Test results are generated in test-results/ folder

```
HTML report - TestResult.html
Junit report - junitresults-TopcoderLoginPageTests.xml and junitresults-TopcoderRegistrationPageTests.xml
```

- To view junit reports into html, install xunit-viewer
`npm i -g xunit-viewer`

- HTML report from Junit reports can be generated using this command
`xunit-viewer --results=test-results/ --output=/home/Documents/`

As of now, the tests are running in headless mode. To view the actual chrom browser running the tests, you can remove `--headless` option from `chromeOptions.args` in `config.ts`

#### Test Datas:

- Test datas are located in /test-data/test-data.json file

#### Configuration details:

- config.json holds the data level configuration, like user credentials etc
- conf.ts holds the application configuration, like jasmine reporters to be configured, specs to be run etc.
76 changes: 76 additions & 0 deletions connect-automation/conf.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import reporters = require('jasmine-reporters');
import HtmlReporter = require('protractor-beautiful-reporter');
import { BrowserHelper } from 'topcoder-testing-lib';

declare global {
namespace NodeJS {
interface IGlobal {
document: Document;
window: Window;
navigator: Navigator;
forgotPasswordMailListener: any;
registrationMailListener: any;
}
}
}

exports.config = {
directConnect: true,

// Capabilities to be passed to the webdriver instance.
capabilities: {
browserName: 'chrome',
chromeOptions: {
args: [
'--headless',
'--disable-gpu',
'--no-sandbox',
'--window-size=1325x744',
],
},
},

// Framework to use. Jasmine is recommended.
framework: 'jasmine2',

specs: [
'../temp/test-suites/profile-update/my-profile.spec.js',
'../temp/test-suites/profile-update/left-menu.spec.js',
'../temp/test-suites/profile-update/user-profile-menu.spec.js',
'../temp/test-suites/profile-update/footer-menu.spec.js',
'../temp/test-suites/project-creation-flow/create-project.spec.js',
'../temp/test-suites/project-creation-flow/invite-copilot.spec.js',
'../temp/test-suites/project-creation-flow/projects.spec.js',
'../temp/test-suites/phase-creation-flow/create-new-phase.spec.js'
],

// Options to be passed to Jasmine.
jasmineNodeOpts: {
defaultTimeoutInterval: 1200000, // 20 minutes
isVerbose: true,
showColors: true,
},

onPrepare: () => {
BrowserHelper.maximize();
BrowserHelper.implicitlyWait(5000);
const junitReporter = new reporters.JUnitXmlReporter({
consolidateAll: false,
savePath: 'test-results',
});
jasmine.getEnv().addReporter(junitReporter);
jasmine.getEnv().addReporter(
new HtmlReporter({
baseDirectory: 'test-results',
docName: 'TestResult.html', // Change html report file name
docTitle: 'Test Automation Execution Report', // Add title for the html report
gatherBrowserLogs: true, // Store Browser logs
jsonsSubfolder: 'jsons', // JSONs Subfolder
preserveDirectory: false, // Preserve base directory
screenshotsSubfolder: 'screenshots',
takeScreenShotsForSkippedSpecs: true, // Screenshots for skipped test cases
takeScreenShotsOnlyForFailedSpecs: true, // Screenshots only for failed test cases
}).getJasmine2Reporter()
);
},
};
18 changes: 18 additions & 0 deletions connect-automation/config/app-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"Timeout": {
"FieldVisibility": 15000,
"ElementVisibility": 15000,
"ElementInvisibility": 15000,
"ElementPresence": 15000,
"ElementClickable": 15000,
"PageLoad": 300000
},

"LoggerErrors": {
"ElementVisibilty": "Element did not display within timeout",
"ElementInvisibilty": "Element did not become invisible within timeout",
"ElementPresence": "Element was not present within timeout",
"ElementClickable": "Element was not clickable within timeout",
"PageLoad": "Page did not load within timeout"
}
}
26 changes: 26 additions & 0 deletions connect-automation/config/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"env": "dev",
"username": "mailmemakar402",
"password": "P@ssw0rd",
"customerRole": {
"email": "topcoderconnect+Customer@gmail.com",
"password": "appirio123"
},
"copilotRole": {
"email": "topcoderconnect+Copilot@gmail.com",
"password": "appirio123"
},
"copilotManagerRole": {
"email": "topcoderconnect+CopilotManager@gmail.com",
"password": "appirio123"
},
"homePageUrl": "https://connect.topcoder-dev.com/",
"loginUrl": "https://auth.topcoder-dev.com",
"redirectLoginUrl": "https://accounts-auth0.topcoder-dev.com/?regSource=tcBusiness&retUrl=https://connect.topcoder-dev.com",
"logoutUrl": "https://accounts-auth0.topcoder-dev.com/?logout=true&retUrl=https://connect.topcoder-dev.com",
"myProfileUrl": "https://connect.topcoder-dev.com/settings/profile",
"notificationSettingsUrl": "https://connect.topcoder-dev.com/settings/notifications",
"accountAndSecurityUrl": "https://connect.topcoder-dev.com/settings/account",
"notificationsUrl": "https://connect.topcoder-dev.com/notifications",
"allProjectsUrl": "https://connect.topcoder-dev.com/projects"
}
4 changes: 4 additions & 0 deletions connect-automation/logger/logger.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { createLogger, transports } from "winston";
export const logger = createLogger({
transports: [new transports.Console()]
});
Loading