Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
dc1bda3
Initial script for automation script.
drasticdpk May 31, 2021
afbad8e
Remove unnecessary file
drasticdpk May 31, 2021
6f71fe4
update git ignore file
drasticdpk May 31, 2021
04fa2e2
CirecleCI smoke test config
maxceem Jun 3, 2021
8e04ffd
CirecleCI smoke test: fix bash file permissions
maxceem Jun 3, 2021
06a0ac1
CircleCI smoe test: config running
maxceem Jun 3, 2021
2d42dd6
CircleCI smoke test: fix schema issues
maxceem Jun 3, 2021
4e1d337
CircleCI smoke test: create only test task without deploy
maxceem Jun 3, 2021
a37d5bf
CircleCI smoke test: change default docker image
maxceem Jun 3, 2021
707ad81
CircleCI smoke test: use separate docker image
maxceem Jun 3, 2021
43786a8
CircleCI smoke test: use commong image for build/test
maxceem Jun 3, 2021
355dcc4
CricleCI smoke test: use separate images for build/test
maxceem Jun 3, 2021
d82cd09
CircleCI smoke test: fix test dependecies
maxceem Jun 3, 2021
5665adc
CricleCI smoke test: fix artifacts path
maxceem Jun 3, 2021
e550eb9
exclude phase creation test case.
drasticdpk Jun 8, 2021
c403311
Flow verification.
drasticdpk Jun 8, 2021
00ff406
Final changes.
drasticdpk Jun 8, 2021
3ec925a
fix phase creation test (#4396)
nursoltan-s Jun 9, 2021
dcbd8a5
Merge branch 'dev' into connect-automation
maxceem Jun 16, 2021
bcfbce0
Merge pull request #4389 from appirio-tech/connect-automation
maxceem Jun 16, 2021
7d8d768
chore: trigger deploying
maxceem Jun 16, 2021
a4962d5
Add automation script for Project Setting page.
drasticdpk Jul 5, 2021
a11b10f
fix failing tests circle ci (#4400)
nursoltan-s Jul 6, 2021
433dcd5
fix tc_004 test (#4401)
nursoltan-s Jul 6, 2021
6cbd9fa
Updated dead privacy link
Jul 8, 2021
da96bbe
Feature/copilot feedback (#4408)
Jul 12, 2021
41c97d3
Merge pull request #4409 from appirio-tech/feature/fix-dead-privacy-l…
Jul 12, 2021
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
78 changes: 75 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,39 @@
version: 2
version: 2.1
parameters:
run_basedeployment:
default: true
type: boolean
run_smoketesting:
default: false
type: boolean

defaults: &defaults
docker:
- image: node:14

deploy_defaults: &deploy_defaults
docker:
- image: cibuilds/aws

test_defaults: &test_defaults
docker:
- image: docker:17.11.0-ce-git

install_dependency: &install_dependency
name: Installation of build and deployment dependencies.
command: |
apt update
apt install jq -y
apt install python-dev python-pip -y
pip install awscli --upgrade
install_test_dependency: &install_test_dependency
name: Installation of build and deployment dependencies.
command: |
apk update
apk add --no-cache bash openssl curl
apk upgrade
apk add --no-cache jq py-pip sudo
sudo pip install awscli --upgrade
install_deploysuite: &install_deploysuite
name: Installation of install_deploysuite.
command: |
Expand Down Expand Up @@ -66,6 +88,36 @@ deploy_steps: &deploy_steps
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-connectapp-deployvar
source buildenvvar
./master_deploy.sh -d CFRONT -e $DEPLOY_ENV -c $ENABLE_CACHE
curl --request POST \
--url https://circleci.com/api/v2/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pipeline \
--header "Circle-Token: ${CIRCLE_TOKEN}" \
--header 'content-type: application/json' \
--data '{"branch":"'"$CIRCLE_BRANCH"'","parameters":{"run_smoketesting":true, "run_basedeployment": false}}'


# Automated Smoke Testing
smoke_testing: &smoke_testing
# Initialization.
- checkout
- setup_remote_docker
- run: *install_test_dependency
- run: *install_deploysuite
# Restoration of node_modules from cache.
- restore_cache: *restore_cache_settings_for_build
- run:
name: "configuring environment"
command: |
./awsconfiguration.sh $DEPLOY_ENV
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-connectapp-buildvar
- run:
name: "Run automation"
no_output_timeout: 20m
command: |
source awsenvconf
source buildenvvar
./connect-automation/smoketest.sh
- store_artifacts:
path: ./connect-automation/test-results

jobs:
build-dev:
Expand Down Expand Up @@ -107,9 +159,17 @@ jobs:
ENABLE_CACHE: true
steps: *deploy_steps

smoke-testing-dev:
<<: *test_defaults
environment:
DEPLOY_ENV: "DEV"
LOGICAL_ENV: "dev"
steps: *smoke_testing

workflows:
version: 2
build:
when: << pipeline.parameters.run_basedeployment >>
jobs:
- build-dev:
context : org-global
Expand All @@ -126,9 +186,9 @@ workflows:
context : org-global
requires:
- build-dev
filters:
filters: &filters-dev
branches:
only: ['dev', 'feature/billing_account_protection']
only: ['dev', 'feature/copilot-feedback']

- deployTest01:
context : org-global
Expand All @@ -145,3 +205,15 @@ workflows:
filters:
branches:
only: master

Smoke Testing:
when: << pipeline.parameters.run_smoketesting >>
jobs:
- Hold [Smoke-Testing]:
type: approval
- smoke-testing-dev:
context : org-global
requires:
- Hold [Smoke-Testing]
filters:
<<: *filters-dev
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
1 change: 1 addition & 0 deletions config/constants/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ module.exports = {

ACCOUNTS_APP_URL : 'https://accounts-auth0.topcoder-dev.com',
ACCOUNTS_APP_CONNECTOR_URL : 'https://accounts-auth0.topcoder-dev.com',
TYPEFORM_URL : 'https://topcoder.typeform.com/to/vgqiBXdk',

FILE_PICKER_API_KEY: process.env.FILE_PICKER_API_KEY_DEV,
FILE_PICKER_SUBMISSION_CONTAINER_NAME: 'submission-staging-dev',
Expand Down
1 change: 1 addition & 0 deletions config/constants/master.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module.exports = {

ACCOUNTS_APP_URL : 'https://accounts-auth0.topcoder.com',
ACCOUNTS_APP_CONNECTOR_URL : 'https://accounts-auth0.topcoder.com',
TYPEFORM_URL : 'https://topcoder.typeform.com/to/vgqiBXdk',

FILE_PICKER_API_KEY: process.env.FILE_PICKER_API_KEY_PROD,
FILE_PICKER_SUBMISSION_CONTAINER_NAME: 'submission-staging-prod',
Expand Down
1 change: 1 addition & 0 deletions config/constants/qa.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ module.exports = {

ACCOUNTS_APP_URL : 'https://accounts.topcoder-qa.com/#!/member',
ACCOUNTS_APP_CONNECTOR_URL : 'https://accounts.topcoder-qa.com/connector.html',
TYPEFORM_URL : 'https://topcoder.typeform.com/to/vgqiBXdk',

FILE_PICKER_API_KEY: process.env.FILE_PICKER_API_KEY_QA,
FILE_PICKER_SUBMISSION_CONTAINER_NAME: 'submission-staging-qa',
Expand Down
32 changes: 32 additions & 0 deletions connect-automation/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM node:10.17.0-stretch
RUN apt update
RUN apt install sudo
RUN sudo apt-get update; sudo apt-get install -y openjdk-8-jre openjdk-8-jre-headless openjdk-8-jdk openjdk-8-jdk-headless;
RUN curl --silent --show-error --location --fail --retry 3 --output /tmp/google-chrome-stable_current_amd64.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
&& (sudo dpkg -i /tmp/google-chrome-stable_current_amd64.deb || sudo apt-get -fy install) \
&& rm -rf /tmp/google-chrome-stable_current_amd64.deb \
&& sudo sed -i 's|HERE/chrome"|HERE/chrome" --disable-setuid-sandbox --no-sandbox|g' \
"/opt/google/chrome/google-chrome" \
&& google-chrome --version
RUN export CHROMEDRIVER_RELEASE=$(curl --location --fail --retry 3 http://chromedriver.storage.googleapis.com/LATEST_RELEASE) \
&& curl --silent --show-error --location --fail --retry 3 --output /tmp/chromedriver_linux64.zip "http://chromedriver.storage.googleapis.com/$CHROMEDRIVER_RELEASE/chromedriver_linux64.zip" \
&& cd /tmp \
&& unzip chromedriver_linux64.zip \
&& rm -rf chromedriver_linux64.zip \
&& sudo mv chromedriver /usr/local/bin/chromedriver \
&& sudo chmod +x /usr/local/bin/chromedriver \
&& chromedriver --version
RUN sudo apt-get install -y libgconf-2-4
RUN sudo apt-get install -y xvfb
RUN sudo apt-get install -y jq
ENV DISPLAY :99
RUN printf '#!/bin/sh\nXvfb :99 -screen 0 1280x1024x24 &\nexec "$@"\n' > /tmp/entrypoint \
&& chmod +x /tmp/entrypoint \
&& sudo mv /tmp/entrypoint /docker-entrypoint.sh

COPY . /connect-automation
WORKDIR /connect-automation
RUN npm install
RUN ./node_modules/.bin/webdriver-manager update --versions.chrome=="$(google-chrome -version)"
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["/bin/sh"]
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-automation`
`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.
77 changes: 77 additions & 0 deletions connect-automation/conf.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
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',
'../temp/test-suites/project-settings-flow/project-settings.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"
}
}
28 changes: 28 additions & 0 deletions connect-automation/config/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"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",
"givenProjectUrl": "https://connect.topcoder-dev.com/projects/18013",
"expiredProjectUrl": "https://connect.topcoder-dev.com/projects/17236"
}
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