@@ -38,6 +38,8 @@ function start_services() {
3838 export LLM_SERVICE_HOST_IP=${ip_address}
3939 export BACKEND_SERVICE_ENDPOINT=" http://${ip_address} :7777/v1/codetrans"
4040
41+ sed -i " s/backend_address/$ip_address /g" $WORKPATH /docker/ui/svelte/.env
42+
4143 # Start Docker Containers
4244 # TODO: Replace the container name with a test-specific name
4345 docker compose -f docker_compose.yaml up -d
@@ -101,6 +103,31 @@ function validate_megaservice() {
101103 ' {"language_from": "Golang","language_to": "Python","source_code": "package main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n}"}'
102104}
103105
106+ function validate_frontend() {
107+ cd $WORKPATH /docker/ui/svelte
108+ local conda_env_name=" CodeTrans_e2e"
109+ export PATH=${HOME} /miniforge3/bin/:$PATH
110+ conda remove -n ${conda_env_name} --all -y
111+ conda create -n ${conda_env_name} python=3.12 -y
112+ source activate ${conda_env_name}
113+
114+ sed -i " s/localhost/$ip_address /g" playwright.config.ts
115+
116+ conda install -c conda-forge nodejs -y && npm install && npm ci && npx playwright install --with-deps
117+ node -v && npm -v && pip list
118+
119+ exit_status=0
120+ npx playwright test || exit_status=$?
121+
122+ if [ $exit_status -ne 0 ]; then
123+ echo " [TEST INFO]: ---------frontend test failed---------"
124+ exit $exit_status
125+ else
126+ echo " [TEST INFO]: ---------frontend test passed---------"
127+ fi
128+
129+ }
130+
104131function stop_docker() {
105132 cd $WORKPATH /docker/gaudi
106133 container_list=$( cat docker_compose.yaml | grep container_name | cut -d' :' -f2)
@@ -119,6 +146,7 @@ function main() {
119146
120147 validate_microservices
121148 validate_megaservice
149+ validate_frontend
122150
123151 stop_docker
124152 echo y | docker system prune
0 commit comments