Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mattleibow committed Nov 30, 2023
1 parent 062f50d commit 9ab13fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 0 additions & 3 deletions src/TestUtils/src/UITest.Appium/AppiumAndroidApp.cs
Expand Up @@ -34,9 +34,6 @@ public static AppiumAndroidApp CreateAndroidApp(Uri remoteAddress, IConfig confi
//// TODO: Check for installed package first?
//AndroidEmulator.InstallPackage(apkPath, pkgName, outDir);
var androidApp = new AppiumAndroidApp(remoteAddress, config);
var logs = androidApp.Driver.Manage().Logs;
Console.WriteLine($"Available log types: {string.Join(", ", logs.AvailableLogTypes)}");
logs.GetLog("logcat"); // do nothing with the result and clear the log buffer
androidApp.Driver.ActivateApp(pkgName);
return androidApp;
}
Expand Down
7 changes: 5 additions & 2 deletions src/TestUtils/src/UITest.NUnit/UITestBase.cs
Expand Up @@ -56,10 +56,10 @@ protected virtual void FixtureTeardown()
[TearDown]
public void UITestBaseTearDown()
{
SaveAppLogs();

if (App.AppState == ApplicationState.NotRunning)
{
SaveAppLogs();

Reset();
FixtureSetup();

Expand All @@ -72,6 +72,7 @@ public void UITestBaseTearDown()
if (testOutcome == ResultState.Error ||
testOutcome == ResultState.Failure)
{
SaveAppLogs();
SaveAppSnapshots();
}
}
Expand Down Expand Up @@ -160,6 +161,8 @@ void SaveAppSnapshots([CallerMemberName] string? note = null)
else
note = $"-{note}-";

filename = $"{Path.GetFileNameWithoutExtension(filename)}-{Guid.NewGuid().ToString("N")}{Path.GetExtension(filename)}";

var logDir =
Path.GetDirectoryName(Environment.GetEnvironmentVariable("APPIUM_LOG_FILE") ??
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location))!;
Expand Down

0 comments on commit 9ab13fb

Please sign in to comment.