Skip to content
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

Add space arround the keywords to avoid wrongly matching. #561

Merged
merged 1 commit into from
Dec 31, 2019

Conversation

weynhamz
Copy link
Contributor

@weynhamz weynhamz commented Dec 5, 2019

Trying to fix #560.

Maybe there is a better way.

@pfrenssen
Copy link
Collaborator

Thanks! Can you try with word boundaries?

'/\b(follow|press|click|submit)\b/i'

This is a more robust and "regexy" way to check for individual words in a string.

@weynhamz weynhamz force-pushed the fix-wrongly-matching-keywords branch from 1625f10 to f9f3fb9 Compare December 6, 2019 05:22
@weynhamz
Copy link
Contributor Author

weynhamz commented Dec 6, 2019

Thanks, @pfrenssen, just updated, the boundary check is better, I was just trying to have a quick fix.

Though I still do not think this is a good approach to trigger an AJAX wait, I am too familiar with Behat, is there a better way like using tags or listeners on click event/method to trigger it instead?

@pfrenssen
Copy link
Collaborator

Thanks!

I don't think it is possible to trigger methods asynchronously in a running PHP process from JS code due to the single threaded nature of PHP, and we are already limiting this on the @javascript tag. This is the best we can do that would work with all kinds of Drupal projects.

Of course in your own project you can extend MinkExtension and provide any logic that is specific to your project to narrow down the cases where this is triggered.

@jhedstrom jhedstrom merged commit c981fbb into jhedstrom:master Dec 31, 2019
@jhedstrom
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrongly invoking iWaitForAjaxToFinish on step contains following word
3 participants