2323 - name : Copy dependencies
2424 run : |
2525 cp -av eform-angular-outer-inner-resource-plugin/eform-client/src/app/plugins/modules/outer-inner-resource-pn eform-angular-frontend/eform-client/src/app/plugins/modules/outer-inner-resource-pn
26- cp -av eform-angular-outer-inner-resource-plugin/eform-client/e2e/Tests/outer-inner-resource-settings eform-angular-frontend/eform-client/e2e/Tests/outer-inner-resource-settings
27- cp -av eform-angular-outer-inner-resource-plugin/eform-client/e2e/Tests/outer-inner-resource-general eform-angular-frontend/eform-client/e2e/Tests/outer-inner-resource-general
28- cp -av eform-angular-outer-inner-resource-plugin/eform-client/e2e/Page\ objects/OuterInnerResource eform-angular-frontend/eform-client/e2e/Page\ objects/OuterInnerResource
29- cp -av eform-angular-outer-inner-resource-plugin/eform-client/wdio-headless-plugin-step2.conf.ts eform-angular-frontend/eform-client/wdio-headless-plugin-step2.conf.ts
30- cp -av eform-angular-outer-inner-resource-plugin/eform-client/wdio-plugin-step2.conf.ts eform-angular-frontend/eform-client/wdio-plugin-step2.conf.ts
3126 mkdir -p eform-angular-frontend/eFormAPI/eFormAPI.Web/Plugins
3227 cd eform-angular-frontend/eform-client && ../../eform-angular-outer-inner-resource-plugin/testinginstallpn.sh
3328 - name : Get the version release
@@ -48,19 +43,27 @@ jobs:
4843 with :
4944 name : outer-inner-resource-container
5045 path : outer-inner-resource-container.tar
51- outer-inner-resource-test :
46+ outer-inner-resource-playwright- test :
5247 needs : outer-inner-resource-build
53- runs-on : ubuntu-latest
48+ runs-on : ubuntu-22.04
49+ strategy :
50+ fail-fast : false
51+ matrix :
52+ test : [a,b]
5453 steps :
5554 - uses : actions/checkout@v3
5655 with :
5756 path : eform-angular-outer-inner-resource-plugin
5857 - name : Create docker network
59- run : docker network create --driver bridge data
58+ run : docker network create --driver bridge --attachable data
6059 - name : Start MariaDB
6160 run : |
6261 docker pull mariadb:10.8
6362 docker run --name mariadbtest --network data -e MYSQL_ROOT_PASSWORD=secretpassword -p 3306:3306 -d mariadb:10.8
63+ - name : Start rabbitmq
64+ run : |
65+ docker pull rabbitmq:latest
66+ docker run -d --hostname my-rabbit --name some-rabbit --network data -e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=password rabbitmq:latest
6467 - uses : actions/download-artifact@v4
6568 with :
6669 name : outer-inner-resource-container
@@ -75,25 +78,14 @@ jobs:
7578 repository : microting/eform-angular-frontend
7679 ref : stable
7780 path : eform-angular-frontend
78- - name : Cache node_modules
79- id : cache
80- uses : actions/cache@v3
81- with :
82- path : eform-angular-frontend/eform-client/node_modules
83- key : ${{ runner.os }}-build-${{ hashFiles('eform-angular-frontend/eform-client/package.json') }}
84- restore-keys : |
85- ${{ runner.os }}-build-
86- ${{ runner.os }}-
8781 - name : Sleep 15 seconds
8882 run : sleep 15
8983 - name : Copy dependencies
9084 run : |
9185 cp -av eform-angular-outer-inner-resource-plugin/eform-client/src/app/plugins/modules/outer-inner-resource-pn eform-angular-frontend/eform-client/src/app/plugins/modules/outer-inner-resource-pn
92- cp -av eform-angular-outer-inner-resource-plugin/eform-client/e2e/Tests/outer-inner-resource-settings eform-angular-frontend/eform-client/e2e/Tests/outer-inner-resource-settings
93- cp -av eform-angular-outer-inner-resource-plugin/eform-client/e2e/Tests/outer-inner-resource-general eform-angular-frontend/eform-client/e2e/Tests/outer-inner-resource-general
94- cp -av eform-angular-outer-inner-resource-plugin/eform-client/e2e/Page\ objects/OuterInnerResource eform-angular-frontend/eform-client/e2e/Page\ objects/OuterInnerResource
95- cp -av eform-angular-outer-inner-resource-plugin/eform-client/wdio-headless-plugin-step2.conf.ts eform-angular-frontend/eform-client/wdio-headless-plugin-step2.conf.ts
96- cp -av eform-angular-outer-inner-resource-plugin/eform-client/wdio-plugin-step2.conf.ts eform-angular-frontend/eform-client/wdio-plugin-step2.conf.ts
86+ mkdir -p eform-angular-frontend/eform-client/playwright/e2e/plugins/
87+ cp -av eform-angular-outer-inner-resource-plugin/eform-client/playwright/e2e/plugins/outer-inner-resource-pn eform-angular-frontend/eform-client/playwright/e2e/plugins/outer-inner-resource-pn
88+ cp -av eform-angular-outer-inner-resource-plugin/eform-client/playwright.config.ts eform-angular-frontend/eform-client/playwright.config.ts
9789 mkdir -p eform-angular-frontend/eFormAPI/eFormAPI.Web/Plugins
9890 cd eform-angular-frontend/eform-client && ../../eform-angular-outer-inner-resource-plugin/testinginstallpn.sh
9991 - name : Start the newly build Docker container
@@ -104,37 +96,51 @@ jobs:
10496 - name : Get standard output
10597 run : cat docker_run_log
10698 - name : Pretest changes to work with Docker container
107- run : sed -i 's/localhost/mariadbtest/g' eform-angular-frontend/eform-client/e2e/Constants/DatabaseConfigurationConstants.ts
99+ run : sed -i 's/localhost/mariadbtest/g' eform-angular-frontend/eform-client/playwright/ e2e/Constants/DatabaseConfigurationConstants.ts
108100 - name : yarn install
109101 run : cd eform-angular-frontend/eform-client && yarn install
110- if : steps.cache.outputs.cache-hit != 'true'
102+ - name : Install Playwright browsers
103+ run : cd eform-angular-frontend/eform-client && npx playwright install --with-deps chromium
104+ - name : Wait for app
105+ run : npx wait-on http://localhost:4200 --timeout 120000
111106 - name : DB Configuration
112- uses : cypress-io/github-action@v4
113- with :
114- start : echo 'hi'
115- wait-on : " http://localhost:4200"
116- wait-on-timeout : 120
117- browser : chrome
118- record : false
119- spec : cypress/e2e/db/*
120- config-file : cypress.config.ts
121- working-directory : eform-angular-frontend/eform-client
122- command-prefix : " --"
107+ run : cd eform-angular-frontend/eform-client && npx playwright test playwright/e2e/Tests/database-configuration/
123108 - name : Change rabbitmq hostname
124109 run : docker exec -i mariadbtest mysql -u root --password=secretpassword -e 'update 420_SDK.Settings set Value = "my-rabbit" where Name = "rabbitMqHost"'
125- - name : Plugin testing
126- run : cd eform-angular-frontend/eform-client && npm run testheadlessplugin
110+ - name : Get standard output
111+ run : |
112+ cat docker_run_log
113+ result=`cat docker_run_log | grep "Now listening on:.*:5000" -m 1 | wc -l`
114+ if [ $result -ne 1 ];then exit 1; fi
115+ - name : Enable plugin
116+ if : matrix.test != 'a'
117+ run : |
118+ docker exec -i mariadbtest mysql -u root --password=secretpassword -e 'update 420_Angular.EformPlugins set Status = 2'
119+ docker restart my-container
120+ sleep 15
121+ - name : Wait for app
122+ run : npx wait-on http://localhost:4200 --timeout 120000
123+ - name : ${{ matrix.test }} playwright test
124+ run : |
125+ cd eform-angular-frontend/eform-client
126+ npx playwright test playwright/e2e/plugins/outer-inner-resource-pn/${{ matrix.test }}/
127127 - name : Stop the newly build Docker container
128128 run : docker stop my-container
129129 - name : Get standard output
130130 run : |
131131 cat docker_run_log
132- result=`cat docker_run_log | grep "Now listening on: http://0.0.0.0 :5000" -m 1 | wc -l`
132+ result=`cat docker_run_log | grep "Now listening on:.* :5000" -m 1 | wc -l`
133133 if [ $result -ne 1 ];then exit 1; fi
134- - name : The job has failed
134+ - name : Get standard output
135135 if : ${{ failure() }}
136- run : |
137- cat docker_run_log
136+ run : cat docker_run_log
137+ - name : Archive Playwright report
138+ if : failure()
139+ uses : actions/upload-artifact@v4
140+ with :
141+ name : playwright-report-${{ matrix.test }}
142+ path : eform-angular-frontend/eform-client/playwright-report/
143+ retention-days : 2
138144 outer-inner-resource-dotnet-test :
139145 runs-on : ubuntu-latest
140146 steps :
0 commit comments