Skip to content

Add reqnroll-nunit-appium App Automate sample (Android)#1

Open
AakashHotchandani wants to merge 7 commits into
mainfrom
sdk-sample
Open

Add reqnroll-nunit-appium App Automate sample (Android)#1
AakashHotchandani wants to merge 7 commits into
mainfrom
sdk-sample

Conversation

@AakashHotchandani

Copy link
Copy Markdown
Collaborator

Import generated + live-validated BrowserStack SDK sample content, replacing the init scaffold. Single clean commit; safety-gated to contain no run artifacts or credentials.

@AakashHotchandani AakashHotchandani requested a review from a team as a code owner June 10, 2026 13:07
Comment thread .github/workflows/sdk-sample-test.yml Fixed

@07souravkunda 07souravkunda left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, modern sample — it actually improves on the existing nunit-appium-app-browserstack sibling in CI hygiene (explicit least-privilege permissions:, the status-check pattern, testObservability: true). Approve with suggestions; details are in the inline comments.

The one I'd genuinely push on before merge is the bs:// app reference in browserstack.yml: unlike the sibling (which commits the public apk and references it by relative path), an account-bound bs:// hash expires and won't work on a customer's own account out of the box — and it leaves the local test non-runnable as shipped. The rest are alignment nits against the sibling sample (target frameworks, the redundant BrowserStackLocal reference, source:/framework: yml fields, and a cd typo in the README).

Comment thread android/browserstack.yml Outdated
# Application under test
# ==========================================
# Pre-uploaded WikipediaSample.apk on BrowserStack (use this bs:// url verbatim).
app: bs://92d48b416632f2b1734259565ceab61b05ad0b24

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pins the app under test to an account-bound bs:// hash. App Automate uploads age out, so over time — or on any account other than the one holding the CI secrets — dotnet test will fail out of the box. It also makes @sample-local-test non-runnable as shipped: there's no LocalSample.apk, and this bs:// points at the Wikipedia app.

Evidence: The established App Automate C# sample browserstack/nunit-appium-app-browserstack commits the public sample apps and references them by relative path (app: ./WikipediaSample.apk), overriding with BROWSERSTACK_APP for the local test — so it runs immediately on any account and never goes stale. The expiry caveat here lives only in the workflow comment, not the README.

Fix: commit the public WikipediaSample.apk and use app: ./WikipediaSample.apk for parity with the sibling, or at minimum surface the upload/expiry requirement in the README so customers know to re-upload on their own account.

Question for author: was bs:// chosen deliberately to keep the repo lightweight, accepting the expiry tradeoff?

Comment thread android/android.csproj Outdated
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This single-targets net8.0, but the README states "net6.0+ is supported," and the sibling sample nunit-appium-app-browserstack multi-targets net6.0;net8.0;net9.0;net10.0 (and CI-tests all four). The README claim and the project don't agree.

Fix: either multi-target to match the README + sibling, or change the README to say net8.0 (the CI matrix follows from whichever you pick).

Minor, same file: Microsoft.NET.Test.Sdk is 17.0.0 here vs 17.1.0 in the sibling — worth bumping to ≥17.1.0 (ideally newer for net8.0) while you're in this file.

Comment thread android/android.csproj Outdated
<!-- BrowserStack SDK: instruments the test runner and routes the Appium
session to the BrowserStack cloud using android/browserstack.yml. -->
<PackageReference Include="BrowserStack.TestAdapter" Version="0.*" />
<PackageReference Include="BrowserStackLocal" Version="2.0.0" />

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sibling App Automate sample nunit-appium-app-browserstack — which also exercises BrowserStack Local — ships with no BrowserStackLocal package reference. The SDK/binary starts and manages the tunnel automatically when browserstackLocal: true, which the README here states too. This reference looks like a leftover from a non-SDK Local setup, and could mislead customers copying the sample into adding a dependency they don't need.

