-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/selenoid
# Conflicts: # TestWare.sln
- Loading branch information
Showing
36 changed files
with
1,048 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
samples/TestWare.Samples.MongoDB/Features/Database.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | | ||
|
||
|
Oops, something went wrong.