Skip to content

[dotnet] [test] Normalize namespace for Support tests#17277

Merged
nvborisenko merged 1 commit intoSeleniumHQ:trunkfrom
nvborisenko:dotnet-test-support-namespace
Mar 30, 2026
Merged

[dotnet] [test] Normalize namespace for Support tests#17277
nvborisenko merged 1 commit intoSeleniumHQ:trunkfrom
nvborisenko:dotnet-test-support-namespace

Conversation

@nvborisenko
Copy link
Copy Markdown
Member

🔗 Related Issues

Contributes to #15536

💥 What does this PR do?

This pull request restructures the namespaces and global usings in the .NET test suite for Selenium WebDriver Support, improving code organization and maintainability. The changes primarily move test classes into new, more consistent namespaces and introduce a central file for global usings to reduce redundancy.

Namespace and Usings Refactor:

  • All test files under dotnet/test/support/ have been moved to new namespaces under OpenQA.Selenium.Support.Tests and its sub-namespaces (e.g., .Events, .Extensions, .UI) for better organization and clarity. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]

  • The test project file (Selenium.WebDriver.Support.Tests.csproj) now sets the RootNamespace to OpenQA.Selenium.Support.Tests to match the new namespace structure.

Global Usings Consolidation:

  • Introduced a new file, Properties/GlobalUsings.cs, which defines global using directives for commonly used namespaces (such as NUnit.Framework, OpenQA.Selenium.Tests.Infrastructure, and standard .NET namespaces). This reduces repetitive using statements across test files.

🔄 Types of changes

  • Cleanup (formatting, renaming)

@selenium-ci selenium-ci added C-dotnet .NET Bindings B-support Issue or PR related to support classes labels Mar 30, 2026
@qodo-code-review
Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Normalize .NET Support test namespaces and consolidate global usings

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Normalize test namespaces under OpenQA.Selenium.Support.Tests hierarchy
• Consolidate global using directives in centralized GlobalUsings.cs file
• Update project RootNamespace to match new namespace structure
• Remove redundant using statements from individual test files

Grey Divider

File Changes

1. dotnet/test/support/AssemblyFixture.cs Namespace restructuring +1/-4

Update namespace and remove redundant usings

dotnet/test/support/AssemblyFixture.cs


2. dotnet/test/support/Events/EventFiringWebDriverElementTests.cs Namespace restructuring +2/-2

Update namespace to Tests.Events hierarchy

dotnet/test/support/Events/EventFiringWebDriverElementTests.cs


3. dotnet/test/support/Events/EventFiringWebDriverTests.cs Namespace restructuring +2/-5

Update namespace and consolidate using statements

dotnet/test/support/Events/EventFiringWebDriverTests.cs


View more (11)
4. dotnet/test/support/Extensions/ExecuteJavaScriptTests.cs Namespace restructuring +2/-3

Update namespace and remove redundant usings

dotnet/test/support/Extensions/ExecuteJavaScriptTests.cs


5. dotnet/test/support/Properties/GlobalUsings.cs New file +24/-0

Create centralized global using directives file

dotnet/test/support/Properties/GlobalUsings.cs


6. dotnet/test/support/UI/DefaultWaitTests.cs Namespace restructuring +2/-3

Update namespace and consolidate using statements

dotnet/test/support/UI/DefaultWaitTests.cs


7. dotnet/test/support/UI/HandCrankClock.cs Namespace restructuring +2/-2

Update namespace to Tests.UI hierarchy

dotnet/test/support/UI/HandCrankClock.cs


8. dotnet/test/support/UI/LoadableComponentTests.cs Namespace restructuring +2/-3

Update namespace and remove redundant usings

dotnet/test/support/UI/LoadableComponentTests.cs


9. dotnet/test/support/UI/PopupWindowFinderTests.cs Namespace restructuring +2/-2

Update namespace to Tests.UI hierarchy

dotnet/test/support/UI/PopupWindowFinderTests.cs


10. dotnet/test/support/UI/SelectBrowserTests.cs Namespace restructuring +2/-5

Update namespace and consolidate using statements

dotnet/test/support/UI/SelectBrowserTests.cs


11. dotnet/test/support/UI/SelectTests.cs Namespace restructuring +2/-4

Update namespace and remove redundant usings

dotnet/test/support/UI/SelectTests.cs


12. dotnet/test/support/UI/SlowLoadableComponentTests.cs Namespace restructuring +2/-3

Update namespace and remove redundant usings

dotnet/test/support/UI/SlowLoadableComponentTests.cs


13. dotnet/test/support/UI/WebDriverWaitTests.cs Namespace restructuring +2/-3

Update namespace and remove redundant usings

dotnet/test/support/UI/WebDriverWaitTests.cs


14. dotnet/test/support/Selenium.WebDriver.Support.Tests.csproj ⚙️ Configuration changes +1/-0

Add RootNamespace property to project file

dotnet/test/support/Selenium.WebDriver.Support.Tests.csproj


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown
Contributor

qodo-code-review bot commented Mar 30, 2026

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (1)

Grey Divider


Remediation recommended

1. RootNamespace not OpenQA.Selenium.Tests 📎 Requirement gap ⚙ Maintainability
Description
The test project now sets RootNamespace to OpenQA.Selenium.Support.Tests, which does not match
the standard default test namespace requirement (OpenQA.Selenium.Tests). This can cause newly
added tests to default into a non-standard namespace, reducing consistency across the .NET test
suite.
Code

dotnet/test/support/Selenium.WebDriver.Support.Tests.csproj[6]

+    <RootNamespace>OpenQA.Selenium.Support.Tests</RootNamespace>
Evidence
PR Compliance ID 2 requires the test project's default/root namespace to be OpenQA.Selenium.Tests
(or equivalent); the changed .csproj explicitly sets it to OpenQA.Selenium.Support.Tests
instead.

Use standard default namespace for .NET test project (OpenQA.Selenium.Tests)
dotnet/test/support/Selenium.WebDriver.Support.Tests.csproj[6-6]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The test project `RootNamespace` is set to `OpenQA.Selenium.Support.Tests`, which may not align with the repository's standard default test namespace expectation (`OpenQA.Selenium.Tests`).

## Issue Context
This PR is reorganizing Support test namespaces; ensure the *default/root* namespace matches the standard convention (or an explicitly agreed equivalent) so new tests don’t default into an unexpected namespace.

## Fix Focus Areas
- dotnet/test/support/Selenium.WebDriver.Support.Tests.csproj[6-6]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@selenium-ci
Copy link
Copy Markdown
Member

Thank you, @nvborisenko for this code suggestion.

The support packages contain example code that many users find helpful, but they do not necessarily represent
the best practices for using Selenium, and the Selenium team is not currently merging changes to them.

After reviewing the change, unless it is a critical fix or a feature that is needed for Selenium
to work, we will likely close the PR.

We actively encourage people to add the wrapper and helper code that makes sense for them to their own frameworks.
If you have any questions, please contact us

@nvborisenko nvborisenko merged commit 0c8eb99 into SeleniumHQ:trunk Mar 30, 2026
21 of 22 checks passed
@nvborisenko nvborisenko deleted the dotnet-test-support-namespace branch March 30, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B-support Issue or PR related to support classes C-dotnet .NET Bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants