Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions dotnet/private/dotnet_format.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ DOTNET_DIR="$WORKSPACE_ROOT/dotnet"

cd "$DOTNET_DIR"

echo "Running dotnet format on all projects..."
echo "Running dotnet format $@ on all projects..."
find "$DOTNET_DIR/src" "$DOTNET_DIR/test" -name "*.csproj" 2>/dev/null | while read -r proj; do
echo " Formatting $proj..."
"$DOTNET" format "$proj" || exit 1
"$DOTNET" format "$@" "$proj" || exit 1
done || exit 1

echo "Done."
Expand Down Expand Up @@ -90,14 +90,14 @@ set DOTNET_DIR=%WORKSPACE_ROOT%\\dotnet

cd /d "%DOTNET_DIR%"

echo Running dotnet format on all projects...
echo Running dotnet format %* on all projects...
for /r "%DOTNET_DIR%\\src" %%%%p in (*.csproj) do (
echo Formatting %%%%p...
"%DOTNET%" format "%%%%p" || exit /b 1
"%DOTNET%" format %* "%%%%p" || exit /b 1
)
for /r "%DOTNET_DIR%\\test" %%%%p in (*.csproj) do (
echo Formatting %%%%p...
"%DOTNET%" format "%%%%p" || exit /b 1
"%DOTNET%" format %* "%%%%p" || exit /b 1
)

echo Done.
Expand Down
109 changes: 54 additions & 55 deletions dotnet/test/common/WebElementWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,79 +20,78 @@
using System.Collections.ObjectModel;
using System.Drawing;

namespace OpenQA.Selenium
namespace OpenQA.Selenium;

public class WebElementWrapper(IWebElement element) : IWebElement, IWrapsElement
{
public class WebElementWrapper(IWebElement element) : IWebElement, IWrapsElement
{
public IWebElement WrappedElement { get; } = element;
public IWebElement WrappedElement { get; } = element;

public string TagName => WrappedElement.TagName;
public string TagName => WrappedElement.TagName;

public string Text => WrappedElement.Text;
public string Text => WrappedElement.Text;

public bool Enabled => WrappedElement.Enabled;
public bool Enabled => WrappedElement.Enabled;

public bool Selected => WrappedElement.Selected;
public bool Selected => WrappedElement.Selected;

public Point Location => WrappedElement.Location;
public Point Location => WrappedElement.Location;

public Size Size => WrappedElement.Size;
public Size Size => WrappedElement.Size;

public bool Displayed => WrappedElement.Displayed;
public bool Displayed => WrappedElement.Displayed;

public void Clear()
{
WrappedElement.Clear();
}
public void Clear()
{
WrappedElement.Clear();
}

public void Click()
{
WrappedElement.Click();
}
public void Click()
{
WrappedElement.Click();
}

public IWebElement FindElement(By by)
{
return WrappedElement.FindElement(by);
}
public IWebElement FindElement(By by)
{
return WrappedElement.FindElement(by);
}

public ReadOnlyCollection<IWebElement> FindElements(By by)
{
return WrappedElement.FindElements(by);
}
public ReadOnlyCollection<IWebElement> FindElements(By by)
{
return WrappedElement.FindElements(by);
}

public string GetAttribute(string attributeName)
{
return WrappedElement.GetAttribute(attributeName);
}
public string GetAttribute(string attributeName)
{
return WrappedElement.GetAttribute(attributeName);
}

public string GetCssValue(string propertyName)
{
return WrappedElement.GetCssValue(propertyName);
}
public string GetCssValue(string propertyName)
{
return WrappedElement.GetCssValue(propertyName);
}

public string GetDomAttribute(string attributeName)
{
return WrappedElement.GetDomAttribute(attributeName);
}
public string GetDomAttribute(string attributeName)
{
return WrappedElement.GetDomAttribute(attributeName);
}

public string GetDomProperty(string propertyName)
{
return WrappedElement.GetDomProperty(propertyName);
}
public string GetDomProperty(string propertyName)
{
return WrappedElement.GetDomProperty(propertyName);
}

public ISearchContext GetShadowRoot()
{
return WrappedElement.GetShadowRoot();
}
public ISearchContext GetShadowRoot()
{
return WrappedElement.GetShadowRoot();
}

public void SendKeys(string text)
{
WrappedElement.SendKeys(text);
}
public void SendKeys(string text)
{
WrappedElement.SendKeys(text);
}

public void Submit()
{
WrappedElement.Submit();
}
public void Submit()
{
WrappedElement.Submit();
}
}
14 changes: 14 additions & 0 deletions rake_tasks/dotnet.rake
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,17 @@ task :pin do
'--output-folder', "#{Dir.pwd}/dotnet"],
'@rules_dotnet//tools/paket2bazel:paket2bazel')
end

desc 'Run .NET formatter (whitespace only)'
task :format do |_task, arguments|
raise ArgumentError, 'arguments not supported for this task' unless arguments.to_a.empty?

puts ' Running dotnet format whitespace...'
Bazel.execute('run', ['--', 'whitespace'], '//dotnet:format')
end

desc 'Run .NET linter (format + style + analyzers)'
task :lint do |_task, arguments|
puts ' Running dotnet format...'
Bazel.execute('run', ['--'] + arguments.to_a, '//dotnet:format')
end
4 changes: 2 additions & 2 deletions scripts/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ echo " buildifier" >&2
bazel run //:buildifier

section "Dotnet"
echo " dotnet format" >&2
bazel run //dotnet:format
echo " dotnet format whitespace" >&2
bazel run //dotnet:format -- whitespace

section "Java"
echo " google-java-format" >&2
Expand Down
Loading