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

MNT Use behat-extension function for clicking elements #61

Merged
merged 1 commit into from
Apr 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/behat/features/revoke.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ Feature: See other devices and revoke their access
Scenario: I can see other devices and revoke their access
When I go to "/admin/security"
# Click the ADMIN user
And I click the ".col-FirstName" element
And I click on the ".col-FirstName" element
# Ensure XHR loaded from endpoint
And I wait until I see the ".login-session .text-success" element
# Assert text for the two login sessions
Then I should see the text "Current" in the ".login-session .text-success" element
Then I should see the text "Log out" in the ".login-session__logout" element
# Click "Log out" button
When I click the ".login-session__logout" element
When I click on the ".login-session__logout" element
# Wait for modal to fade in
And I wait until I see the ".modal-dialog .btn-primary" element
# Click the green button in the modal
When I click the ".modal-dialog .btn-primary" element
When I click on the ".modal-dialog .btn-primary" element
# Assert text has changed
Then I should see the text "Logging out..." in the ".login-session__logout" element
# Assert hidden element is applied which fades to not visible via a css transition
Expand Down
12 changes: 0 additions & 12 deletions tests/behat/src/FixtureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,6 @@ public function iSeeTheElement($selector): void
assertNotNull($element, sprintf('Element %s not found', $selector));
}

/**
* @When /^I click the "([^"]+)" element$/
* @param $selector
*/
public function iClickTheElement(string $selector): void
{
$page = $this->getMainContext()->getSession()->getPage();
$element = $page->find('css', $selector);
assertNotNull($element, sprintf('Element %s not found', $selector));
$element->click();
}

/**
* @When /^I should see the text "([^"]+)" in the "([^"]+)" element$/
* @param $selector
Expand Down