Skip to content

Commit 5b54cb9

Browse files
committed
Merge pull request #56 from javigomez/frontendlogout
Add frontend logout feature
2 parents d622129 + ad72886 commit 5b54cb9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/JoomlaBrowser.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,21 @@ public function doFrontEndLogin($user = null, $password = null)
9595
$I->waitForElement(['xpath' => "//input[@value='Log out']"], 10);
9696
}
9797

98+
/**
99+
* Function to Do frontend Logout in Joomla!
100+
*/
101+
public function doFrontendLogout()
102+
{
103+
$I = $this;
104+
$this->debug('I open Joomla Frontend Login Page');
105+
$I->amOnPage('/index.php?option=com_users&view=login');
106+
$this->debug('I click Logout button');
107+
$I->click(['xpath' => "//div[@class='logout']//button[contains(text(), 'Log out')]"]);
108+
$this->debug('I wait to see Login form');
109+
$I->waitForElement(['xpath' => "//div[@class='login']//button[contains(text(), 'Log in')]"], 30);
110+
$I->seeElement(['xpath' => "//div[@class='login']//button[contains(text(), 'Log in')]"]);
111+
}
112+
98113
/**
99114
* Installs Joomla
100115
*/

0 commit comments

Comments
 (0)