forked from dotnet/maui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into mos379-main
- Loading branch information
Showing
720 changed files
with
11,938 additions
and
6,906 deletions.
There are no files selected for viewing
This file contains 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
Validating CODEOWNERS rules …
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
blank_issues_enabled: true | ||
contact_links: | ||
- name: .NET MAUI Community Support | ||
url: https://docs.microsoft.com/answers/topics/dotnet-maui.html | ||
url: https://learn.microsoft.com/answers/topics/dotnet-maui.html | ||
about: Please ask and answer questions here. | ||
- name: Bug report or feature request for Visual Studio for Windows and Mac | ||
url: https://learn.microsoft.com/visualstudio/ide/how-to-report-a-problem-with-visual-studio?view=vs-2022 | ||
about: Use Visual Studio's Report a Problem feature for issues and suggestions with Visual Studio tooling | ||
- name: Bug report or feature request for Visual Studio Code (including C# Dev Kit) | ||
url: https://github.com/microsoft/vscode-dotnettools/issues | ||
about: Use the microsoft/vscode-dotnettools repo to report issues with Visual Studio Code |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Daily code format check net7.0 branch | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: 0 0 * * * # Every day at midnight (UTC) | ||
|
||
permissions: | ||
pull-requests: write | ||
contents: write | ||
|
||
jobs: | ||
dotnet-format: | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: net7.0 | ||
|
||
- name: Setup .NET Core SDK | ||
uses: actions/setup-dotnet@v3.2.0 | ||
with: | ||
dotnet-version: 7.0.304 | ||
|
||
- name: Run dotnet format | ||
run: dotnet format .\Microsoft.Maui.sln --no-restore --exclude Templates/src BlazorWebView/src/SharedSource/BlazorWebViewDeveloperTools.cs BlazorWebView/src/SharedSource/BlazorWebViewServiceCollectionExtensions.cs Graphics/src/Graphics.Win2D/W2DCanvas.cs Graphics/src/Graphics.Win2D/W2DExtensions.cs | ||
|
||
- name: Commit files | ||
if: steps.format.outputs.has-changes == 'true' | ||
run: | | ||
git config --local user.name "github-actions[bot]" | ||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git commit -a -m 'Automated dotnet-format update' | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v3 | ||
with: | ||
title: '[housekeeping] Automated PR to fix formatting errors' | ||
body: | | ||
Automated PR to fix formatting errors | ||
committer: GitHub <noreply@github.com> | ||
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | ||
labels: | | ||
t/housekeeping ♻︎ | ||
area/infrastructure 🏗️ | ||
assignees: rmarinho, jsuarezruiz | ||
reviewers: rmarinho, jsuarezruiz | ||
branch: housekeeping/fix-codeformatting-net7.0 | ||
base: net7.0 |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
UI Testing | ||
=== | ||
|
||
# Introduction | ||
|
||
Currently we are using [Appium](https://appium.io/docs/en/2.0/) to facilitate UI automation for Windows, Catalyst, iOS, and Android. | ||
Appium relies on different implementations called `drivers` for each platform that have different behaviors/functions. | ||
* Windows - [WinAppDriver](https://github.com/appium/appium-windows-driver) | ||
* Catalyst - [mac2](https://github.com/appium/appium-mac2-driver) | ||
* iOS - [XCUITest](https://github.com/appium/appium-xcuitest-driver) | ||
* Android - [UIAutomator2](https://github.com/appium/appium-uiautomator2-driver) | ||
|
||
## Creating a new test | ||
|
||
### The sample project | ||
|
||
The project that is used for UI Tests is located here: `src\Controls\samples\Controls.Sample.UITests\Controls.Sample.UITests.csproj` | ||
|
||
There are two types of tests you can add, Issue and Gallery. | ||
|
||
### Adding a new Issue | ||
|
||
This will be the majority of new tests added which will be primarily for testing functionality and adding regression tests. | ||
|
||
You will need to create some kind of UI to test against, which will go in the Controls.Sample.UITests project. Create a new class and attribute it with `[Issue]` and derive from `TestContentPage`. | ||
|
||
Then in the Controls.AppiumTests project add a new class that derives from `_IssuesUITest` and add your test. | ||
|
||
You can use the example for the sample project [here](https://github.com/dotnet/maui/blob/main/src/Controls/samples/Controls.Sample.UITests/Issues/RefreshViewPage.cs) and the example for the corresponding test [here](https://github.com/dotnet/maui/tree/main/src/Controls/tests/UITests/Tests/Issues/RefreshViewTests.cs). | ||
|
||
|
||
|
||
|
||
### Adding a GalleryPage | ||
|
||
Gallery tests are to make it easier to run the same set of tests on controls, if you are creating a new control you would want to add a new gallery page. | ||
|
||
We have some base classes you can derive from to make setting this up easier: [CoreGalleryPage](https://github.com/dotnet/maui/blob/main/src/Controls/samples/Controls.Sample.UITests/CoreViews/CoreGalleryPage.cs) and [ContentViewGalleryPage](https://github.com/dotnet/maui/blob/main/src/Controls/samples/Controls.Sample.UITests/Elements/ContentViewGalleryPage.cs) | ||
|
||
All controls you intend to interact with need to set the 'AutomationId' property as this will be what you use to query for the element. | ||
|
||
Once you have created your GalleryPage, add it to [CorePageView](https://github.com/dotnet/maui/blob/5419846b1f20bdab1b5ce1dff40287edc5c38f12/src/Controls/samples/Controls.Sample.UITests/CoreViews/CorePageView.cs#L45C41-L45C41) so that it will show up on the main page at launch. | ||
|
||
### Adding the test | ||
|
||
The project that hosts the tests is located here: `src\Controls\tests\UITests\Controls.AppiumTests.csproj` | ||
|
||
This project is using [NUnit](https://nunit.org/) | ||
|
||
All tests should derive from `UITestBase` and should override `FixtureSetup/FixtureTeardown` to navigate to the specific UI you want to test and navigate back when finished. | ||
|
||
```csharp | ||
protected override void FixtureSetup() | ||
{ | ||
base.FixtureSetup(); | ||
App.NavigateToGallery(DragAndDropGallery); | ||
} | ||
``` | ||
|
||
```csharp | ||
protected override void FixtureTeardown() | ||
{ | ||
base.FixtureTeardown(); | ||
App.NavigateBack(); | ||
} | ||
``` | ||
|
||
The test will have access to gestures/interactions through the `App` property. | ||
|
||
```csharp | ||
App.WaitForElement("btnLogin"); | ||
App.EnterText("entryUsername", "user@email.com"); | ||
App.EnterText("entryPassword", "Password"); | ||
|
||
App.Tap("btnLogin"); | ||
var lblStatus = App.WaitForElement("lblStatus").FirstOrDefault(); | ||
var text = lblStatus?.Text; | ||
|
||
Assert.IsNotNull(text); | ||
Assert.IsTrue(text.StartsWith("Logging in", StringComparison.CurrentCulture)); | ||
``` | ||
|
||
## Running tests | ||
|
||
Please see the [wiki](https://github.com/dotnet/maui/wiki/UITests) for setting up/running tests. | ||
|
||
|
||
## Adding new functionality | ||
|
||
We are implementing the IApp interface from Xamarin UITests, the implementation of which is [here](https://github.com/dotnet/maui/blob/main/src/TestUtils/src/TestUtils.Appium.UITests/AppiumUITestApp.cs). | ||
|
||
## Known Issues | ||
- iOS doesn't support nested accessibility elements which will make some elements unreachable |
Oops, something went wrong.