From 8dc88493963c028668b3602037f38f9b9f78d3f4 Mon Sep 17 00:00:00 2001 From: Prital Patel Date: Thu, 7 Jul 2016 15:21:40 +0530 Subject: [PATCH] Create a constant for waiting times --- tests/_support/AcceptanceTester.php | 11 +++++------ .../Step/Acceptance/Administrator/Content.php | 2 +- tests/acceptance/_bootstrap.php | 2 ++ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/_support/AcceptanceTester.php b/tests/_support/AcceptanceTester.php index 4b8a896cb1..9c96a19885 100644 --- a/tests/_support/AcceptanceTester.php +++ b/tests/_support/AcceptanceTester.php @@ -60,10 +60,10 @@ public function iSeeAdministratorDashboard() * * @return void */ - public function waitForPageTitle($title, $timeout = 20) + public function waitForPageTitle($title) { $I = $this; - $I->waitForText($title, $timeout, AdminPage::$pageTitle); + $I->waitForText($title, TIMEOUT, AdminPage::$pageTitle); } /** @@ -229,10 +229,10 @@ public function doAdministratorLogout() $I = $this; $I->click(['xpath' => "//ul[@class='nav nav-user pull-right']//li//a[@class='dropdown-toggle']"]); $this->comment("I click on Top Right corner toggle to Logout from Admin"); - $I->waitForElement(['xpath' => "//li[@class='dropdown open']/ul[@class='dropdown-menu']//a[text() = 'Logout']"], 60); + $I->waitForElement(['xpath' => "//li[@class='dropdown open']/ul[@class='dropdown-menu']//a[text() = 'Logout']"], TIMEOUT); $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"]); + $I->waitForElement(['id' => 'mod-login-username'], TIMEOUT); + $I->waitForText('Log in', TIMEOUT, ['xpath' => "//fieldset[@class='loginform']//button"]); } @@ -247,7 +247,6 @@ public function selectOptionInRadioField($label, $option) $I->comment("Trying to select the $option from the $label"); $label = $webDriver->findField(['xpath' => "//label[contains(normalize-space(string(.)), '" . $label . "')]"]); $radioId = $label->getAttribute('for'); - $I->click(['xpath' => "//fieldset[@id='$radioId']/label[contains(normalize-space(string(.)), '$option')]"]); } } diff --git a/tests/_support/Step/Acceptance/Administrator/Content.php b/tests/_support/Step/Acceptance/Administrator/Content.php index fdc2349362..3895b88169 100644 --- a/tests/_support/Step/Acceptance/Administrator/Content.php +++ b/tests/_support/Step/Acceptance/Administrator/Content.php @@ -42,7 +42,7 @@ public function iSaveAnArticle() public function iShouldSeeTheMessage($message) { $I = $this; - $I->waitForText($message, 60, AdminPage::$systemMessageContainer); + $I->waitForText($message, TIMEOUT, AdminPage::$systemMessageContainer); $I->see($message, AdminPage::$systemMessageContainer); } diff --git a/tests/acceptance/_bootstrap.php b/tests/acceptance/_bootstrap.php index b3d9bbc7f3..05a2fb79e2 100644 --- a/tests/acceptance/_bootstrap.php +++ b/tests/acceptance/_bootstrap.php @@ -1 +1,3 @@ \ No newline at end of file