@@ -161,4 +161,117 @@ jobs:
161161 - name : Build
162162 run : dotnet build eform-angular-workflow-plugin/eFormAPI/Plugins/Workflow.Pn/Workflow.Pn.sln
163163 - name : Unit Tests
164- run : dotnet test --no-restore -c Release -v n eform-angular-workflow-plugin/eFormAPI/Plugins/Workflow.Pn/Workflow.Pn.Test/Workflow.Pn.Test.csproj
164+ run : dotnet test --no-restore -c Release -v n eform-angular-workflow-plugin/eFormAPI/Plugins/Workflow.Pn/Workflow.Pn.Test/Workflow.Pn.Test.csproj
165+ workflow-playwright-test :
166+ needs : workflow-build
167+ runs-on : ubuntu-22.04
168+ strategy :
169+ fail-fast : false
170+ matrix :
171+ test : [a,b,c,d]
172+ steps :
173+ - uses : actions/checkout@v3
174+ with :
175+ path : eform-angular-workflow-plugin
176+ - name : Extract branch name
177+ id : extract_branch
178+ run : echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
179+ - name : Create docker network
180+ run : docker network create --driver bridge data
181+ - name : Start MariaDB
182+ run : |
183+ docker pull mariadb:10.8
184+ docker run --name mariadbtest --network data -e MYSQL_ROOT_PASSWORD=secretpassword -p 3306:3306 -d mariadb:10.8
185+ - name : Start rabbitmq
186+ run : |
187+ docker pull rabbitmq:latest
188+ docker run -d --hostname my-rabbit --name some-rabbit --network data -e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=password rabbitmq:latest
189+ - uses : actions/download-artifact@v4
190+ with :
191+ name : workflow-container
192+ - run : docker load -i workflow-container.tar
193+ - name : Use Node.js
194+ uses : actions/setup-node@v3
195+ with :
196+ node-version : 22
197+ - name : ' Preparing Frontend checkout'
198+ uses : actions/checkout@v3
199+ with :
200+ repository : microting/eform-angular-frontend
201+ ref : ${{ steps.extract_branch.outputs.branch }}
202+ path : eform-angular-frontend
203+ - name : Sleep 15 seconds
204+ run : sleep 15
205+ - name : Load DB dump
206+ run : |
207+ mysql -u root -h 127.0.0.1 --password=secretpassword -e 'create database `420_eform-angular-workflow-plugin`'
208+ mysql -u root -h 127.0.0.1 --password=secretpassword 420_eform-angular-workflow-plugin < eform-angular-workflow-plugin/420_eform-angular-workflow-plugin.sql
209+ - name : Copy dependencies
210+ run : |
211+ cp -av eform-angular-workflow-plugin/eform-client/src/app/plugins/modules/workflow-pn eform-angular-frontend/eform-client/src/app/plugins/modules/workflow-pn
212+ mkdir -p eform-angular-frontend/eform-client/playwright/e2e/plugins/
213+ cp -av eform-angular-workflow-plugin/eform-client/playwright/e2e/plugins/workflow-pn eform-angular-frontend/eform-client/playwright/e2e/plugins/workflow-pn
214+ cp -av eform-angular-workflow-plugin/eform-client/playwright.config.ts eform-angular-frontend/eform-client/playwright.config.ts
215+ mkdir -p eform-angular-frontend/eFormAPI/eFormAPI.Web/Plugins
216+ cd eform-angular-frontend/eform-client && ../../eform-angular-workflow-plugin/testinginstallpn.sh
217+ - name : Start the newly build Docker container
218+ id : docker-run
219+ run : docker run --name my-container -p 4200:5000 --network data microtingas/workflow-container:latest "/ConnectionString=host=mariadbtest;Database=420_Angular;user=root;password=secretpassword;port=3306;Convert Zero Datetime = true;SslMode=none;" > docker_run_log 2>&1 &
220+ - name : Sleep 15 seconds
221+ run : sleep 15
222+ - name : Get standard output
223+ run : cat docker_run_log
224+ - name : Pretest changes to work with Docker container
225+ run : sed -i 's/localhost/mariadbtest/g' eform-angular-frontend/eform-client/e2e/Constants/DatabaseConfigurationConstants.ts
226+ - name : yarn install
227+ run : cd eform-angular-frontend/eform-client && yarn install
228+ - name : Install Playwright browsers
229+ run : cd eform-angular-frontend/eform-client && npx playwright install --with-deps chromium
230+ - name : DB Configuration
231+ uses : cypress-io/github-action@v4
232+ with :
233+ start : echo 'hi'
234+ wait-on : " http://localhost:4200"
235+ wait-on-timeout : 120
236+ browser : chrome
237+ record : false
238+ spec : cypress/e2e/db/*
239+ config-file : cypress.config.ts
240+ working-directory : eform-angular-frontend/eform-client
241+ command-prefix : " --"
242+ - name : Change rabbitmq hostname
243+ run : docker exec -i mariadbtest mysql -u root --password=secretpassword -e 'update 420_SDK.Settings set Value = "my-rabbit" where Name = "rabbitMqHost"'
244+ - name : Enable plugins
245+ if : matrix.test != 'a'
246+ run : |
247+ docker exec -i mariadbtest mysql -u root --password=secretpassword -e 'update 420_Angular.EformPlugins set Status = 2'
248+ docker restart my-container
249+ sleep 15
250+ - name : Get standard output
251+ run : |
252+ cat docker_run_log
253+ result=`cat docker_run_log | grep "Now listening on: http://0.0.0.0:5000" -m 1 | wc -l`
254+ if [ $result -ne 1 ];then exit 1; fi
255+ - name : Wait for app
256+ run : npx wait-on http://localhost:4200 --timeout 120000
257+ - name : ${{ matrix.test }} playwright test
258+ run : |
259+ cd eform-angular-frontend/eform-client
260+ npx playwright test playwright/e2e/plugins/workflow-pn/${{ matrix.test }}/
261+ - name : Stop the newly build Docker container
262+ run : docker stop my-container
263+ - name : Get standard output
264+ run : |
265+ cat docker_run_log
266+ result=`cat docker_run_log | grep "Now listening on: http://0.0.0.0:5000" -m 1 | wc -l`
267+ if [ $result -ne 1 ];then exit 1; fi
268+ - name : Get standard output
269+ if : ${{ failure() }}
270+ run : cat docker_run_log
271+ - name : Archive Playwright report
272+ if : failure()
273+ uses : actions/upload-artifact@v4
274+ with :
275+ name : playwright-report-${{ matrix.test }}
276+ path : eform-angular-frontend/eform-client/playwright-report/
277+ retention-days : 2
0 commit comments