From ad72886d33331b94f84af1c8fac7b0e83cf45e48 Mon Sep 17 00:00:00 2001 From: javier gomez Date: Fri, 14 Aug 2015 18:03:20 +0200 Subject: [PATCH] Add frontend logout feature --- src/JoomlaBrowser.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/JoomlaBrowser.php b/src/JoomlaBrowser.php index 6ffbfa1..9a54e40 100644 --- a/src/JoomlaBrowser.php +++ b/src/JoomlaBrowser.php @@ -95,6 +95,21 @@ public function doFrontEndLogin($user = null, $password = null) $I->waitForElement(['xpath' => "//input[@value='Log out']"], 10); } + /** + * Function to Do frontend Logout in Joomla! + */ + public function doFrontendLogout() + { + $I = $this; + $this->debug('I open Joomla Frontend Login Page'); + $I->amOnPage('/index.php?option=com_users&view=login'); + $this->debug('I click Logout button'); + $I->click(['xpath' => "//div[@class='logout']//button[contains(text(), 'Log out')]"]); + $this->debug('I wait to see Login form'); + $I->waitForElement(['xpath' => "//div[@class='login']//button[contains(text(), 'Log in')]"], 30); + $I->seeElement(['xpath' => "//div[@class='login']//button[contains(text(), 'Log in')]"]); + } + /** * Installs Joomla */