From 6996210b9245579131c86136d8b863ed28f0d937 Mon Sep 17 00:00:00 2001 From: Neha Agarwal Date: Thu, 22 Dec 2022 14:00:25 +0530 Subject: [PATCH 01/16] http->https in hub url --- NUnit-BrowserStack/BrowserStackNUnitTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NUnit-BrowserStack/BrowserStackNUnitTest.cs b/NUnit-BrowserStack/BrowserStackNUnitTest.cs index c3ce994..3873945 100644 --- a/NUnit-BrowserStack/BrowserStackNUnitTest.cs +++ b/NUnit-BrowserStack/BrowserStackNUnitTest.cs @@ -86,7 +86,7 @@ public void Init() } capability.AddAdditionalOption("bstack:options", browserstackOptions); driver = new RemoteWebDriver( - new Uri("http://" + ConfigurationManager.AppSettings.Get("server") + "/wd/hub/"), + new Uri("https://" + ConfigurationManager.AppSettings.Get("server") + "/wd/hub/"), capability ); } From 7e6657a0d2f54c901fc05be5b5f9cf633609d29d Mon Sep 17 00:00:00 2001 From: Neha Agarwal Date: Fri, 24 Mar 2023 18:41:50 +0530 Subject: [PATCH 02/16] Made parallel test as default --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index cc3f553..96ff009 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,8 @@ * Update `App.config` file with your BrowserStack Username and Access Key(https://www.browserstack.com/accounts/settings) ## Running your tests from Test Explorer via NUnit Test Adapter -- To run a single test, run test with fixture `single` +- To run tests, run tests with fixture `parallel` - To run local tests, run test with fixture `local` -- To run parallel tests, run tests with fixture `parallel` Understand how many parallel sessions you need by using our [Parallel Test Calculator](https://www.browserstack.com/automate/parallel-calculator?ref=github) From 6be3cb448492177205b72e1390cead0794556166 Mon Sep 17 00:00:00 2001 From: Neha Agarwal Date: Wed, 29 Mar 2023 15:23:36 +0530 Subject: [PATCH 03/16] Add source --- NUnit-BrowserStack/App.config | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/NUnit-BrowserStack/App.config b/NUnit-BrowserStack/App.config index 9518d06..e10ac01 100644 --- a/NUnit-BrowserStack/App.config +++ b/NUnit-BrowserStack/App.config @@ -29,19 +29,21 @@ - + + + From fdade874aeb1f227d1f9422eb46318e15869e4a8 Mon Sep 17 00:00:00 2001 From: Neha Agarwal Date: Wed, 12 Apr 2023 12:54:02 +0530 Subject: [PATCH 04/16] Added workflow file in master --- .github/CODEOWNERS | 1 + .github/workflows/reviewing_changes.yml | 88 +++++++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/workflows/reviewing_changes.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..7e1f1b4 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +.github/* @browserstack/asi-devs diff --git a/.github/workflows/reviewing_changes.yml b/.github/workflows/reviewing_changes.yml new file mode 100644 index 0000000..8dd9372 --- /dev/null +++ b/.github/workflows/reviewing_changes.yml @@ -0,0 +1,88 @@ +# This job is to test different profiles in sdk branch against Pull Requests raised +# This workflow targets nunit + +name: C-sharp SDK Test workflow on workflow_dispatch(from master branch) + +on: + workflow_dispatch: + inputs: + pull_request_number: + description: 'The pull request number to build' + required: true + +jobs: + comment-run: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + max-parallel: 3 + matrix: + dotnet: ['6.0.x', '5.0.x'] + os: [ macos-latest, windows-latest, ubuntu-latest ] + name: NUnit Repo ${{ matrix.dotnet }} - ${{ matrix.os }} Sample + env: + BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} + BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} + + steps: + - uses: actions/checkout@v3 + with: + ref: refs/pull/${{ github.event.inputs.pull_request_number }}/head + - name: Fetch Commit SHA + run: | + git log -1 --format='%H' + echo "commit_sha=$(git log -1 --format='%H')" >> $GITHUB_ENV + echo "commit_sha=$(git log -1 --format='%H')" >> $env:GITHUB_ENV + - uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 + id: status-check-in-progress + env: + job_name: NUnit Repo ${{ matrix.dotnet }} - ${{ matrix.os }} Sample + with: + github-token: ${{ github.token }} + script: | + const result = await github.rest.checks.create({ + owner: context.repo.owner, + repo: context.repo.repo, + name: process.env.job_name, + head_sha: process.env.commit_sha, + status: 'in_progress' + }).catch((err) => ({status: err.status, response: err.response})); + console.log(`The status-check response : ${result.status} Response : ${JSON.stringify(result.response)}`) + if (result.status !== 201) { + console.log('Failed to create check run') + } + - name: Setup dotnet + uses: actions/setup-dotnet@v3 + with: + dotnet-version: ${{ matrix.dotnet }} + + - name: Install dependencies + run: dotnet build + + - name: Run sample tests + run: dotnet test --filter "Category=sample-test" + + - name: Run local tests + run: dotnet test --filter "Category=sample-local-test" + + - if: always() + uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 + id: status-check-completed + env: + conclusion: ${{ job.status }} + job_name: NUnit Repo ${{ matrix.dotnet }} - ${{ matrix.os }} Sample + with: + github-token: ${{ github.token }} + script: | + const result = await github.rest.checks.create({ + owner: context.repo.owner, + repo: context.repo.repo, + name: process.env.job_name, + head_sha: process.env.commit_sha, + status: 'completed', + conclusion: process.env.conclusion + }).catch((err) => ({status: err.status, response: err.response})); + console.log(`The status-check response : ${result.status} Response : ${JSON.stringify(result.response)}`) + if (result.status !== 201) { + console.log('Failed to create check run') + } From 1b4b29753601999e407ab172e2ec80efa1913388 Mon Sep 17 00:00:00 2001 From: Neha Agarwal Date: Wed, 12 Apr 2023 13:08:30 +0530 Subject: [PATCH 05/16] Fix --- .github/workflows/reviewing_changes.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reviewing_changes.yml b/.github/workflows/reviewing_changes.yml index 8dd9372..965b251 100644 --- a/.github/workflows/reviewing_changes.yml +++ b/.github/workflows/reviewing_changes.yml @@ -18,7 +18,7 @@ jobs: max-parallel: 3 matrix: dotnet: ['6.0.x', '5.0.x'] - os: [ macos-latest, windows-latest, ubuntu-latest ] + os: [ windows-latest ] name: NUnit Repo ${{ matrix.dotnet }} - ${{ matrix.os }} Sample env: BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} From fcd522c9ac9c0756010fa007a7c688fec7c1a4c9 Mon Sep 17 00:00:00 2001 From: bstack-security-github <116066275+bstack-security-github@users.noreply.github.com> Date: Wed, 21 Jun 2023 17:23:36 +0530 Subject: [PATCH 06/16] Adding Code Scanner Semgrep.yml workflow file --- .github/workflows/Semgrep.yml | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/Semgrep.yml diff --git a/.github/workflows/Semgrep.yml b/.github/workflows/Semgrep.yml new file mode 100644 index 0000000..0347afd --- /dev/null +++ b/.github/workflows/Semgrep.yml @@ -0,0 +1,48 @@ +# Name of this GitHub Actions workflow. +name: Semgrep + +on: + # Scan changed files in PRs (diff-aware scanning): + # The branches below must be a subset of the branches above + pull_request: + branches: ["master", "main"] + push: + branches: ["master", "main"] + schedule: + - cron: '0 6 * * *' + + +permissions: + contents: read + +jobs: + semgrep: + # User definable name of this GitHub Actions job. + permissions: + contents: read # for actions/checkout to fetch code + security-events: write # for github/codeql-action/upload-sarif to upload SARIF results + name: semgrep/ci + # If you are self-hosting, change the following `runs-on` value: + runs-on: ubuntu-latest + + container: + # A Docker image with Semgrep installed. Do not change this. + image: returntocorp/semgrep + + # Skip any PR created by dependabot to avoid permission issues: + if: (github.actor != 'dependabot[bot]') + + steps: + # Fetch project source with GitHub Actions Checkout. + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + # Run the "semgrep ci" command on the command line of the docker image. + - run: semgrep ci --sarif --output=semgrep.sarif + env: + # Add the rules that Semgrep uses by setting the SEMGREP_RULES environment variable. + SEMGREP_RULES: p/default # more at semgrep.dev/explore + + - name: Upload SARIF file for GitHub Advanced Security Dashboard + uses: github/codeql-action/upload-sarif@6c089f53dd51dc3fc7e599c3cb5356453a52ca9e # v2.20.0 + with: + sarif_file: semgrep.sarif + if: always() \ No newline at end of file From d212ac8c75a5f322611295a5bb144a2def725228 Mon Sep 17 00:00:00 2001 From: bstack-security-github <116066275+bstack-security-github@users.noreply.github.com> Date: Mon, 3 Jul 2023 20:34:29 +0530 Subject: [PATCH 07/16] Adding CODEOWNERS file --- .github/CODEOWNERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7e1f1b4..09a587d 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1,3 @@ .github/* @browserstack/asi-devs + +* @browserstack/automate-public-repos From 82335ba3425371b16676eb4c7c64e8f60af10d16 Mon Sep 17 00:00:00 2001 From: Neha Agarwal Date: Mon, 10 Jul 2023 12:07:20 +0530 Subject: [PATCH 08/16] Fix workflow file --- .github/workflows/reviewing_changes.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/reviewing_changes.yml b/.github/workflows/reviewing_changes.yml index 965b251..2a06be4 100644 --- a/.github/workflows/reviewing_changes.yml +++ b/.github/workflows/reviewing_changes.yml @@ -1,7 +1,7 @@ # This job is to test different profiles in sdk branch against Pull Requests raised # This workflow targets nunit -name: C-sharp SDK Test workflow on workflow_dispatch(from master branch) +name: C-sharp SDK Test workflow on workflow_dispatch on: workflow_dispatch: @@ -27,16 +27,12 @@ jobs: steps: - uses: actions/checkout@v3 with: - ref: refs/pull/${{ github.event.inputs.pull_request_number }}/head - - name: Fetch Commit SHA - run: | - git log -1 --format='%H' - echo "commit_sha=$(git log -1 --format='%H')" >> $GITHUB_ENV - echo "commit_sha=$(git log -1 --format='%H')" >> $env:GITHUB_ENV + ref: ${{ github.event.inputs.commit_sha }} - uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 id: status-check-in-progress env: job_name: NUnit Repo ${{ matrix.dotnet }} - ${{ matrix.os }} Sample + commit_sha: ${{ github.event.inputs.commit_sha }} with: github-token: ${{ github.token }} script: | @@ -71,6 +67,7 @@ jobs: env: conclusion: ${{ job.status }} job_name: NUnit Repo ${{ matrix.dotnet }} - ${{ matrix.os }} Sample + commit_sha: ${{ github.event.inputs.commit_sha }} with: github-token: ${{ github.token }} script: | From e9bc2061387b814386dd43bf4fa7e98308dbe8df Mon Sep 17 00:00:00 2001 From: Neha Agarwal Date: Mon, 10 Jul 2023 13:02:35 +0530 Subject: [PATCH 09/16] Fix workflow file --- .github/workflows/reviewing_changes.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reviewing_changes.yml b/.github/workflows/reviewing_changes.yml index 2a06be4..18c3707 100644 --- a/.github/workflows/reviewing_changes.yml +++ b/.github/workflows/reviewing_changes.yml @@ -6,8 +6,8 @@ name: C-sharp SDK Test workflow on workflow_dispatch on: workflow_dispatch: inputs: - pull_request_number: - description: 'The pull request number to build' + commit_sha: + description: 'The full commit id to build' required: true jobs: From 5e50a3be24a5d607b19f964f618517bf6ffafb02 Mon Sep 17 00:00:00 2001 From: Kamalpreet Kaur <38219887+kamal-kaur04@users.noreply.github.com> Date: Mon, 18 Sep 2023 19:27:02 +0530 Subject: [PATCH 10/16] Update reviewing_changes.yml --- .github/workflows/reviewing_changes.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reviewing_changes.yml b/.github/workflows/reviewing_changes.yml index 18c3707..dfd638e 100644 --- a/.github/workflows/reviewing_changes.yml +++ b/.github/workflows/reviewing_changes.yml @@ -53,7 +53,10 @@ jobs: dotnet-version: ${{ matrix.dotnet }} - name: Install dependencies - run: dotnet build + run: | + dotnet --version + dotnet build + - name: Run sample tests run: dotnet test --filter "Category=sample-test" From afddbd7f1a284e1fa4d50db0021482b5146c578a Mon Sep 17 00:00:00 2001 From: Hrithik Katiyar Date: Mon, 1 Jul 2024 16:20:53 +0530 Subject: [PATCH 11/16] Fixed linting issue --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 94ba720..906adac 100644 --- a/.gitignore +++ b/.gitignore @@ -6,5 +6,5 @@ obj .vs .DS_Store local.log -browserstack.err log +browserstack.err From a6f50dda503c5b9cc288f3995b03425e2a0c2ad7 Mon Sep 17 00:00:00 2001 From: "Yash D. Saraf" Date: Thu, 12 Feb 2026 19:22:47 +0530 Subject: [PATCH 12/16] Chore: Add debug utility flag in sample repo yaml --- NUnit-BrowserStack/browserstack.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NUnit-BrowserStack/browserstack.yml b/NUnit-BrowserStack/browserstack.yml index eb1c8eb..716cb1d 100644 --- a/NUnit-BrowserStack/browserstack.yml +++ b/NUnit-BrowserStack/browserstack.yml @@ -64,3 +64,5 @@ debug: false # # Set to true if you need screenshots for every seleniu networkLogs: false # Set to true to enable HAR logs capturing consoleLogs: errors # Remote browser's console debug levels to be printed (Default: errors) # Available options are `disable`, `errors`, `warnings`, `info`, `verbose` (Default: errors) + +# debugUtility: true # Set to true if you want to validate and debug the correctness of your BrowserStack config options. Read more about it here - https://www.browserstack.com/docs/automate/debug-common-errors From c6700e7ced28dd9770f60c7b47f97f7655c3c13c Mon Sep 17 00:00:00 2001 From: Shivam Kumar Date: Tue, 7 Apr 2026 17:52:07 +0530 Subject: [PATCH 13/16] fix github actions workflow --- .github/workflows/reviewing_changes.yml | 22 ++++++++++++++------ NUnit-BrowserStack/NUnit-BrowserStack.csproj | 2 +- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/reviewing_changes.yml b/.github/workflows/reviewing_changes.yml index dfd638e..b13b302 100644 --- a/.github/workflows/reviewing_changes.yml +++ b/.github/workflows/reviewing_changes.yml @@ -16,8 +16,19 @@ jobs: strategy: fail-fast: false max-parallel: 3 + # .net5 runner doesn't installed at runtime, so skipping it and adding other .net latest versions. + # added target-framework in matrix to avoid runtime errors as each runner has only its matching runtime installed. matrix: - dotnet: ['6.0.x', '5.0.x'] + dotnet: ['6.0.x', '8.0.x', '9.0.x', '10.0.x'] + include: + - dotnet: '6.0.x' + target-framework: 'net6.0' + - dotnet: '8.0.x' + target-framework: 'net8.0' + - dotnet: '9.0.x' + target-framework: 'net9.0' + - dotnet: '10.0.x' + target-framework: 'net10.0' os: [ windows-latest ] name: NUnit Repo ${{ matrix.dotnet }} - ${{ matrix.os }} Sample env: @@ -53,16 +64,15 @@ jobs: dotnet-version: ${{ matrix.dotnet }} - name: Install dependencies - run: | + run: | dotnet --version - dotnet build - + dotnet build /p:TargetFramework=${{ matrix.target-framework }} - name: Run sample tests - run: dotnet test --filter "Category=sample-test" + run: dotnet test --filter "Category=sample-test" /p:TargetFramework=${{ matrix.target-framework }} - name: Run local tests - run: dotnet test --filter "Category=sample-local-test" + run: dotnet test --filter "Category=sample-local-test" /p:TargetFramework=${{ matrix.target-framework }} - if: always() uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 diff --git a/NUnit-BrowserStack/NUnit-BrowserStack.csproj b/NUnit-BrowserStack/NUnit-BrowserStack.csproj index c3e4e8b..3161a59 100644 --- a/NUnit-BrowserStack/NUnit-BrowserStack.csproj +++ b/NUnit-BrowserStack/NUnit-BrowserStack.csproj @@ -1,7 +1,7 @@  - net6.0 + net6.0;net8.0;net9.0;net10.0 SingleTest SingleTest enable From 099a514b389a5203196016fa5f2da982467d03f1 Mon Sep 17 00:00:00 2001 From: Shivam Kumar Date: Wed, 8 Apr 2026 19:39:55 +0530 Subject: [PATCH 14/16] fix: use global.json --- .github/workflows/reviewing_changes.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/reviewing_changes.yml b/.github/workflows/reviewing_changes.yml index b13b302..e0d9cc7 100644 --- a/.github/workflows/reviewing_changes.yml +++ b/.github/workflows/reviewing_changes.yml @@ -59,10 +59,18 @@ jobs: console.log('Failed to create check run') } - name: Setup dotnet + id: setup-dotnet uses: actions/setup-dotnet@v3 with: dotnet-version: ${{ matrix.dotnet }} + - name: Pin SDK version via global.json + run: | + $version = "${{ matrix.target-framework }}".Replace("net","") + ".0" + "{`"sdk`":{`"version`":`"$version`",`"rollForward`":`"latestPatch`"}}" | Set-Content global.json + Get-Content global.json + shell: pwsh + - name: Install dependencies run: | dotnet --version From a03cf4206b5ac481698b5c4775be9f918b780fe5 Mon Sep 17 00:00:00 2001 From: Shivam Kumar Date: Wed, 8 Apr 2026 19:48:23 +0530 Subject: [PATCH 15/16] fix: requierd version for global.json --- .github/workflows/reviewing_changes.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reviewing_changes.yml b/.github/workflows/reviewing_changes.yml index e0d9cc7..2e24895 100644 --- a/.github/workflows/reviewing_changes.yml +++ b/.github/workflows/reviewing_changes.yml @@ -66,8 +66,9 @@ jobs: - name: Pin SDK version via global.json run: | - $version = "${{ matrix.target-framework }}".Replace("net","") + ".0" - "{`"sdk`":{`"version`":`"$version`",`"rollForward`":`"latestPatch`"}}" | Set-Content global.json + $major = "${{ matrix.target-framework }}".Replace("net","").Split(".")[0] + $version = "$major.0.100" + "{`"sdk`":{`"version`":`"$version`",`"rollForward`":`"latestFeature`"}}" | Set-Content global.json Get-Content global.json shell: pwsh From cff99e96402d3c9e2529f447affc4dc779eba026 Mon Sep 17 00:00:00 2001 From: Shivam Kumar Date: Wed, 8 Apr 2026 20:22:27 +0530 Subject: [PATCH 16/16] added global.json for version match --- .github/workflows/reviewing_changes.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/reviewing_changes.yml b/.github/workflows/reviewing_changes.yml index 2e24895..10e3173 100644 --- a/.github/workflows/reviewing_changes.yml +++ b/.github/workflows/reviewing_changes.yml @@ -75,13 +75,13 @@ jobs: - name: Install dependencies run: | dotnet --version - dotnet build /p:TargetFramework=${{ matrix.target-framework }} + dotnet build /p:TargetFrameworks=${{ matrix.target-framework }} /p:TargetFramework=${{ matrix.target-framework }} - name: Run sample tests - run: dotnet test --filter "Category=sample-test" /p:TargetFramework=${{ matrix.target-framework }} + run: dotnet test --filter "Category=sample-test" /p:TargetFrameworks=${{ matrix.target-framework }} /p:TargetFramework=${{ matrix.target-framework }} - name: Run local tests - run: dotnet test --filter "Category=sample-local-test" /p:TargetFramework=${{ matrix.target-framework }} + run: dotnet test --filter "Category=sample-local-test" /p:TargetFrameworks=${{ matrix.target-framework }} /p:TargetFramework=${{ matrix.target-framework }} - if: always() uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975