selenium
selenium copied to clipboard
[dotnet] ability to create tests using mocked driver
User description
I noticed that all tests require real browser driver, but I think it can be useful to have ability to write tests which doesn't need it. We can use WireMock to mock driver responses and write more detailed tests.
It contains a test that tests my changes in PR: #14242
Unfortunately my knowledge with bazel is quite limited in order to add integration for bazel test
but for this dotnet test
should be sufficient.
Thanks for contributing to Selenium! A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines. Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
Motivation and Context
Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist
- [x] I have read the contributing document.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I have added tests to cover my changes.
- [x] All new and existing tests passed.
PR Type
Enhancement, Tests
Description
- Added a new
MockWebDriver
class to facilitate testing without a real browser driver. - Implemented tests for
MockWebDriver
constructor using WireMock to mock server responses. - Included the new test project
WebDriver.Mock.Tests
in the solution file. - Created project file for
WebDriver.Mock.Tests
with necessary package references.
Changes walkthrough 📝
Relevant files | |||||
---|---|---|---|---|---|
Enhancement |
| ||||
Tests |
| ||||
Configuration changes |
|
💡 PR-Agent usage: Comment
/help
on the PR to get a list of all available PR-Agent tools and their descriptions