Skip to content

Commit

Permalink
Flakey test fixes (#22338)
Browse files Browse the repository at this point in the history
  • Loading branch information
PureWeen committed May 11, 2024
1 parent 4bf8af5 commit 39f90ee
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
Expand Up @@ -7,11 +7,6 @@
Text="Test"
Clicked="OnToolbarItemClicked"/>
</ContentPage.ToolbarItems>
<Grid>
<Label
AutomationId="SecondPageLoaded"
HorizontalOptions="Center"
VerticalOptions="Center"
Text="Issue 7823" />
<Grid x:Name="grid">
</Grid>
</ContentPage>
Expand Up @@ -13,6 +13,18 @@ public Issue7823Page2()
InitializeComponent();
}

protected override void OnNavigatedTo(NavigatedToEventArgs args)
{
base.OnNavigatedTo(args);
grid.Add(new Label()
{
AutomationId = "SecondPageLoaded",
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.Center,
Text = "Issue 7823"
});
}

async void OnToolbarItemClicked(object sender, EventArgs e)
{
await Navigation.PopAsync();
Expand Down
10 changes: 8 additions & 2 deletions src/Controls/tests/UITests/UITest.cs
Expand Up @@ -73,10 +73,16 @@ public override IConfig GetTestConfig()
config.SetProperty("Udid", Environment.GetEnvironmentVariable("DEVICE_UDID") ?? "");
break;
case TestDevice.Windows:
var appProjectFolder = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "..\\..\\..\\..\\..\\samples\\Controls.Sample.UITests");
var appProjectFolder = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "..\\..\\..\\Controls.Sample.UITests");
var appProjectPath = Path.Combine(appProjectFolder, "Controls.Sample.UITests.csproj");
var windowsExe = "Controls.Sample.UITests.exe";
var windowsExePath = Path.Combine(appProjectFolder, $"bin\\{configuration}\\{frameworkVersion}-windows10.0.20348.0\\win10-x64\\{windowsExe}");
var windowsExePath = Path.Combine(appProjectFolder, $"{configuration}\\{frameworkVersion}-windows10.0.20348.0\\win10-x64\\{windowsExe}");
var windowsExePath19041 = Path.Combine(appProjectFolder, $"{configuration}\\{frameworkVersion}-windows10.0.19041.0\\win10-x64\\{windowsExe}");

if (!File.Exists(windowsExePath) && File.Exists(windowsExePath19041))
{
windowsExePath = windowsExePath19041;
}

var appPath = string.IsNullOrEmpty(Environment.GetEnvironmentVariable("WINDOWS_APP_PATH"))
? windowsExePath
Expand Down

0 comments on commit 39f90ee

Please sign in to comment.