-
-
Notifications
You must be signed in to change notification settings - Fork 193
jhedstrom/drupalextension#590: Checkbox manipulation in regions #591
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
Conversation
2013c78 to
79b5f92
Compare
|
@xurizaemon |
79b5f92 to
5ae6c19
Compare
📝 WalkthroughWalkthroughThis change adds region-scoped checkbox handling functionality to a Drupal testing extension. Two new public methods enable checking and unchecking checkboxes within specified regions, supported by test fixtures and feature scenarios demonstrating the new capability. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Comment |
|
@AlexSkrypnyk done 👍🏼 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/Drupal/DrupalExtension/Context/MinkContext.php (1)
445-481: Consider adding explicit checkbox validation for consistency withassertRegionPressButton.The implementation works correctly, but unlike
assertRegionPressButton(lines 417-426), these methods don't explicitly verify the checkbox exists before acting.assertRegionPressButtonfinds the button first and throws a custom exception with a helpful message including the region name and current URL.If you want consistent error messages across region-based step definitions, you could add explicit validation:
♻️ Optional: Add explicit checkbox validation
public function assertRegionCheckBox($locator, $region) { $regionObj = $this->getRegion($region); + $field = $regionObj->findField($locator); + if (empty($field)) { + throw new \Exception(sprintf("The checkbox '%s' was not found in the region '%s' on the page %s", $locator, $region, $this->getSession()->getCurrentUrl())); + } $regionObj->checkField($locator); }Apply similar pattern to
assertRegionUncheckBox.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
features/blackbox.featurefixtures/blackbox/index.htmlsrc/Drupal/DrupalExtension/Context/MinkContext.php
🧰 Additional context used
🧬 Code graph analysis (1)
src/Drupal/DrupalExtension/Context/MinkContext.php (1)
src/Drupal/DrupalExtension/Context/MarkupContext.php (1)
getRegion(26-35)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: PHP 8.3, Drupal 10
🔇 Additional comments (3)
src/Drupal/DrupalExtension/Context/MinkContext.php (1)
405-405: LGTM!The docblock typo fix improves clarity.
fixtures/blackbox/index.html (1)
16-16: LGTM!The test fixture correctly adds a checkbox element with proper id and label association to support the new region-scoped checkbox step definition.
features/blackbox.feature (1)
29-29: LGTM on the check step, but consider adding test coverage for uncheck.The new step correctly tests the
assertRegionCheckBoxfunctionality within the form submission scenario.However,
assertRegionUncheckBoxis not covered by any test scenario. Consider adding a step to verify the uncheck functionality as well, for example:And I uncheck "extra" in the "navigation" region
Refs #590
Summary by CodeRabbit
New Features
Tests
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.