-
Notifications
You must be signed in to change notification settings - Fork 280
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
Provide partial named selector that selects also the hidden fields #711
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Mink package. | ||
* (c) Konstantin Kudryashov <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Behat\Mink\Selector; | ||
|
||
/** | ||
* Named selectors engine. Uses registered XPath selectors to create new expressions. | ||
* | ||
* @author Konstantin Kudryashov <[email protected]> | ||
*/ | ||
class PartialNamedIncludingHiddenSelector extends PartialNamedSelector | ||
{ | ||
public function __construct() | ||
{ | ||
$this->registerReplacement('%notFieldTypeFilter%', "not(%buttonTypeFilter%)"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Name doesn't really say that hidden fields are allowed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, I've meant There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, I cannot rename that because, in fact, I'm overriding there the existing |
||
|
||
parent::__construct(); | ||
} | ||
} |
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.
How you plan to use this selector, e.g. during scenario writing for Behat?
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.
Well, we need this in Drupal testing framework, see https://www.drupal.org/node/2767655. As you can see there, we init the session by registering also this new selector to the SelectorsHandler:
Then we have an extension of WebAssert and override fieldExists() and fieldNotExists() to use also this new selector.
I was not thinking how this can be used in Behat scenarios. Probably that could be a follow up task?