feat(Workflow) Now have a testing part of deploy workflow
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
name: Azure Static Web Apps CI/CD
|
||||
name: Deploy To Development
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -11,11 +11,11 @@ on:
|
||||
|
||||
jobs:
|
||||
build_and_deploy_job:
|
||||
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
|
||||
if: github.event_name == 'push'
|
||||
runs-on: ubuntu-latest
|
||||
name: Build and Deploy Job
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
- name: Build And Deploy
|
||||
@@ -28,15 +28,22 @@ jobs:
|
||||
app_location: "IGP"
|
||||
api_location: ""
|
||||
output_location: "./wwwroot"
|
||||
|
||||
close_pull_request_job:
|
||||
if: github.event_name == 'pull_request' && github.event.action == 'closed'
|
||||
|
||||
test_deployed_website:
|
||||
name: Test Deployed Website
|
||||
needs: build_and_deploy_job
|
||||
if: github.event_name == 'push'
|
||||
runs-on: ubuntu-latest
|
||||
name: Close Pull Request Job
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ./TestAutomation
|
||||
steps:
|
||||
- name: Close Pull Request
|
||||
id: closepullrequest
|
||||
uses: Azure/static-web-apps-deploy@v1
|
||||
with:
|
||||
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_CALM_MUD_04916B210 }}
|
||||
action: "close"
|
||||
- uses: browser-actions/setup-geckodriver@latest
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v2
|
||||
with:
|
||||
dotnet-version: 6.0.*
|
||||
- run: dotnet restore
|
||||
- run: dotnet build --no-restore
|
||||
- run: dotnet test --no-build --verbosity normal
|
||||
@@ -1,4 +1,4 @@
|
||||
name: Azure Static Web Apps CI/CD
|
||||
name: Deploy To Production
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
name: Run Development Tests
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
logLevel:
|
||||
description: 'Log level'
|
||||
required: true
|
||||
default: 'warning'
|
||||
tags:
|
||||
description: 'Test scenario tags'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v2
|
||||
with:
|
||||
dotnet-version: 5.0.x
|
||||
- name: Change Directory
|
||||
run: cd TestAutomation | dotnet restore |dotnet build --no-restore | dotnet test --no-build --verbosity normal
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
|
||||
@@ -11,16 +11,19 @@ public class Tests
|
||||
private Website Website { get; }
|
||||
|
||||
public Tests() {
|
||||
//var options = new FirefoxOptions();
|
||||
var options = new ChromeOptions();
|
||||
var options = new FirefoxOptions();
|
||||
//var options = new ChromeOptions();
|
||||
|
||||
options.AcceptInsecureCertificates = true;
|
||||
options.AddArgument("--headless");
|
||||
options.AddArgument("--ignore-certificate-errors");
|
||||
options.AddArgument("--start-maximized");
|
||||
|
||||
options.AddArgument("--test-type");
|
||||
options.AddArgument("--allow-running-insecure-content");
|
||||
|
||||
//_webDriver = new FirefoxDriver(options);
|
||||
_webDriver = new ChromeDriver(Environment.CurrentDirectory, options);
|
||||
//_webDriver = new FirefoxDriver(Environment.CurrentDirectory, options);
|
||||
//_webDriver = new ChromeDriver(Environment.CurrentDirectory, options);
|
||||
_webDriver = new FirefoxDriver(Environment.CurrentDirectory, options);
|
||||
|
||||
|
||||
Website = new Website(_webDriver);
|
||||
|
||||
Reference in New Issue
Block a user