Skip to content

Commit

Permalink
Merge branch 'main' into feature/selenoid
Browse files Browse the repository at this point in the history
# Conflicts:
#	TestWare.sln
  • Loading branch information
Diego Martinez committed May 23, 2024
2 parents da0a0bb + 6b4dfb6 commit a8abc0e
Show file tree
Hide file tree
Showing 36 changed files with 1,048 additions and 104 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/Allure_Report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: allure-report
on:
workflow_call:
inputs:
artifact_name:
required: true
type: string
workflow:
required: true
type: string


jobs:
allure:
name: Generate Allure Report
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Get Allure history
uses: actions/checkout@v2
if: always()
continue-on-error: true
with:
ref: gh-pages
path: gh-pages

- uses: LexisNexis-Public-GHA/[email protected]
with:
workflow: ${{ inputs.workflow }}
name: ${{ inputs.artifact_name }}
path: allure-results

- name: Allure Report action from marketplace
uses: simple-elf/allure-report-action@master
if: always()
with:
allure_results: allure-results
allure_history: allure-history
keep_reports: 20

- name: Deploy report to Github Pages
if: always()
uses: peaceiris/actions-gh-pages@v2
env:
PERSONAL_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: allure-history
189 changes: 105 additions & 84 deletions .github/workflows/Run_web_tests.yml
Original file line number Diff line number Diff line change
@@ -1,84 +1,105 @@
name: Run-web-tests

on:
workflow_call:
inputs:
driver_type:
required: true
type: string
test_results_path:
required: true
type: string
environment:
required: true
type: string
jobs:
web-tests:
strategy:
matrix:
os: ${{fromJson(inputs.environment)}}
browser: ${{fromJson(inputs.driver_type)}}
fail-fast: false

name: Run WEB (${{ matrix.browser }}) tests - ${{ matrix.os }}
runs-on: ${{ matrix.os }}

steps:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- uses: LexisNexis-Public-GHA/[email protected]
with:
workflow: CI.yml
name: testing-artifact-selenium-web
- name: Run git init
run: git init
- name: Get Driver path by browser
run: |
switch ( "${{ matrix.browser }}".ToLower() )
{
"chrome" { $driverPathRaw = "$env:CHROMEWEBDRIVER" }
"firefox" { $driverPathRaw = "$env:GeckoWebDriver" }
"edge" { $driverPathRaw = "$env:EdgeWebDriver" }
"internetexplorer" { $driverPathRaw = "$env:IEWebDriver" }
}
echo "driverPathRaw=$driverPathRaw" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf-8 -Append
shell: pwsh
- name: config replacement
uses: microsoft/variable-substitution@v1
with:
files: '.\TestConfiguration.Web.json'
env:
Configurations.0.Capabilities.0.Path: ${{ env.driverPathRaw }}
Configurations.0.Capabilities.0.Driver: ${{ matrix.browser }}
Configurations.1.Capabilities.0.Driver: ${{ matrix.browser }}
Configurations.1.Capabilities.0.Path: ${{ env.driverPathRaw }}
Configurations.1.Capabilities.1.Driver: ${{ matrix.browser }}
Configurations.1.Capabilities.1.Path: ${{ env.driverPathRaw }}
Configurations.1.Capabilities.2.Driver: ${{ matrix.browser }}
Configurations.1.Capabilities.2.Path: ${{ env.driverPathRaw }}
TestResultPath: ${{ inputs.test_results_path }}
- name: Read configuration
id: config_file
uses: juliangruber/read-file-action@v1
with:
path: '.\TestConfiguration.Web.json'
- name: Echo configuration.json
run: echo "${{ steps.config_file.outputs.content }}"
- name: Run tests
run: dotnet test TestWare.Samples.Selenium.Web.dll --logger "trx;LogFileName=results.trx" --results-directory "${{ inputs.test_results_path }}"
- name: Archive WEB (${{ matrix.browser }}) screenshots
if: always()
uses: actions/upload-artifact@v2
with:
name: web-${{ matrix.browser }}-screenshots
path: |
${{ inputs.test_results_path }}
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Report - WEB (${{ matrix.browser }} - ${{ matrix.os }})
path: ${{ inputs.test_results_path }}/results.trx
reporter: dotnet-trx
name: Run-web-tests