Fix: remove BrowserStackLocal unless the test code uses it directly (it doesn't appear to).

Comment thread android/browserstack.yml Outdated
# =======================
parallelsPerPlatform: 1

source: reqnroll-nunit-appium-app-browserstack:sample-sdk:v1.0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two small alignment items with the established sample convention:

  • source: here is reqnroll-nunit-appium-app-browserstack:sample-sdk:v1.0, but the sibling nunit-appium-app-browserstack uses a framework-led token: nunit:appium-sample-sdk:v1.0. Suggest matching the shape, e.g. reqnroll:appium-sample-sdk:v1.0.
  • The framework: reqnroll key (line 16) isn't present in the sibling's yml — the SDK auto-detects the framework from the installed packages. Question: is this key actually read/honored, or is it redundant? The inline comment claims it "lets the SDK send test context," which may be misleading if detection is automatic.

Comment thread README.md Outdated

```bash
git clone <this-repo>
cd reqnroll-nunit-appium

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cd reqnroll-nunit-appium — the repo clones to reqnroll-nunit-appium-app-browserstack/, so this is the first command a customer copy-pastes and it lands in a non-existent directory. (The "Run Sample Test" section below correctly does cd android.)

Fix: cd reqnroll-nunit-appium-app-browserstack

…ccount-bound bs://), multi-target net6/8/9/10, drop redundant BrowserStackLocal + framework: yml key, framework-led source token, bump Test.Sdk 17.1.0, fix README cd path
Comment thread android/browserstack.yml
# =======================================
# Platforms (Devices to test)
# =======================================
platforms:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why 1 platform? let's add 3 platforms

Comment thread .github/workflows/sdk-sample-test.yml Outdated
max-parallel: 3
matrix:
os: [windows-latest]
dotnet: ['8.0.x']

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8, 9, 10

Comment thread android/browserstack.yml
# BrowserStack Reporting
# ======================
projectName: BrowserStack Samples
buildName: appauto-reqnroll-nunit-appium

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BrowserStack Build

@AakashHotchandani

Copy link
Copy Markdown
Collaborator Author

Thanks for the detailed review, @07souravkunda 🙏 — all addressed in the latest commits:

  • bs:// app — great catch. Switched to committing the public WikipediaSample.apk (+ LocalSample.apk for the local test) and referencing by relative path (app: ./WikipediaSample.apk), matching the nunit-appium sibling — runs on any account now, no expiry. The bs:// was a generation shortcut, not a deliberate choice. (Also propagated this across the other App Automate samples.)
  • framework: key — you're right, it's redundant for C#. Confirmed the C# SDK auto-detects the framework from the installed NuGet package (Reqnroll.NUnit) / the BROWSERSTACK_FRAMEWORK env var, not from browserstack.yml. Removed it (and the misleading inline comment).
  • BrowserStackLocal package — removed; the SDK manages the Local tunnel automatically when browserstackLocal: true.
  • source:reqnroll:appium-sample-sdk:v1.0 (framework-led token, matching the sibling).
  • target framework / README — kept a single net8.0 target and updated the README to say net8.0 (consistent with the CI matrix and avoids a broken multi-target build); bumped Microsoft.NET.Test.Sdk to 17.1.0.
  • README cd path fixed → cd reqnroll-nunit-appium-app-browserstack.

Also folded these back into our sample-repo generator so future samples don't repeat them. PTAL when you get a chance!

@AakashHotchandani

Copy link
Copy Markdown
Collaborator Author

Quick follow-up from a broader "sync with the pre-existing sibling repos" pass: I changed the target framework from a single net8.0 to multi-target net6.0;net8.0;net9.0;net10.0 with a matching dotnet-version CI matrix (--framework per entry), to mirror the nunit-appium sibling exactly. Everything from the earlier round (committed apps + relative path, removed framework:/BrowserStackLocal, framework-led source:, README cd fix) still stands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants