Update BaseTest.cs with --user-data-dir for GitHub Actions #6
This file contains hidden or 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
| name: Run Selenium Tests | |
| on: | |
| push: | |
| branches: | |
| - master # Triggers on push to master | |
| pull_request: | |
| branches: | |
| - master # Triggers on pull request targeting master | |
| workflow_dispatch: # Allows manual trigger from GitHub UI | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest # Change to windows-latest if needed | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v3 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: '8.0.406' # Use the correct .NET version for your project | |
| - name: Restore Dependencies | |
| run: dotnet restore | |
| - name: Build the Project | |
| run: dotnet build --no-restore | |
| - name: Run Selenium Tests | |
| run: | | |
| mkdir -p TestResults # Ensure the directory exists | |
| dotnet test --logger "trx;LogFileName=test-results.trx" --results-directory TestResults | |
| - name: List Test Results Directory | |
| run: ls -R TestResults # List contents of TestResults directory for debugging | |
| - name: Create a Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: TestResults/* # Path to your test result files (could be modified if needed) | |
| - name: Upload Test Results as Release Asset | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: TestResults/* |