on:
workflow_call:
inputs:
driver_type:
required: true
type: string
test_results_path:
required: true
type: string
environment:
required: true
type: string
jobs:
web-tests:
strategy:
matrix:
os: ${{fromJson(inputs.environment)}}
browser: ${{fromJson(inputs.driver_type)}}
fail-fast: false

name: Run WEB (${{ matrix.browser }}) tests - ${{ matrix.os }}
runs-on: ${{ matrix.os }}

steps:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- uses: LexisNexis-Public-GHA/[email protected]
with:
workflow: CI.yml
name: testing-artifact-selenium-web
- name: Run git init
run: git init
- name: Get Driver path by browser
run: |
switch ( "${{ matrix.browser }}".ToLower() )
{
"chrome" { $driverPathRaw = "$env:CHROMEWEBDRIVER" }
"firefox" { $driverPathRaw = "$env:GeckoWebDriver" }
"edge" { $driverPathRaw = "$env:EdgeWebDriver" }
"internetexplorer" { $driverPathRaw = "$env:IEWebDriver" }
}
echo "driverPathRaw=$driverPathRaw" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf-8 -Append
shell: pwsh
- name: config replacement
uses: microsoft/variable-substitution@v1
with:
files: '.\TestConfiguration.Web.json'
env:
Configurations.0.Capabilities.0.Path: ${{ env.driverPathRaw }}
Configurations.0.Capabilities.0.Driver: ${{ matrix.browser }}
Configurations.1.Capabilities.0.Driver: ${{ matrix.browser }}
Configurations.1.Capabilities.0.Path: ${{ env.driverPathRaw }}
Configurations.1.Capabilities.1.Driver: ${{ matrix.browser }}
Configurations.1.Capabilities.1.Path: ${{ env.driverPathRaw }}
Configurations.1.Capabilities.2.Driver: ${{ matrix.browser }}
Configurations.1.Capabilities.2.Path: ${{ env.driverPathRaw }}
Configurations.1.Capabilities.3.Driver: ${{ matrix.browser }}
Configurations.1.Capabilities.3.Path: ${{ env.driverPathRaw }}
Configurations.1.Capabilities.4.Driver: ${{ matrix.browser }}
Configurations.1.Capabilities.4.Path: ${{ env.driverPathRaw }}
Configurations.1.Capabilities.5.Driver: ${{ matrix.browser }}
Configurations.1.Capabilities.5.Path: ${{ env.driverPathRaw }}
TestResultPath: ${{ inputs.test_results_path }}
- name: Read configuration
id: config_file
uses: juliangruber/read-file-action@v1
with:
path: '.\TestConfiguration.Web.json'
- name: Echo configuration.json
continue-on-error: true
run: echo "${{ steps.config_file.outputs.content }}"
- name: Run tests
run: dotnet test TestWare.Samples.Selenium.Web.dll --logger "trx;LogFileName=results.trx" --results-directory "${{ inputs.test_results_path }}"
- name: Archive WEB (${{ matrix.browser }}) screenshots
if: always()
uses: actions/upload-artifact@v2
with:
name: web-${{ matrix.browser }}-screenshots
path: |
${{ inputs.test_results_path }}
- name: Archive Testing artifacts - Allure
if: always()
uses: actions/upload-artifact@v2
with:
name: allure-results
path: '.\allure-results'
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Report - WEB (${{ matrix.browser }} - ${{ matrix.os }})
path: ${{ inputs.test_results_path }}/results.trx
reporter: dotnet-trx

