Skip to content

Commit c2d3442

Browse files
committed
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
1 parent f5f37d1 commit c2d3442

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/JoomlaBrowser.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -479,10 +479,11 @@ public function doAdministratorLogout()
479479
$I = $this;
480480
$I->click(['xpath' => "//ul[@class='nav nav-user pull-right']//li//a[@class='dropdown-toggle']"]);
481481
$this->debug("I click on Top Right corner toggle to Logout from Admin");
482-
$I->waitForElement(['xpath' => "//a[text() = 'Logout']"], 10);
483-
$I->click(['xpath' => "//a[text() = 'Logout']"]);
484-
$I->waitForText('Log in', 20);
485-
$I->waitForElement(['id' => 'mod-login-username'], 10);
482+
$I->waitForElement(['xpath' => "//li[@class='dropdown open']/ul[@class='dropdown-menu']//a[text() = 'Logout']"], 60);
483+
$I->click(['xpath' => "//li[@class='dropdown open']/ul[@class='dropdown-menu']//a[text() = 'Logout']"]);
484+
$I->waitForElement(['id' => 'mod-login-username'], 60);
485+
$I->waitForText('Log in', 60, ['xpath' => "//fieldset[@class='loginform']//button"]);
486+
486487
}
487488

488489
/**

0 commit comments

Comments
 (0)