Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fixes and code improvements on Windows MultiSelectControlTest #739

Merged
merged 1 commit into from
Feb 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions test/integration/Windows/MultiSelectControlTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void OneTimeTearDown()
alarmEntry.Click();
AlarmClockSession.FindElement(MobileBy.AccessibilityId("DeleteButton")).Click();
}

AlarmClockSession.Quit();
AlarmClockSession.Dispose();
AlarmClockSession = null;
DesktopSession.Dispose();
Expand All @@ -93,27 +93,27 @@ public void FullMultiSelectScenario()
// Read the current local time
SwitchToWorldClockTab();
var localTimeText = ReadLocalTime();
Assert.That(localTimeText.Length > 0);
Assert.That(localTimeText, Is.Not.Empty);

// Add an alarm at 1 minute after local time
SwitchToAlarmTab();
AddAlarm(localTimeText);
Thread.Sleep(300);
var alarmEntries = AlarmClockSession.FindElements(MobileBy.Name("Windows Application Driver Test Alarm"));
Assert.That(alarmEntries.Count > 0);
Assert.That(alarmEntries, Is.Not.Empty);
}

public static void SwitchToAlarmTab()
private static void SwitchToAlarmTab()
{
AlarmClockSession.FindElement(MobileBy.AccessibilityId("AlarmButton")).Click();
}

public void SwitchToWorldClockTab()
private static void SwitchToWorldClockTab()
{
AlarmClockSession.FindElement(MobileBy.AccessibilityId("ClockButton")).Click();
}

public string ReadLocalTime()
private static string ReadLocalTime()
{
var localTimeText = "";
AppiumElement worldClockPivotItem =
Expand All @@ -126,7 +126,7 @@ public string ReadLocalTime()
foreach (var timeString in timeStrings)
{
// Get the time. E.g. "11:32 AM" from "Local time, Monday, February 22, 2016, 11:32 AM, "
if (timeString.Contains(":"))
if (timeString.Contains(':'))
{
localTimeText = new string(timeString.Trim().Where(c => c < 128).ToArray()); // Remove 8206 character, see https://stackoverflow.com/questions/18298208/strange-error-when-parsing-string-to-date
break;
Expand All @@ -137,7 +137,7 @@ public string ReadLocalTime()
return localTimeText;
}

public void AddAlarm(string timeText)
private static void AddAlarm(string timeText)
{
if (timeText.Length > 0)
{
Expand Down Expand Up @@ -171,7 +171,7 @@ public void AddAlarm(string timeText)
}
}

public void DismissNotification()
private static void DismissNotification()
{
try
{
Expand Down