How to run testcafe tests - cniackz/public GitHub Wiki

Note: I am currently using Node 17 from https://nodejs.org/download/release/latest-v17.x/

/Users/cniackz/console $ node -v
v17.9.0

STEP 1: Get console Server

sudo rm -rf ~/go
cd ~/console
make install
~/go/bin/console server

STEP 2: Get UI Ready and wait until process completes

cd ~/console/portal-ui
yarn install
yarn build
yarn run start

STEP 3: Then do this in another window, This will start MinIO with proper permissions

cd ~/console
make initialize-permissions

STEP 4: To run test cafe

cd ~/console
testcafe chrome portal-ui/tests/permissions-5/ --skip-js-errors

You should see:

/Users/cniackz/console $ cd ~/console
testcafe chrome portal-ui/tests/permissions-5/ --skip-js-errors
 Running tests in:
 - Chrome 101.0.4951.64 / macOS 10.15.7

 For user with Diagnostics permissions
 ✓ Support sidebar item exists
 ✓ Diagnostics link exists in Tools page
 ✓ Diagnostics page can be opened
 ✓ Start Diagnostic button exists
 ✓ Start Diagnostic button can be clicked
 ✓ Download button exists after Diagnostic is completed
 ✓ Download button is clickable after Diagnostic is completed
 ✓ Start New Diagnostic button exists after Diagnostic is completed
 ✓ Start New Diagnostic button is clickable after Diagnostic is completed


 9 passed (21s)

How to test Operator UI with TestCafe


# WINDOW 1
kind delete cluster
kind create cluster --config /Users/cniackz/operator/testing/kind-config.yaml
kubectl apply -k /Users/cniackz/operator/resources
kubectl apply -k "/Users/cniackz/operator/examples/kustomization/tenant-tiny"
kubectl proxy

# WINDOW 2
cd /Users/cniackz/console/portal-ui
yarn
yarn build
yarn run
question Which command would you like to run?: start


# WINDOW 3
cd /Users/cniackz/console
go build --tags=kqueue,operator -o console github.com/minio/console/cmd/console
make install
/Users/cniackz/go/bin/console operator

# WINDOW 4
cd /Users/cniackz/console
testcafe chrome portal-ui/tests/operator/tenants.ts --skip-js-errors