Skip to content
This repository was archived by the owner on Mar 17, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions tests/_support/AcceptanceTester.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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"]);

}

Expand All @@ -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')]"]);
}
}
2 changes: 1 addition & 1 deletion tests/_support/Step/Acceptance/Administrator/Content.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we would need to modify all the Wait commands in the whole test suite. For example: https://github.com/joomla-projects/gsoc16_browser-automated-tests/blob/staging/tests/acceptance/administrator/UserCest.php#L36

so any waitForText or waitForElement in all the step files should use the TIMEOUT constant

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tried to find all the other files for timout, I think this is the only place I found so far. I will add and use TIMEOUT constant to replace all the static time. Thank you.

$I->see($message, AdminPage::$systemMessageContainer);
}

Expand Down
2 changes: 2 additions & 0 deletions tests/acceptance/_bootstrap.php
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
<?php
define("TIMEOUT", 60);
Copy link
Contributor

@yvesh yvesh Jul 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a check if it is not already set (common name)

if (!defined('TIMEOUT')) 
{

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also add a /tests/readme.md file explaining the particular details of the tests. In this case you can say:

  • you can modify the timeout time by changing the value of this constant... lower for fast machines and higher for slow computers...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I will add the same in README.md and I will also add condition like suggested by Yves.

?>