allure-results:
needs: web-tests
if: always()
uses: ./.github/workflows/Allure_Report.yml
with:
artifact_name: allure-results
workflow: Run_web_tests.yml
9 changes: 6 additions & 3 deletions .github/workflows/Sonar_Scanner.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: SonarQube Scanner
on:
pull_request_target:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, labeled]
workflow_call:
secrets:
Expand Down Expand Up @@ -28,10 +31,10 @@ jobs:
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 1.11
java-version: 17
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
Expand Down
21 changes: 21 additions & 0 deletions TestWare.sln
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestWare.Engines.Selenoid",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestWare.Samples.Selenoid.Web", "samples\TestWare.Samples.Selenoid.Web\TestWare.Samples.Selenoid.Web.csproj", "{672C5D48-DD50-4AA3-8974-50B95746EA07}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestWare.Engines.MongoDB", "src\Engines\TestWare.Engines.MongoDB\TestWare.Engines.MongoDB.csproj", "{4DFC2BE5-D3EF-4F39-AAD4-B8213DE92A11}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestWare.Samples.MongoDB", "samples\TestWare.Samples.MongoDB\TestWare.Samples.MongoDB.csproj", "{5378DE68-675E-440D-AAA9-7D3AF8AA680E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestWare.AllureReport", "src\Core\TestWare.AllureReport\TestWare.AllureReport.csproj", "{91F2B723-A68B-4711-969B-89897B3C6161}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -96,6 +102,18 @@ Global
{672C5D48-DD50-4AA3-8974-50B95746EA07}.Debug|Any CPU.Build.0 = Debug|Any CPU
{672C5D48-DD50-4AA3-8974-50B95746EA07}.Release|Any CPU.ActiveCfg = Release|Any CPU
{672C5D48-DD50-4AA3-8974-50B95746EA07}.Release|Any CPU.Build.0 = Release|Any CPU
{4DFC2BE5-D3EF-4F39-AAD4-B8213DE92A11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4DFC2BE5-D3EF-4F39-AAD4-B8213DE92A11}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4DFC2BE5-D3EF-4F39-AAD4-B8213DE92A11}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4DFC2BE5-D3EF-4F39-AAD4-B8213DE92A11}.Release|Any CPU.Build.0 = Release|Any CPU
{5378DE68-675E-440D-AAA9-7D3AF8AA680E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5378DE68-675E-440D-AAA9-7D3AF8AA680E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5378DE68-675E-440D-AAA9-7D3AF8AA680E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5378DE68-675E-440D-AAA9-7D3AF8AA680E}.Release|Any CPU.Build.0 = Release|Any CPU
{91F2B723-A68B-4711-969B-89897B3C6161}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{91F2B723-A68B-4711-969B-89897B3C6161}.Debug|Any CPU.Build.0 = Debug|Any CPU
{91F2B723-A68B-4711-969B-89897B3C6161}.Release|Any CPU.ActiveCfg = Release|Any CPU
{91F2B723-A68B-4711-969B-89897B3C6161}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -116,6 +134,9 @@ Global
{DCCEF363-0EBE-46EA-B02B-CD59010626F6} = {4678C707-68DB-4E06-9184-A07FB398832C}
{0B7E3DFE-AB55-4C0C-81C6-6A6F517475EE} = {A2E4E1F7-CB61-48DC-AA38-A74F7DC74CA2}
{672C5D48-DD50-4AA3-8974-50B95746EA07} = {58B1446D-98A3-46A2-A668-305F0170B39F}
{4DFC2BE5-D3EF-4F39-AAD4-B8213DE92A11} = {A2E4E1F7-CB61-48DC-AA38-A74F7DC74CA2}
{5378DE68-675E-440D-AAA9-7D3AF8AA680E} = {58B1446D-98A3-46A2-A668-305F0170B39F}
{91F2B723-A68B-4711-969B-89897B3C6161} = {DCCEF363-0EBE-46EA-B02B-CD59010626F6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4F88CB24-23C8-4E0E-8B83-29023C1642B8}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ A short summary of the feature

Scenario: Scenario that combines two different apis
Given A calculated age for name 'Name'
When the formula '22*2' is simplified on 'api1'
When the formula '22+23' is simplified on 'api1'
Then Age and expresion should be the same
25 changes: 25 additions & 0 deletions samples/TestWare.Samples.MongoDB/Features/Database.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@MongoDB
Feature: Database


Scenario: Insert at database
When the following document is inserted in 'collection-example' collection at 'database-example' database
| NAME |
| Didac |
Then the following document is saved in 'collection-example' collection at 'database-example' database
| NAME |
| Didac |


Scenario: Delete at database
Given the following document is saved in 'collection-example' collection at 'database-example' database
| NAME |
| Diego |
When the following document is deleted in 'collection-example' collection at 'database-example' database
| NAME |
| Diego |
Then no documents are saved in 'collection-example' collection at 'database-example' database with values
| NAME |
| Diego |


Loading

0 comments on commit a8abc0e

Please sign in to comment.