Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 31, 2025

Merges changes from #31009 to enable agents to build, deploy, and test MAUI applications.

Note: This PR has been rebased onto main (commit d4eb91b) to resolve merge conflicts.

Changes

.github/copilot-instructions.md

  • Added Appium WebDriver to tech stack
  • Expanded UI testing section with deployment commands for Android/iOS TestCases.HostApp
  • Added troubleshooting guide for Android resource ID crashes and logcat debugging
  • Added coding standards section covering performance patterns, error handling, and code style
  • Added UI Testing Guide and Architecture documentation links to Additional Resources section

docs/UITesting-Guide.md (new)

  • Complete UI testing guide: prerequisites, running tests locally, test structure
  • Platform-specific deployment workflows for Android and iOS
  • Examples for adding new tests following HostApp + Test Implementation pattern
  • Consistent date format (2025-10-30) in frontmatter and document footer

docs/design/UITesting-Architecture.md (new)

  • CI/CD integration and architecture details for UI testing

.github/instructions/uitests.instructions.md (new)

  • Path-specific detailed instructions for UI test files

.github/instructions/templates.instructions.md (updated)

  • Working with .NET MAUI Templates

AGENTS.md (new)

  • Universal guidance for all AI coding assistants

Usage Example

Deploy and test on Android:

# Deploy TestCases.HostApp
dotnet build src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj \
  -f net10.0-android -t:Run

# Run specific test
dotnet test src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj \
  --filter "FullyQualifiedName~Issue11311"

Agents can now autonomously build, deploy, and validate MAUI UI tests.

Recent Updates

  • ✅ Fixed date format consistency in UITesting-Guide.md (commit d87bc1c7)
  • ✅ Successfully rebased onto origin/main with conflict resolution in Additional Resources section
  • ✅ Combined existing resource links from main with new UI testing documentation links
Original prompt

Can you merge the changes from #31009 and merge them into the base branch I've selected here?

The main goal here is that I want to be able to provide a set of agent instructions that will make the agent able to launch and deploy the apps from our solution


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add agent instructions to launch and deploy apps Merge PR #31009: Add agent instructions for UI test deployment Oct 31, 2025
Copilot AI requested a review from PureWeen October 31, 2025 20:32
Copilot finished work on behalf of PureWeen October 31, 2025 20:32
@PureWeen PureWeen force-pushed the copilot/add-agent-instructions-for-deployment branch from cbc7a54 to 3be5e40 Compare October 31, 2025 22:06
Base automatically changed from copilot/update-markdown-files to main November 1, 2025 18:34
@PureWeen
Copy link
Member

PureWeen commented Nov 1, 2025

/rebase

@PureWeen PureWeen marked this pull request as ready for review November 1, 2025 18:36
@PureWeen
Copy link
Member

PureWeen commented Nov 1, 2025

@copilot please resolve merge conflicts

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR reorganizes and significantly improves the UI testing documentation for .NET MAUI by:

  • Splitting the old monolithic docs/design/UITesting.md into two focused documents: a practical guide (docs/UITesting-Guide.md) and an architecture document (docs/design/UITesting-Architecture.md)
  • Adding a new AGENTS.md file at the repository root for universal AI coding assistant guidance
  • Creating path-specific instructions for UI tests (uitests.instructions.md)
  • Updating the main copilot instructions with synchronization requirements and improved troubleshooting sections
  • Standardizing front-matter metadata format in template instructions

Key Changes

  • New comprehensive 613-line UI testing guide with complete examples, prerequisites, and best practices
  • New architecture document focusing on CI/CD integration and advanced patterns
  • Universal AGENTS.md file (378 lines) with setup commands, testing guidance, and troubleshooting
  • Path-specific UI test instructions (303 lines) for Copilot when working in test directories
  • Improved copilot-instructions.md with troubleshooting section and cross-file synchronization requirements

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
docs/design/UITesting.md Removed old monolithic testing doc (143 lines deleted)
docs/design/UITesting-Architecture.md New architecture and CI integration guide focusing on advanced topics
docs/UITesting-Guide.md New comprehensive practical guide for day-to-day UI test writing
AGENTS.md New universal guidance file for all AI coding assistants with setup and testing workflows
.github/instructions/uitests.instructions.md New path-specific Copilot instructions for UI test code
.github/instructions/templates.instructions.md Standardized front-matter format (applyTo vs applies_to)
.github/copilot-instructions.md Enhanced with synchronization requirements, troubleshooting, and references to new docs

