Tests In Browser|API|Marketplace #35
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 workflow will build and run In Browser Selenium Web Driver Tests | |
# | |
# For more samples to get started with GitHub Action workflows to deploy to Azure, refer to https://github.com/Azure/actions-workflow-samples | |
name: Test|In Browser|Marketplace | |
on: | |
#manually trigger deploy | |
workflow_dispatch: | |
# Trigger the workflow on push | |
#push: | |
# branches: | |
# - develop | |
# - main | |
#pull_request: | |
# branches: | |
# - develop | |
# - main | |
env: | |
# set this to the path to your solution file | |
SOLUTION_DIRECTORY: './' | |
# Solution file name | |
SOLUTION_FILE: 'CESMII.Marketplace.sln' | |
# Set this to the path to your test project file | |
PROJECT_DIRECTORY: './api/Tests/CESMII.Marketplace.InBrowser.Tests/' | |
# Test project file to use | |
PROJECT_NAME: 'CESMII.Marketplace.InBrowser.Tests' | |
# set this to the .NET core version to use | |
NETCORE_VERSION: "6.0.x" | |
# set this to the NODE JS version to use | |
NODEJS_VERSION: "14.17.3" | |
# set this to npm working directory | |
NPM_WORKING_DIRECTORY: 'frontend' | |
jobs: | |
build: | |
name: Test in Browser | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Set up dotnet core ${{ env.NETCORE_VERSION }} | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: ${{ env.NETCORE_VERSION }} | |
- name: Restore dependencies (${{env.SOLUTION_FILE}}) | |
run: dotnet restore ${{env.SOLUTION_FILE}} | |
working-directory: ${{env.SOLUTION_DIRECTORY}} | |
- name: Build (${{env.SOLUTION_FILE}}) | |
run: dotnet build ${{env.SOLUTION_FILE}} --configuration Staging --no-restore | |
- name: Setup chrome driver | |
uses: browser-actions/setup-chrome@latest | |
- name: Run browser | |
run: | | |
chrome --version | |
- name: Use Node.js version (${{env.NODEJS_VERSION}}) | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{env.NODEJS_VERSION}} | |
- name: Set up NPM and build our code | |
working-directory: ${{env.NPM_WORKING_DIRECTORY}} | |
env: | |
CI: '' #when process-env-ci is true, warnings are ignored and not treated as errors | |
run: | | |
npm install | |
npm run build:in-browser-test | |
npm run start-in-browser-test & | |
- name: Run Test on project (${{env.PROJECT_NAME}}) | |
run: dotnet test ${{env.SOLUTION_DIRECTORY}}api/Tests/CESMII.Marketplace.InBrowser.Tests/${{env.PROJECT_NAME}}.csproj --configuration Staging --verbosity normal -l:"console;verbosity=normal" | |
working-directory: ${{env.SOLUTION_DIRECTORY}} |