Skip to content
Advertisement

Is there a way to have assertPathIs() ignore part of the url?

While making a Laravel Dusk test function, I am trying to check the path in my application. However the URL in my application changes, depending on the user or what they are looking at (e.g. /Test/123/testing: in this case the 123 could be any combination of numbers.)

Is it possible to ignore the middle portion?

JavaScript

Advertisement

Answer

Taking a look at the code we can see a regular expression match is actually being performed, after the text is run through preg_quote():

JavaScript

This means that you can do a wildcard search by using *, so this should work:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement