Improved automated page testing script on onprem
This commit is contained in:
@@ -1,51 +1,21 @@
|
||||
|
||||
SERVER_URL="http://localhost:3000"
|
||||
|
||||
declare -a Routes=()
|
||||
declare -a Routes=($(grep -oP '(?<=path=")[^"]*' src/App.jsx | grep -E '^[a-zA-Z0-9/_:-]+$' | grep -vE '^/$'))
|
||||
|
||||
# Add all cloud routes here
|
||||
if [[ "$SERVER_URL" == "http://localhost:3001" || "$SERVER_URL" == "http://localhost:3002" || "$SERVER_URL" == "https://sandbox.shuffler.io" || "$SERVER_URL" == "https://shuffler.io" ]]; then
|
||||
Routes+=(
|
||||
'homepage'
|
||||
'home'
|
||||
'contact'
|
||||
'workflows/fa9314a7-bb9b-4b41-8885-1d02b199f04d'
|
||||
'services'
|
||||
'debug'
|
||||
'creator'
|
||||
'articles'
|
||||
'partners'
|
||||
'pricing'
|
||||
'pricing2'
|
||||
'training'
|
||||
'professional-services'
|
||||
'detections'
|
||||
)
|
||||
fi
|
||||
for i in "${!Routes[@]}"; do
|
||||
Routes[$i]="${Routes[$i]#/}"
|
||||
done
|
||||
|
||||
# Add all common routes here
|
||||
# # Add all tab routes and unique routes here
|
||||
Routes+=(
|
||||
'workflows'
|
||||
'workflows?tab=org_workflows'
|
||||
'workflows?tab=my_workflows'
|
||||
'workflows?tab=all_workflows'
|
||||
'workflows/debug'
|
||||
'debug'
|
||||
'usecases'
|
||||
'usecases2'
|
||||
'getting-started'
|
||||
'welcome'
|
||||
'health'
|
||||
'docs'
|
||||
'settings'
|
||||
'apps/new'
|
||||
'apps/gmail'
|
||||
'apis/gmail'
|
||||
'forms'
|
||||
'apps'
|
||||
'apps?tab=my_apps'
|
||||
'apps?tab=all_apps'
|
||||
'search'
|
||||
'search?tab=org_apps'
|
||||
'search?tab=my_apps'
|
||||
'search?tab=workflows'
|
||||
@@ -67,13 +37,11 @@ Routes+=(
|
||||
"admin?admin_tab=branding(beta)"
|
||||
)
|
||||
|
||||
ALL_ROUTES=("${Routes[@]}")
|
||||
|
||||
# Stop frontend container so it test unpushed changes
|
||||
docker stop shuffle-frontend
|
||||
|
||||
# Install all frontend dependencies
|
||||
yarn install
|
||||
# # Install all frontend dependencies
|
||||
yarn add selenium-webdriver --dev && yarn install
|
||||
echo "Starting frontend..."
|
||||
|
||||
BROWSER=none yarn start &
|
||||
@@ -86,7 +54,7 @@ sleep 60
|
||||
echo "Server is up! Starting Selenium tests..."
|
||||
|
||||
echo "Starting frontend tests..."
|
||||
node selenium-test.js "$SERVER_URL" "${ALL_ROUTES[@]}"
|
||||
node selenium-test.js "$SERVER_URL" "${Routes[@]}"
|
||||
|
||||
TEST_EXIT_CODE=$?
|
||||
|
||||
|
||||
@@ -88,7 +88,6 @@
|
||||
"remark-rehype": "^11.0.0",
|
||||
"rsuite": "^5.23.0",
|
||||
"search-insights": "^2.2.1",
|
||||
"selenium-webdriver": "^4.28.1",
|
||||
"shellwords": "^1.0.1",
|
||||
"simplebar": "^4.2.3",
|
||||
"styled-components": "^4.4.1",
|
||||
@@ -129,6 +128,7 @@
|
||||
"babel-preset-es2015": "^6.24.1",
|
||||
"postcss": "^8.4.38",
|
||||
"promise-window": "^1.2.1",
|
||||
"selenium-webdriver": "^4.29.0",
|
||||
"webpack-cli": "^5.1.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,8 +34,9 @@ console.log('Starting Selenium script for testing pages...');
|
||||
if (isCloud) {
|
||||
// Login Credentials
|
||||
const LOGIN_URL = `${frontendURL}/login`;
|
||||
const USERNAME = 'shuffle-testing@gmail.com';
|
||||
const PASSWORD = 'testing@123';
|
||||
// put your login credentials here
|
||||
const USERNAME = '';
|
||||
const PASSWORD = '';
|
||||
|
||||
console.log('Logging in...');
|
||||
await driver.get(LOGIN_URL);
|
||||
|
||||
@@ -297,6 +297,7 @@ const App = (message, props) => {
|
||||
element={
|
||||
<Admin
|
||||
isLoggedIn={isLoggedIn}
|
||||
userdata={userdata}
|
||||
setIsLoggedIn={setIsLoggedIn}
|
||||
register={true}
|
||||
isLoaded={isLoaded}
|
||||
|
||||
Reference in New Issue
Block a user