Skip to content

Commit

Permalink
fix(test): add explicit wait for app package to load before assertion (
Browse files Browse the repository at this point in the history
  • Loading branch information
Dor-bl authored Oct 4, 2024
1 parent 4c35acb commit 1d6299d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/integration/Android/CurrentPackageTest.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
using Appium.Net.Integration.Tests.helpers;
using NUnit.Framework;
using OpenQA.Selenium.Appium.Android;
using OpenQA.Selenium.Support.UI;
using System;

namespace Appium.Net.Integration.Tests.Android
{
[TestFixture]
public class CurrentPackageTest
{
private AndroidDriver _driver;
private WebDriverWait _waitDriver;
private readonly TimeSpan _driverTimeOut = TimeSpan.FromSeconds(5);

private const string DemoAppPackage = "io.appium.android.apis";

[OneTimeSetUp]
Expand Down Expand Up @@ -37,6 +42,8 @@ public void TearDowwn()
[Test]
public void ReturnsCorrectNameForCurrentApp()
{
_waitDriver = new WebDriverWait(_driver, _driverTimeOut);
_waitDriver.Until(driver => _driver.CurrentPackage == DemoAppPackage);
Assert.That(_driver.CurrentPackage, Is.EqualTo(DemoAppPackage));
}
}
Expand Down

0 comments on commit 1d6299d

Please sign in to comment.