-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added test suites Signed-off-by: mdolhalo <[email protected]>
- Loading branch information
Showing
38 changed files
with
545 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
#!/bin/bash | ||
# shellcheck source=/dev/null | ||
|
||
validateParameters(){ | ||
# Validate required parameters | ||
if [ -z "$OCP_VERSION" ] || [ -z "$ARCH_VERSION" ] || [ -z "$TS_SELENIUM_BASE_URL" ]; then | ||
echo "The ARCH_VERSION, OCP_VERSION or TS_SELENIUM_BASE_URL is not set!"; | ||
echo "Please, set all required environment variable parameters" | ||
exit 1 | ||
fi | ||
} | ||
|
||
######################################## | ||
############# Methods ################## | ||
######################################## | ||
|
||
launchAPITests() { | ||
export MOCHA_SUITE="APITest" | ||
echo "MOCHA_SUITE = ${MOCHA_SUITE}" | ||
export RP_LAUNCH_NAME="API tests suite" | ||
echo "suites/$MOCHA_DIRECTORY/$MOCHA_SUITE" | ||
npm run driver-less-test | ||
} | ||
|
||
launchDynamicallyGeneratingAPITests() { | ||
export MOCHA_SUITE="DynamicallyGeneratingAPITest" | ||
export RP_LAUNCH_NAME="Application inbuilt DevWorkspaces API tests suite" | ||
echo "MOCHA_SUITE = ${MOCHA_SUITE}" | ||
echo "suites/$MOCHA_DIRECTORY/$MOCHA_SUITE" | ||
npm run delayed-test | ||
} | ||
|
||
launchUITests() { | ||
export MOCHA_SUITE="UITest" | ||
export RP_LAUNCH_NAME="UI tests suite" | ||
echo "MOCHA_SUITE = ${MOCHA_SUITE}" | ||
echo "suites/$MOCHA_DIRECTORY/$MOCHA_SUITE" | ||
npm run test | ||
} | ||
|
||
launchAllTests() { | ||
validateParameters | ||
initTestValues | ||
echo "" | ||
echo "Launching all tests for $TEST_ENVIRONMENT" | ||
echo "" | ||
launchDynamicallyGeneratingAPITests | ||
launchAPITests | ||
launchUITests | ||
} | ||
|
||
initTestValues() { | ||
if [[ "$TS_SELENIUM_BASE_URL" =~ "airgap" || (-n "$IS_CLUSTER_DISCONNECTED" && "$IS_CLUSTER_DISCONNECTED" == "true") ]] | ||
then | ||
echo "Disconnected environment" | ||
export MOCHA_DIRECTORY="disconnected-ocp" | ||
else | ||
echo "Online environment" | ||
export MOCHA_DIRECTORY="online-ocp" | ||
fi | ||
|
||
export TEST_ENVIRONMENT="$ARCH_VERSION $MOCHA_DIRECTORY $OCP_VERSION" | ||
export DELETE_WORKSPACE_ON_FAILED_TEST=${DELETE_WORKSPACE_ON_FAILED_TEST:-'false'} | ||
export DELETE_SCREENCAST_IF_TEST_PASS=${DELETE_SCREENCAST_IF_TEST_PASS:-'true'} | ||
export NODE_TLS_REJECT_UNAUTHORIZED=${NODE_TLS_REJECT_UNAUTHORIZED:-'0'} | ||
export TS_OCP_LOGIN_PAGE_PROVIDER_TITLE=${TS_OCP_LOGIN_PAGE_PROVIDER_TITLE:-'htpasswd'} | ||
export TS_SELENIUM_DELAY_BETWEEN_SCREENSHOTS=${TS_SELENIUM_DELAY_BETWEEN_SCREENSHOTS:-'1000'} | ||
export TS_SELENIUM_EDITOR=${TS_SELENIUM_EDITOR:-'che-code'} | ||
export TS_SELENIUM_EXECUTION_SCREENCAST=${TS_SELENIUM_EXECUTION_SCREENCAST:-'false'} | ||
export TS_SELENIUM_HEADLESS=${TS_SELENIUM_HEADLESS:-'false'} | ||
export TS_SELENIUM_LAUNCH_FULLSCREEN=${TS_SELENIUM_LAUNCH_FULLSCREEN:-'true'} | ||
export TS_SELENIUM_LOG_LEVEL=${TS_SELENIUM_LOG_LEVEL:-'TRACE'} | ||
export TS_SELENIUM_OCP_PASSWORD=${TS_SELENIUM_OCP_PASSWORD:-''} | ||
export TS_SELENIUM_OCP_USERNAME=${TS_SELENIUM_OCP_USERNAME:-'admin'} | ||
export TS_SELENIUM_VALUE_OPENSHIFT_OAUTH=${TS_SELENIUM_VALUE_OPENSHIFT_OAUTH:-'true'} | ||
export TS_SELENIUM_REPORT_FOLDER=${TS_SELENIUM_REPORT_FOLDER:-'./report'} | ||
export MOCHA_BAIL=${MOCHA_BAIL:-'false'} | ||
export MOCHA_RETRIES=${MOCHA_RETRIES:-'1'} | ||
|
||
echo "TS_SELENIUM_BASE_URL=${TS_SELENIUM_BASE_URL}" | ||
echo "TEST_ENVIRONMENT=${TEST_ENVIRONMENT}" | ||
echo "DELETE_WORKSPACE_ON_FAILED_TEST=${DELETE_WORKSPACE_ON_FAILED_TEST}" | ||
echo "DELETE_SCREENCAST_IF_TEST_PASS=${DELETE_SCREENCAST_IF_TEST_PASS}" | ||
echo "NODE_TLS_REJECT_UNAUTHORIZED=${NODE_TLS_REJECT_UNAUTHORIZED}" | ||
echo "TS_OCP_LOGIN_PAGE_PROVIDER_TITLE=${TS_OCP_LOGIN_PAGE_PROVIDER_TITLE}" | ||
echo "TS_SELENIUM_DELAY_BETWEEN_SCREENSHOTS=${TS_SELENIUM_DELAY_BETWEEN_SCREENSHOTS}" | ||
echo "TS_SELENIUM_EDITOR=${TS_SELENIUM_EDITOR}" | ||
echo "TS_SELENIUM_EXECUTION_SCREENCAST=${TS_SELENIUM_EXECUTION_SCREENCAST}" | ||
echo "TS_SELENIUM_HEADLESS=${TS_SELENIUM_HEADLESS}" | ||
echo "TS_SELENIUM_LAUNCH_FULLSCREEN=${TS_SELENIUM_LAUNCH_FULLSCREEN}" | ||
echo "TS_SELENIUM_LOG_LEVEL=${TS_SELENIUM_LOG_LEVEL}" | ||
echo "TS_SELENIUM_OCP_USERNAME=${TS_SELENIUM_OCP_USERNAME}" | ||
echo "TS_SELENIUM_VALUE_OPENSHIFT_OAUTH=${TS_SELENIUM_VALUE_OPENSHIFT_OAUTH}" | ||
echo "TS_SELENIUM_REPORT_FOLDER=${TS_SELENIUM_REPORT_FOLDER}" | ||
echo "MOCHA_BAIL=${MOCHA_BAIL}" | ||
echo "MOCHA_RETRIES=${MOCHA_RETRIES}" | ||
} | ||
|
||
######################################## | ||
############# Launching ################ | ||
######################################## | ||
|
||
launchAllTests | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,11 +9,13 @@ | |
"tsc": "rm -rf ./dist && ./configs/sh-scripts/generateIndex.sh && tsc -p .", | ||
"test": "./configs/sh-scripts/initDefaultValues.sh npm run lint && npm run tsc && export USERSTORY=$USERSTORY && mocha --config dist/configs/mocharc.js", | ||
"driver-less-test": "export TS_USE_WEB_DRIVER_FOR_TEST=false && npm run test", | ||
"delayed-test": "npm run lint && npm run tsc && export TS_USE_WEB_DRIVER_FOR_TEST=false && export MOCHA_DELAYED_SUITE=true && mocha --config dist/configs/mocharc.js --delay", | ||
"open-allure-dasboard": "allure generate .allure-results --clean -o .allure-report && allure open .allure-report", | ||
"cleanup-docker": "if [ $(docker ps -a | grep -c selenium-e2e) -gt 0 ]; then docker rm -f $(docker ps --filter \"name=selenium-e2e\" -aq); fi;", | ||
"test-docker": "npm run cleanup-docker && docker run -it --shm-size=2g -p 5920:5920 --name selenium-e2e -e TS_SELENIUM_BASE_URL=$TS_SELENIUM_BASE_URL eclipse/che-e2e:nightly", | ||
"test-docker-mount-e2e": "npm run cleanup-docker && docker run -it --shm-size=2g -p 5920:5920 --name selenium-e2e -e TS_SELENIUM_BASE_URL=$TS_SELENIUM_BASE_URL -v $(pwd):/tmp/e2e:Z eclipse/che-e2e:nightly", | ||
"test-all-devfiles": " ./configs/sh-scripts/initDefaultValues.sh && ./configs/sh-scripts/initDevfileTests.sh", | ||
"functional-test-suite": "configs/sh-scripts/runFunctionalTests.sh", | ||
"devfile-acceptance-test-suite": "./configs/sh-scripts/initDefaultValues.sh npm run lint && npm run tsc && export TS_USE_WEB_DRIVER_FOR_TEST=false && mocha 'dist/specs/api/*.js' --config dist/configs/mocharc.js --delay --grep 'Devfile acceptance test suite'" | ||
}, | ||
"author": "Ihor Okhrimenko ([email protected])", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.