Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 43 additions & 41 deletions .github/workflows/dotnet-core-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ jobs:
- name: Copy dependencies
run: |
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
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
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
cp -av eform-angular-outer-inner-resource-plugin/eform-client/e2e/Page\ objects/OuterInnerResource eform-angular-frontend/eform-client/e2e/Page\ objects/OuterInnerResource
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
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
mkdir -p eform-angular-frontend/eFormAPI/eFormAPI.Web/Plugins
cd eform-angular-frontend/eform-client && ../../eform-angular-outer-inner-resource-plugin/testinginstallpn.sh
- name: Get the version release
Expand All @@ -51,9 +46,13 @@ jobs:
with:
name: outer-inner-resource-container
path: outer-inner-resource-container.tar
outer-inner-resource-test:
outer-inner-resource-playwright-test:
needs: outer-inner-resource-build
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
test: [a,b]
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -62,7 +61,7 @@ jobs:
id: extract_branch
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
- name: Create docker network
run: docker network create --driver bridge data
run: docker network create --driver bridge --attachable data
- name: Start MariaDB
run: |
docker pull mariadb:10.8
Expand All @@ -85,25 +84,14 @@ jobs:
repository: microting/eform-angular-frontend
ref: ${{ steps.extract_branch.outputs.branch }}
path: eform-angular-frontend
- name: Cache node_modules
id: cache
uses: actions/cache@v3
with:
path: eform-angular-frontend/eform-client/node_modules
key: ${{ runner.os }}-build-${{ hashFiles('eform-angular-frontend/eform-client/package.json') }}
restore-keys: |
${{ runner.os }}-build-
${{ runner.os }}-
- name: Sleep 15 seconds
run: sleep 15
- name: Copy dependencies
run: |
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
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
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
cp -av eform-angular-outer-inner-resource-plugin/eform-client/e2e/Page\ objects/OuterInnerResource eform-angular-frontend/eform-client/e2e/Page\ objects/OuterInnerResource
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
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
mkdir -p eform-angular-frontend/eform-client/playwright/e2e/plugins/
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
cp -av eform-angular-outer-inner-resource-plugin/eform-client/playwright.config.ts eform-angular-frontend/eform-client/playwright.config.ts
mkdir -p eform-angular-frontend/eFormAPI/eFormAPI.Web/Plugins
cd eform-angular-frontend/eform-client && ../../eform-angular-outer-inner-resource-plugin/testinginstallpn.sh
- name: Start the newly build Docker container
Expand All @@ -114,37 +102,51 @@ jobs:
- name: Get standard output
run: cat docker_run_log
- name: Pretest changes to work with Docker container
run: sed -i 's/localhost/mariadbtest/g' eform-angular-frontend/eform-client/e2e/Constants/DatabaseConfigurationConstants.ts
run: sed -i 's/localhost/mariadbtest/g' eform-angular-frontend/eform-client/playwright/e2e/Constants/DatabaseConfigurationConstants.ts
- name: yarn install
run: cd eform-angular-frontend/eform-client && yarn install
if: steps.cache.outputs.cache-hit != 'true'
- name: Install Playwright browsers
run: cd eform-angular-frontend/eform-client && npx playwright install --with-deps chromium
- name: Wait for app
run: npx wait-on http://localhost:4200 --timeout 120000
- name: DB Configuration
uses: cypress-io/github-action@v4
with:
start: echo 'hi'
wait-on: "http://localhost:4200"
wait-on-timeout: 120
browser: chrome
record: false
spec: cypress/e2e/db/*
config-file: cypress.config.ts
working-directory: eform-angular-frontend/eform-client
command-prefix: "--"
run: cd eform-angular-frontend/eform-client && npx playwright test playwright/e2e/Tests/database-configuration/
- name: Change rabbitmq hostname
run: docker exec -i mariadbtest mysql -u root --password=secretpassword -e 'update 420_SDK.Settings set Value = "my-rabbit" where Name = "rabbitMqHost"'
- name: Plugin testing
run: cd eform-angular-frontend/eform-client && npm run testheadlessplugin
- name: Get standard output
run: |
cat docker_run_log
result=`cat docker_run_log | grep "Now listening on:.*:5000" -m 1 | wc -l`
if [ $result -ne 1 ];then exit 1; fi
- name: Enable plugin
if: matrix.test != 'a'
run: |
docker exec -i mariadbtest mysql -u root --password=secretpassword -e 'update 420_Angular.EformPlugins set Status = 2'
docker restart my-container
sleep 15
- name: Wait for app
run: npx wait-on http://localhost:4200 --timeout 120000
- name: ${{ matrix.test }} playwright test
run: |
cd eform-angular-frontend/eform-client
npx playwright test playwright/e2e/plugins/outer-inner-resource-pn/${{ matrix.test }}/
- name: Stop the newly build Docker container
run: docker stop my-container
- name: Get standard output
run: |
cat docker_run_log
result=`cat docker_run_log | grep "Now listening on: http://0.0.0.0:5000" -m 1 | wc -l`
result=`cat docker_run_log | grep "Now listening on:.*:5000" -m 1 | wc -l`
if [ $result -ne 1 ];then exit 1; fi
- name: The job has failed
- name: Get standard output
if: ${{ failure() }}
run: |
cat docker_run_log
run: cat docker_run_log
- name: Archive Playwright report
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report-${{ matrix.test }}
path: eform-angular-frontend/eform-client/playwright-report/
retention-days: 2
outer-inner-resource-dotnet-test:
runs-on: ubuntu-latest
steps:
Expand Down
88 changes: 47 additions & 41 deletions .github/workflows/dotnet-core-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ jobs:
- name: Copy dependencies
run: |
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
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
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
cp -av eform-angular-outer-inner-resource-plugin/eform-client/e2e/Page\ objects/OuterInnerResource eform-angular-frontend/eform-client/e2e/Page\ objects/OuterInnerResource
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
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
mkdir -p eform-angular-frontend/eFormAPI/eFormAPI.Web/Plugins
cd eform-angular-frontend/eform-client && ../../eform-angular-outer-inner-resource-plugin/testinginstallpn.sh
- name: Get the version release
Expand All @@ -48,19 +43,27 @@ jobs:
with:
name: outer-inner-resource-container
path: outer-inner-resource-container.tar
outer-inner-resource-test:
outer-inner-resource-playwright-test:
needs: outer-inner-resource-build
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
test: [a,b]
steps:
- uses: actions/checkout@v3
with:
path: eform-angular-outer-inner-resource-plugin
- name: Create docker network
run: docker network create --driver bridge data
run: docker network create --driver bridge --attachable data
- name: Start MariaDB
run: |
docker pull mariadb:10.8
docker run --name mariadbtest --network data -e MYSQL_ROOT_PASSWORD=secretpassword -p 3306:3306 -d mariadb:10.8
- name: Start rabbitmq
run: |
docker pull rabbitmq:latest
docker run -d --hostname my-rabbit --name some-rabbit --network data -e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=password rabbitmq:latest
- uses: actions/download-artifact@v4
with:
name: outer-inner-resource-container
Expand All @@ -75,25 +78,14 @@ jobs:
repository: microting/eform-angular-frontend
ref: stable
path: eform-angular-frontend
- name: Cache node_modules
id: cache
uses: actions/cache@v3
with:
path: eform-angular-frontend/eform-client/node_modules
key: ${{ runner.os }}-build-${{ hashFiles('eform-angular-frontend/eform-client/package.json') }}
restore-keys: |
${{ runner.os }}-build-
${{ runner.os }}-
- name: Sleep 15 seconds
run: sleep 15
- name: Copy dependencies
run: |
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
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
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
cp -av eform-angular-outer-inner-resource-plugin/eform-client/e2e/Page\ objects/OuterInnerResource eform-angular-frontend/eform-client/e2e/Page\ objects/OuterInnerResource
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
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
mkdir -p eform-angular-frontend/eform-client/playwright/e2e/plugins/
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
cp -av eform-angular-outer-inner-resource-plugin/eform-client/playwright.config.ts eform-angular-frontend/eform-client/playwright.config.ts
mkdir -p eform-angular-frontend/eFormAPI/eFormAPI.Web/Plugins
cd eform-angular-frontend/eform-client && ../../eform-angular-outer-inner-resource-plugin/testinginstallpn.sh
- name: Start the newly build Docker container
Expand All @@ -104,37 +96,51 @@ jobs:
- name: Get standard output
run: cat docker_run_log
- name: Pretest changes to work with Docker container
run: sed -i 's/localhost/mariadbtest/g' eform-angular-frontend/eform-client/e2e/Constants/DatabaseConfigurationConstants.ts
run: sed -i 's/localhost/mariadbtest/g' eform-angular-frontend/eform-client/playwright/e2e/Constants/DatabaseConfigurationConstants.ts
- name: yarn install
run: cd eform-angular-frontend/eform-client && yarn install
if: steps.cache.outputs.cache-hit != 'true'
- name: Install Playwright browsers
run: cd eform-angular-frontend/eform-client && npx playwright install --with-deps chromium
- name: Wait for app
run: npx wait-on http://localhost:4200 --timeout 120000
- name: DB Configuration
uses: cypress-io/github-action@v4
with:
start: echo 'hi'
wait-on: "http://localhost:4200"
wait-on-timeout: 120
browser: chrome
record: false
spec: cypress/e2e/db/*
config-file: cypress.config.ts
working-directory: eform-angular-frontend/eform-client
command-prefix: "--"
run: cd eform-angular-frontend/eform-client && npx playwright test playwright/e2e/Tests/database-configuration/
- name: Change rabbitmq hostname
run: docker exec -i mariadbtest mysql -u root --password=secretpassword -e 'update 420_SDK.Settings set Value = "my-rabbit" where Name = "rabbitMqHost"'
- name: Plugin testing
run: cd eform-angular-frontend/eform-client && npm run testheadlessplugin
- name: Get standard output
run: |
cat docker_run_log
result=`cat docker_run_log | grep "Now listening on:.*:5000" -m 1 | wc -l`
if [ $result -ne 1 ];then exit 1; fi
- name: Enable plugin
if: matrix.test != 'a'
run: |
docker exec -i mariadbtest mysql -u root --password=secretpassword -e 'update 420_Angular.EformPlugins set Status = 2'
docker restart my-container
sleep 15
- name: Wait for app
run: npx wait-on http://localhost:4200 --timeout 120000
- name: ${{ matrix.test }} playwright test
run: |
cd eform-angular-frontend/eform-client
npx playwright test playwright/e2e/plugins/outer-inner-resource-pn/${{ matrix.test }}/
- name: Stop the newly build Docker container
run: docker stop my-container
- name: Get standard output
run: |
cat docker_run_log
result=`cat docker_run_log | grep "Now listening on: http://0.0.0.0:5000" -m 1 | wc -l`
result=`cat docker_run_log | grep "Now listening on:.*:5000" -m 1 | wc -l`
if [ $result -ne 1 ];then exit 1; fi
- name: The job has failed
- name: Get standard output
if: ${{ failure() }}
run: |
cat docker_run_log
run: cat docker_run_log
- name: Archive Playwright report
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report-${{ matrix.test }}
path: eform-angular-frontend/eform-client/playwright-report/
retention-days: 2
outer-inner-resource-dotnet-test:
runs-on: ubuntu-latest
steps:
Expand Down
21 changes: 21 additions & 0 deletions eform-client/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { defineConfig, devices } from '@playwright/test';

export default defineConfig({
testDir: './playwright/e2e',
fullyParallel: false,
workers: 1,
timeout: 120_000,
use: {
baseURL: 'http://localhost:4200',
viewport: { width: 1920, height: 1080 },
video: 'retain-on-failure',
screenshot: 'only-on-failure',
trace: 'retain-on-failure',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
});
Loading
Loading