Skip to content

Commit

Permalink
test: refactor OrientationTest to improve teardown logic and reset or…
Browse files Browse the repository at this point in the history
…ientation (appium#890)
  • Loading branch information
Dor-bl authored Dec 29, 2024
1 parent 9035eea commit 4e94435
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions test/integration/IOS/OrientationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,21 @@ public void BeforeAll()
public void AfterAll()
{
_driver?.Quit();
if (!Env.ServerIsRemote())
{
AppiumServers.StopLocalService();
}
if (Env.ServerIsRemote()) return;
AppiumServers.StopLocalService();
}

[TearDown]
public void AfterEach()
{
var rotatable = (IRotatable)_driver;
rotatable.Orientation = ScreenOrientation.Portrait;
}

[Test]
public void DeviceOrientationTest()
{
var rotatable = ((IRotatable) _driver);
var rotatable = (IRotatable) _driver;
rotatable.Orientation = ScreenOrientation.Landscape;
Assert.That(rotatable.Orientation, Is.EqualTo(ScreenOrientation.Landscape));
}
Expand Down

0 comments on commit 4e94435

Please sign in to comment.