Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Add App UI testing project

オープン
#62 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
csharp

調査の方向性

まず既存の Tests.App プロジェクトと提案されている Tests.App.UI プロジェクトを比較し、次に issue に記載されている DependencyObjectSelectorTest.cs のセットアップを再現します。最初に WinUI 3 テンプレートのセットアップと、Microsoft.NET.Test.Sdk および UITestMethodAttribute のエラーを確認してください。別の UI テストプロジェクトで、報告されている entry-point または XAML 読み込みの失敗なしに、ウィンドウの DispatchQueue 内で UI スレッド上のテストを起動できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

We need a separate project for testing UI-related code from the App project. We currently have Tests.App but we probably should add Tests.App.UI as a separate project.

Test code needs to be launched on a UI thread inside of a window's DispatchQueue.

I've tried doing the following in a new solution to see how feasible it is to do, but have run into issue after issue:

  1. create App project from winui3 template
  2. create AppTest project from winui3 unit testing template
  3. add DependencyObjectSelector.cs to App (which doesn't depend on anything so it's just a simple copy/paste and change namespace)
  4. add DependencyObjectSelectorTest.cs to AppTest, and accept the suggestion to add a project reference to App
  5. click the greyed out test run icon beside the test method, accept the prompt to install Microsoft.NET.Test.Sdk
    click the green test run icon
  6. Program has more than one entry point defined. Compile with /main to specify the type that contains the entry point.
  7. add <StartupObject>AppTest.Program</StartupObject> (which is the XAML generated main from winui 3)
  8. An unhandled exception was thrown by the 'Execute' method. Please report this error to the author of the attribute 'Microsoft.VisualStudio.TestTools.UnitTesting.AppContainer.UITestMethodAttribute'.

I've also tried using the entry point from Microsoft.NET.Test.Sdk (which is empty) and doing winui 3 startup in an AssemblyInitializer, and it gets a bit further but I run into XAML loading issues.

主要言語
C#
スター
29
フォーク
12
平均マージ
4時間 15分
マージ済み PR(30日)
2

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

coder/coder-desktop-windows のほかの issue

coder/coder-desktop-windows の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。