Skip to main content

Paths

DrevOps\BehatSteps\Steps\Web\PathTrait - Source, Example, Helpers

Navigate and verify paths with URL validation.

  • Assert current page location with front page special handling.
  • Configure basic authentication for protected path access.
  • Validate URL query parameters with expected values.

Steps​

@Given I am using basic authentication with the username :username and the password :password

Set basic authentication for the current session

Given I am using basic authentication with the username "myusername" and the password "mypassword"
@When I visit :path

Navigate to a path

When I visit "/about-us"
When I visit "https://example.com/about-us"
@When I go back

Navigate back in browser history

When I go back
@Then the path should be :path

Assert that the current page is a specified path

Then the path should be "/about-us"
Then the path should be "/"
Then the path should be "<front>"
@Then the path should not be :path

Assert that the current page is not a specified path

Then the path should not be "/about-us"
Then the path should not be "/"
Then the path should not be "<front>"
@Then the URL should have the query parameter :name

Assert that current URL has a query parameter

Then the URL should have the query parameter "filter"
@Then the URL should have the query parameter :name with the value :value

Assert that current URL has a query parameter with a specific value

Then the URL should have the query parameter "filter" with the value "recent"
@Then the URL should not have the query parameter :name

Assert that current URL has no query parameter

Then the URL should not have the query parameter "filter"
@Then the URL should not have the query parameter :name with the value :value

Assert that current URL does not have a query parameter with a value

Then the URL should not have the query parameter "filter" with the value "recent"