Copy link
Contributor Author

Copilot AI commented Nov 1, 2025

@copilot please resolve merge conflicts

I've resolved the merge conflicts by rebasing this branch onto origin/main (commit 53de82d).

The main branch already contains all the UI testing documentation from PR #32064 and PR #32270, which this PR intended to add. The branch is now aligned with main and all conflicts are resolved.

Note: The branch will need a force-push to update the remote. The local branch is clean and ready - it's currently one commit ahead of main with just an empty rebase marker commit.

Copilot finished work on behalf of PureWeen November 1, 2025 18:53
@PureWeen PureWeen force-pushed the copilot/add-agent-instructions-for-deployment branch from 0f9f9d8 to 80c7e8c Compare November 1, 2025 19:41
@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Contributor

@jsuarezruiz jsuarezruiz left a comment

Choose a reason for hiding this comment

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

@copilot Rebase and fix the current conflict?

Copy link
Contributor Author

Copilot AI commented Nov 3, 2025

@copilot Rebase and fix the current conflict?

Rebase completed successfully in commit d87bc1c7. The branch is now based on origin/main (d4eb91b) with all conflicts resolved. The Additional Resources section was updated to include both the existing links from main and the new UI testing documentation links.

Note: The local branch is ready but needs a force-push to update the remote. The rebase history shows:

  • Base: origin/main (d4eb91b - "Fix broken links in documentation...")
  • 5 commits rebased successfully with 1 conflict resolved

Copilot AI requested a review from jsuarezruiz November 3, 2025 12:58
Copilot finished work on behalf of jsuarezruiz November 3, 2025 12:58
@PureWeen PureWeen force-pushed the copilot/add-agent-instructions-for-deployment branch from fd4be9c to a325625 Compare November 3, 2025 15:43
xcrun simctl boot $UDID 2>/dev/null || true

# Install the app to the simulator
xcrun simctl install $UDID artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-ios/iossimulator-arm64/Controls.TestCases.HostApp.app
Copy link
Member

Choose a reason for hiding this comment

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

@rolfbjarne is this alright? Are there better more dotnet ways to do this?

I can't use dotnet -t:run because it doesn't return so copilot just gets stuck

Copy link
Member

Choose a reason for hiding this comment

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

Would it be more reliable if you didn't try to get it to discover a $UDID at all? What if you left that blank and it just launched the default iPad that it does when you leave that information out?

Copy link
Member

Choose a reason for hiding this comment

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

I don't know what "dotnet test" does, but if you just need the app installed in the simulator, that'll work. We don't have any dotnet way to just install, without running.

Copy link
Member

@PureWeen PureWeen Nov 3, 2025

Choose a reason for hiding this comment

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

@jonathanpeppers we have specific devices that we use for screen shots. So, for the purpose of running the tests locally and generating those screen shots we need it to default to the right device.

@rolfbjarne thank you! Yea, we just need the app installed and that's it. Dotnet test will take care of everything else (launching) via appium

**Step 1: Find iPhone Xs with highest API level**
```bash
# View all iPhone Xs devices with their iOS versions
xcrun simctl list devices available | awk '/^--.*iOS/ {version=$0} /iPhone Xs/ {print version " -> " $0}'
Copy link
Member

Choose a reason for hiding this comment

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

It's going to be more reliable to get json output, and then transform it using jq:

xcrun simctl list devices available --json | jq '...'

xcrun simctl boot $UDID 2>/dev/null || true

# Install the app to the simulator
xcrun simctl install $UDID artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-ios/iossimulator-arm64/Controls.TestCases.HostApp.app
Copy link
Member

Choose a reason for hiding this comment

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

I don't know what "dotnet test" does, but if you just need the app installed in the simulator, that'll work. We don't have any dotnet way to just install, without running.

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.

5 participants