Skip to content

Commit

Permalink
Fix code styling
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmcroft committed Mar 13, 2024
1 parent d0691c3 commit 6acf4a2
Show file tree
Hide file tree
Showing 252 changed files with 684 additions and 780 deletions.
4 changes: 1 addition & 3 deletions src/Legerity.Android/AndroidByExtras.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
namespace Legerity.Android;

using OpenQA.Selenium.Appium.Android.UiAutomator;

/// <summary>
/// Defines a collection of extra locator constraints for <see cref="By"/>.
/// </summary>
Expand All @@ -26,4 +24,4 @@ public static By PartialContentDescription(string contentDesc)
{
return new ByAndroidUIAutomator(new AndroidUiSelector().DescriptionContains(contentDesc));
}
}
}
2 changes: 0 additions & 2 deletions src/Legerity.Android/Elements/AndroidElementWrapper.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
namespace Legerity.Android.Elements;

using System;

using Exceptions;
using OpenQA.Selenium.Support.UI;

/// <summary>
/// Defines an element wrapper for an Android <see cref="WebElement"/>.
Expand Down
2 changes: 1 addition & 1 deletion src/Legerity.Android/Elements/Core/CheckBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ public virtual void CheckOff()

Click();
}
}
}
10 changes: 6 additions & 4 deletions src/Legerity.Android/Elements/Core/DatePicker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Legerity.Android.Elements.Core;
/// </summary>
public class DatePicker : AndroidElementWrapper
{
private readonly Dictionary<string, string> months = new()
private readonly Dictionary<string, string> _months = new()
{
{ "Jan", "01" },
{ "Feb", "02" },
Expand Down Expand Up @@ -65,13 +65,15 @@ public DatePicker(WebElement element)
/// Gets the element associated with the next month button.
/// </summary>
/// <exception cref="NoSuchElementException">Thrown when no element matches the expected locator.</exception>
public virtual Button NextMonthButton => Element.FindElementByAndroidUIAutomator("UiSelector().description(\"Next month\")");
public virtual Button NextMonthButton =>
Element.FindElementByAndroidUIAutomator("UiSelector().description(\"Next month\")");

/// <summary>
/// Gets the element associated with the previous month button.
/// </summary>
/// <exception cref="NoSuchElementException">Thrown when no element matches the expected locator.</exception>
public virtual Button PreviousMonthButton => Element.FindElementByAndroidUIAutomator("UiSelector().description(\"Previous month\")");
public virtual Button PreviousMonthButton =>
Element.FindElementByAndroidUIAutomator("UiSelector().description(\"Previous month\")");

/// <summary>
/// Gets the selected date/time value.
Expand Down Expand Up @@ -143,7 +145,7 @@ private DateTime GetCurrentViewDate(string currentDate, string currentYear)
var currentDateSplit = currentDate.Split(',').ToList();
var currentMonthPart = currentDateSplit.LastOrDefault();

months.TryGetValue(
_months.TryGetValue(
string.Join(string.Empty, (currentMonthPart ?? string.Empty).Where(char.IsLetter)).Trim(),
out var month);

Expand Down
2 changes: 1 addition & 1 deletion src/Legerity.Android/Elements/Core/EditText.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ public virtual void ClearText()
Click();
Element.Clear();
}
}
}
2 changes: 1 addition & 1 deletion src/Legerity.Android/Elements/Core/RadioButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ public static implicit operator RadioButton(WebElement element)
{
return new RadioButton(element);
}
}
}
8 changes: 4 additions & 4 deletions src/Legerity.Android/Elements/Core/Spinner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static implicit operator Spinner(WebElement element)
{
return new Spinner(element);
}

/// <summary>
/// Selects an item in the combo-box with the specified item name.
/// </summary>
Expand All @@ -53,7 +53,7 @@ public virtual void SelectItem(string name)
var locator =
new ByAndroidUIAutomator(
$"new UiScrollable(new UiSelector()).scrollIntoView(new UiSelector().text(\"{name}\"));");
WebElement item = Driver.FindElement(locator);
var item = Driver.FindElement(locator);

item.Click();
}
Expand All @@ -73,7 +73,7 @@ public virtual void SelectItemByPartialName(string partialName)
var locator =
new ByAndroidUIAutomator(
$"new UiScrollable(new UiSelector()).scrollIntoView(new UiSelector().textContains(\"{partialName}\"));");
WebElement item = Driver.FindElement(locator);
var item = Driver.FindElement(locator);

item.Click();
}
Expand All @@ -84,4 +84,4 @@ private string GetSelectedItem()
TextView textElement = FindElement(By.ClassName("android.widget.TextView"));
return textElement.Text;
}
}
}
4 changes: 2 additions & 2 deletions src/Legerity.Android/Elements/Core/Switch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static implicit operator Switch(WebElement element)
{
return new Switch(element);
}

/// <summary>
/// Toggles the switch on.
/// </summary>
Expand Down Expand Up @@ -69,4 +69,4 @@ public virtual void ToggleOff()

Click();
}
}
}
2 changes: 1 addition & 1 deletion src/Legerity.Android/Elements/Core/TextView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ public static implicit operator TextView(WebElement element)
{
return new TextView(element);
}
}
}
2 changes: 1 addition & 1 deletion src/Legerity.Android/Elements/Core/ToggleButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ public virtual void ToggleOff()

Click();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ namespace Legerity.Android.Extensions;

using System;
using Elements;
using OpenQA.Selenium.Support.UI;

/// <summary>
/// Defines a collection of extensions for <see cref="AndroidElementWrapper"/> objects.
Expand Down
2 changes: 1 addition & 1 deletion src/Legerity.Android/Extensions/AttributeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ public static bool GetCheckedState<TElement>(this IElementWrapper<TElement> elem
{
return GetCheckedState(element.Element);
}
}
}
2 changes: 1 addition & 1 deletion src/Legerity.Android/Extensions/ElementExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ public static WebElement FindElementByAndroidUIAutomator(this WebElement element
{
return element.FindElement(MobileBy.AndroidUIAutomator(selector)) as WebElement;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ public static AndroidDriver StartAndroidApp(
return testClass.StartApp(options, waitUntil, waitUntilTimeout, waitUntilRetries) as
AndroidDriver;
}
}
}
3 changes: 2 additions & 1 deletion src/Legerity.Android/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
global using OpenQA.Selenium;
global using OpenQA.Selenium.Appium;
global using OpenQA.Selenium.Appium.Android;
global using OpenQA.Selenium.Remote;
global using OpenQA.Selenium.Appium.Android.UiAutomator;
global using OpenQA.Selenium.Support.UI;
4 changes: 1 addition & 3 deletions src/Legerity.Core/Android/AndroidAppManagerOptions.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
namespace Legerity.Android;

using System.Collections.Generic;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.Enums;

/// <summary>
/// Defines a specific <see cref="AppiumManagerOptions"/> for an Android application.
Expand Down Expand Up @@ -241,7 +239,7 @@ private string GetOptionDetails()

if (AdditionalOptions != null)
{
foreach ((var name, var value) in AdditionalOptions)
foreach (var (name, value) in AdditionalOptions)
{
options.Add($"{name} [{value}]");
}
Expand Down
Loading

0 comments on commit 6acf4a2

Please sign in to comment.