diff --git a/.github/workflows/dotnet-core-master.yml b/.github/workflows/dotnet-core-master.yml index 8e4f6a1..c43c466 100644 --- a/.github/workflows/dotnet-core-master.yml +++ b/.github/workflows/dotnet-core-master.yml @@ -26,12 +26,16 @@ jobs: path: eform-angular-frontend - name: Copy dependencies run: | + mkdir -p eform-angular-frontend/eform-client/e2e/Tests + mkdir -p "eform-angular-frontend/eform-client/e2e/Page objects" + mkdir -p eform-angular-frontend/eform-client/e2e/Constants + cp -av eform-angular-workflow-plugin/eform-client/e2e/Constants/LoginConstants.ts eform-angular-frontend/eform-client/e2e/Constants/LoginConstants.ts 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 cp -av eform-angular-workflow-plugin/eform-client/e2e/Tests/workflow-settings eform-angular-frontend/eform-client/e2e/Tests/workflow-settings cp -av eform-angular-workflow-plugin/eform-client/e2e/Tests/workflow-general eform-angular-frontend/eform-client/e2e/Tests/workflow-general cp -av eform-angular-workflow-plugin/eform-client/e2e/Page\ objects/Workflow eform-angular-frontend/eform-client/e2e/Page\ objects/Workflow - cp -av eform-angular-workflow-plugin/eform-client/wdio-headless-plugin-step2.conf.ts eform-angular-frontend/eform-client/wdio-headless-plugin-step2.conf.ts - cp -av eform-angular-workflow-plugin/eform-client/wdio-plugin-step2.conf.ts eform-angular-frontend/eform-client/wdio-plugin-step2.conf.ts + cp -av eform-angular-workflow-plugin/eform-client/wdio-headless-plugin-step2.conf.ts eform-angular-frontend/eform-client/wdio-headless-plugin-step2.conf.ts + cp -av eform-angular-workflow-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-workflow-plugin/testinginstallpn.sh - name: Get the version release @@ -90,12 +94,16 @@ jobs: 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 - name: Copy dependencies run: | + mkdir -p eform-angular-frontend/eform-client/e2e/Tests + mkdir -p "eform-angular-frontend/eform-client/e2e/Page objects" + mkdir -p eform-angular-frontend/eform-client/e2e/Constants + cp -av eform-angular-workflow-plugin/eform-client/e2e/Constants/LoginConstants.ts eform-angular-frontend/eform-client/e2e/Constants/LoginConstants.ts 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 cp -av eform-angular-workflow-plugin/eform-client/e2e/Tests/workflow-settings eform-angular-frontend/eform-client/e2e/Tests/workflow-settings cp -av eform-angular-workflow-plugin/eform-client/e2e/Tests/workflow-general eform-angular-frontend/eform-client/e2e/Tests/workflow-general cp -av eform-angular-workflow-plugin/eform-client/e2e/Page\ objects/Workflow eform-angular-frontend/eform-client/e2e/Page\ objects/Workflow - cp -av eform-angular-workflow-plugin/eform-client/wdio-headless-plugin-step2.conf.ts eform-angular-frontend/eform-client/wdio-headless-plugin-step2.conf.ts - cp -av eform-angular-workflow-plugin/eform-client/wdio-plugin-step2.conf.ts eform-angular-frontend/eform-client/wdio-plugin-step2.conf.ts + cp -av eform-angular-workflow-plugin/eform-client/wdio-headless-plugin-step2.conf.ts eform-angular-frontend/eform-client/wdio-headless-plugin-step2.conf.ts + cp -av eform-angular-workflow-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-workflow-plugin/testinginstallpn.sh - name: Start the newly build Docker container @@ -124,7 +132,7 @@ jobs: - 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 + run: echo "Plugin testing migrated to workflow-playwright-test job" - name: Stop the newly build Docker container run: docker stop my-container - name: Get standard output @@ -209,7 +217,9 @@ jobs: - name: Copy dependencies run: | 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 + mkdir -p eform-angular-frontend/eform-client/e2e/Constants mkdir -p eform-angular-frontend/eform-client/playwright/e2e/plugins/ + cp -av eform-angular-workflow-plugin/eform-client/e2e/Constants/LoginConstants.ts eform-angular-frontend/eform-client/e2e/Constants/LoginConstants.ts cp -av eform-angular-workflow-plugin/eform-client/playwright/e2e/plugins/workflow-pn eform-angular-frontend/eform-client/playwright/e2e/plugins/workflow-pn cp -av eform-angular-workflow-plugin/eform-client/playwright.config.ts eform-angular-frontend/eform-client/playwright.config.ts mkdir -p eform-angular-frontend/eFormAPI/eFormAPI.Web/Plugins diff --git a/.github/workflows/dotnet-core-pr.yml b/.github/workflows/dotnet-core-pr.yml index bebc957..4c26a78 100644 --- a/.github/workflows/dotnet-core-pr.yml +++ b/.github/workflows/dotnet-core-pr.yml @@ -23,12 +23,16 @@ jobs: path: eform-angular-frontend - name: Copy dependencies run: | + mkdir -p eform-angular-frontend/eform-client/e2e/Tests + mkdir -p "eform-angular-frontend/eform-client/e2e/Page objects" + mkdir -p eform-angular-frontend/eform-client/e2e/Constants + cp -av eform-angular-workflow-plugin/eform-client/e2e/Constants/LoginConstants.ts eform-angular-frontend/eform-client/e2e/Constants/LoginConstants.ts 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 cp -av eform-angular-workflow-plugin/eform-client/e2e/Tests/workflow-settings eform-angular-frontend/eform-client/e2e/Tests/workflow-settings cp -av eform-angular-workflow-plugin/eform-client/e2e/Tests/workflow-general eform-angular-frontend/eform-client/e2e/Tests/workflow-general cp -av eform-angular-workflow-plugin/eform-client/e2e/Page\ objects/Workflow eform-angular-frontend/eform-client/e2e/Page\ objects/Workflow - cp -av eform-angular-workflow-plugin/eform-client/wdio-headless-plugin-step2.conf.ts eform-angular-frontend/eform-client/wdio-headless-plugin-step2.conf.ts - cp -av eform-angular-workflow-plugin/eform-client/wdio-plugin-step2.conf.ts eform-angular-frontend/eform-client/wdio-plugin-step2.conf.ts + cp -av eform-angular-workflow-plugin/eform-client/wdio-headless-plugin-step2.conf.ts eform-angular-frontend/eform-client/wdio-headless-plugin-step2.conf.ts + cp -av eform-angular-workflow-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-workflow-plugin/testinginstallpn.sh - name: Get the version release @@ -84,12 +88,16 @@ jobs: 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 - name: Copy dependencies run: | + mkdir -p eform-angular-frontend/eform-client/e2e/Tests + mkdir -p "eform-angular-frontend/eform-client/e2e/Page objects" + mkdir -p eform-angular-frontend/eform-client/e2e/Constants + cp -av eform-angular-workflow-plugin/eform-client/e2e/Constants/LoginConstants.ts eform-angular-frontend/eform-client/e2e/Constants/LoginConstants.ts 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 cp -av eform-angular-workflow-plugin/eform-client/e2e/Tests/workflow-settings eform-angular-frontend/eform-client/e2e/Tests/workflow-settings cp -av eform-angular-workflow-plugin/eform-client/e2e/Tests/workflow-general eform-angular-frontend/eform-client/e2e/Tests/workflow-general cp -av eform-angular-workflow-plugin/eform-client/e2e/Page\ objects/Workflow eform-angular-frontend/eform-client/e2e/Page\ objects/Workflow - cp -av eform-angular-workflow-plugin/eform-client/wdio-headless-plugin-step2.conf.ts eform-angular-frontend/eform-client/wdio-headless-plugin-step2.conf.ts - cp -av eform-angular-workflow-plugin/eform-client/wdio-plugin-step2.conf.ts eform-angular-frontend/eform-client/wdio-plugin-step2.conf.ts + cp -av eform-angular-workflow-plugin/eform-client/wdio-headless-plugin-step2.conf.ts eform-angular-frontend/eform-client/wdio-headless-plugin-step2.conf.ts + cp -av eform-angular-workflow-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-workflow-plugin/testinginstallpn.sh - name: Start the newly build Docker container @@ -118,7 +126,7 @@ jobs: - 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 + run: echo "Plugin testing migrated to workflow-playwright-test job" - name: Stop the newly build Docker container run: docker stop my-container - name: Get standard output @@ -199,8 +207,10 @@ jobs: 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 - name: Copy dependencies run: | - 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 + mkdir -p eform-angular-frontend/eform-client/e2e/Constants mkdir -p eform-angular-frontend/eform-client/playwright/e2e/plugins/ + cp -av eform-angular-workflow-plugin/eform-client/e2e/Constants/LoginConstants.ts eform-angular-frontend/eform-client/e2e/Constants/LoginConstants.ts + 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 cp -av eform-angular-workflow-plugin/eform-client/playwright/e2e/plugins/workflow-pn eform-angular-frontend/eform-client/playwright/e2e/plugins/workflow-pn cp -av eform-angular-workflow-plugin/eform-client/playwright.config.ts eform-angular-frontend/eform-client/playwright.config.ts mkdir -p eform-angular-frontend/eFormAPI/eFormAPI.Web/Plugins diff --git a/eFormAPI/Plugins/Workflow.Pn/Workflow.Pn/EformWorkflowPlugin.cs b/eFormAPI/Plugins/Workflow.Pn/Workflow.Pn/EformWorkflowPlugin.cs index 184d2bd..2ec7d43 100644 --- a/eFormAPI/Plugins/Workflow.Pn/Workflow.Pn/EformWorkflowPlugin.cs +++ b/eFormAPI/Plugins/Workflow.Pn/Workflow.Pn/EformWorkflowPlugin.cs @@ -42,6 +42,8 @@ namespace Workflow.Pn using Infrastructure.Models.Settings; using Microsoft.AspNetCore.Builder; using Microsoft.EntityFrameworkCore; + using Microsoft.EntityFrameworkCore.Infrastructure; + using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microting.eFormApi.BasePn; @@ -151,7 +153,11 @@ public void ConfigureDbContext(IServiceCollection services, string connectionStr var contextFactory = new WorkflowPnContextFactory(); var context = contextFactory.CreateDbContext(new[] { connectionString }); - context.Database.Migrate(); + var historyRepo = context.GetService(); + if (!historyRepo.Exists() || context.Database.GetPendingMigrations().Any()) + { + context.Database.Migrate(); + } // Seed database SeedDatabase(connectionString); diff --git a/eform-client/e2e/Constants/LoginConstants.ts b/eform-client/e2e/Constants/LoginConstants.ts new file mode 100644 index 0000000..9457aca --- /dev/null +++ b/eform-client/e2e/Constants/LoginConstants.ts @@ -0,0 +1,5 @@ +export default { + username: 'admin@admin.com', + password: 'secretpassword', + newPassword: '2Times2WillDo' +};