From c2d34420914c01d7fda5a8fbc8d6c3ec06d828af Mon Sep 17 00:00:00 2001 From: javier gomez Date: Tue, 29 Dec 2015 17:10:34 +0100 Subject: [PATCH] Avoid False positives on Admin logout This commit adds more time before timeout while locating the elements. Also makes the xpath more specific to increase performance --- src/JoomlaBrowser.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/JoomlaBrowser.php b/src/JoomlaBrowser.php index 1accaef..4550e74 100644 --- a/src/JoomlaBrowser.php +++ b/src/JoomlaBrowser.php @@ -479,10 +479,11 @@ public function doAdministratorLogout() $I = $this; $I->click(['xpath' => "//ul[@class='nav nav-user pull-right']//li//a[@class='dropdown-toggle']"]); $this->debug("I click on Top Right corner toggle to Logout from Admin"); - $I->waitForElement(['xpath' => "//a[text() = 'Logout']"], 10); - $I->click(['xpath' => "//a[text() = 'Logout']"]); - $I->waitForText('Log in', 20); - $I->waitForElement(['id' => 'mod-login-username'], 10); + $I->waitForElement(['xpath' => "//li[@class='dropdown open']/ul[@class='dropdown-menu']//a[text() = 'Logout']"], 60); + $I->click(['xpath' => "//li[@class='dropdown open']/ul[@class='dropdown-menu']//a[text() = 'Logout']"]); + $I->waitForElement(['id' => 'mod-login-username'], 60); + $I->waitForText('Log in', 60, ['xpath' => "//fieldset[@class='loginform']//button"]); + } /**