Commit a14b855
authored
[Testing] Rework Catalyst Test Runner to use startup arguments instead of UI navigation (dotnet#31673)
### Description of Change
#### This PR reopens the work from the closed
[dotnet#30651](dotnet#30651)
This pull request introduces functionality to streamline test execution
by allowing tests to be launched directly via startup arguments or
programmatically. Key changes include adding support for passing test
names as environment variables, introducing a `PageFactory` mechanism
for dynamic page creation, and enhancing test lifecycle management for
specific platforms like Mac Catalyst.
Note: This PR is an extension of the
PR(dotnet#30286) with a proper
implementation.
#### Test Execution Enhancements:
- **Startup Argument Support**: Added logic to retrieve test names from
environment variables and dynamically load the corresponding test page
in `CreateDefaultMainPage()` (`MauiProgram.cs`).
- **Dynamic Page Creation**: Introduced a `PageFactory` property in the
`IssueModel` class to enable dynamic test page instantiation
(`TestCases.cs`).
- **Direct Test Page Retrieval**: Implemented `TryToGetTestPage()` in
`TestCaseScreen` to retrieve test pages by description using
`PageFactory` (`TestCases.cs`).
#### Platform-Specific Test Lifecycle Improvements:
- **Mac Catalyst Test Configuration**: Enhanced `_IssuesUITest` to pass
test names as startup arguments and manage app launch/close lifecycle
specifically for Mac Catalyst (`_IssuesUITest.cs`).
[[1]](https://github.com/dotnet/maui/pull/30651/files#diff-6e8c0ea1f2979b5484d14facb1aa5b2ccef3ee748f1606eaf46220ac0936e3edR22-R46)
[[2]](https://github.com/dotnet/maui/pull/30651/files#diff-6e8c0ea1f2979b5484d14facb1aa5b2ccef3ee748f1606eaf46220ac0936e3edR58-R61)
- ** Appium Options for Mac Catalyst**: Updated `AppiumCatalystApp` to
include environment variables in Appium options for test execution
(`AppiumCatalystApp.cs`).
#### Helper Methods for Test Execution:
- **Parameterized App Launch**: Added a method to launch apps with
additional parameters, supporting test-specific configurations
(`HelperExtensions.cs`).
- **Mac-Specific App Closure**: Modified `FixtureOneTimeTearDown()` to
handle app closure for Mac Catalyst during test teardown
(`UITestBase.cs`).
### Output
https://github.com/user-attachments/assets/82fc12ad-b0d3-4bad-901f-0ab6b2bddda1
### Issues Fixed
Fixes dotnet#302851 parent a1abaf8 commit a14b855
File tree
113 files changed
+448
-457
lines changed- src
- Controls/tests
- TestCases.HostApp
- CoreViews
- Issues
- Bugzilla
- XFIssue
- TestCases.Mac.Tests/snapshots/mac
- TestCases.WinUI.Tests/snapshots/windows
- TestUtils/src
- UITest.Appium
- Actions
- UITest.NUnit
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
113 files changed
+448
-457
lines changedLines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
196 | 215 | | |
197 | 216 | | |
198 | 217 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | | - | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
71 | 96 | | |
72 | 97 | | |
73 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
| 127 | + | |
126 | 128 | | |
127 | 129 | | |
128 | 130 | | |
| |||
195 | 197 | | |
196 | 198 | | |
197 | 199 | | |
198 | | - | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
199 | 203 | | |
200 | 204 | | |
201 | 205 | | |
| |||
238 | 242 | | |
239 | 243 | | |
240 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
241 | 262 | | |
242 | 263 | | |
243 | 264 | | |
| |||
0 commit comments