-
-
Notifications
You must be signed in to change notification settings - Fork 28
Fix the issue_#29 and issue_#31 #33
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,7 +60,7 @@ public function iSeeAdministratorDashboard() | |
* | ||
* @return void | ||
*/ | ||
public function waitForPageTitle($title, $timeout = 60) | ||
public function waitForPageTitle($title, $timeout = 20) | ||
{ | ||
$I = $this; | ||
$I->waitForText($title, $timeout, AdminPage::$pageTitle); | ||
|
@@ -235,4 +235,19 @@ public function doAdministratorLogout() | |
$I->waitForText('Log in', 60, ['xpath' => "//fieldset[@class='loginform']//button"]); | ||
|
||
} | ||
|
||
/** | ||
* Selects an option in a Joomla Radio Field based on its label | ||
* | ||
* @return void | ||
*/ | ||
public function selectOptionInRadioField($label, $option) | ||
{ | ||
$I = $this; | ||
$I->comment("Trying to select the $option from the $label"); | ||
$label = $webDriver->findField(['xpath' => "//label[contains(normalize-space(string(.)), '" . $label . "')]"]); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. findField() method is not working. I was also try to use webDriver Module but it's not work. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll investigate more, but probably we will have to create a helper to deal with joomla Chosen JS. Have a look at http://codeception.com/docs/06-ModulesAndHelpers. We can also check the Locator Util http://codeception.com/docs/reference/Locator maybe we can make it work using it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. related to issue #28 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I try this but it's not working. |
||
$radioId = $label->getAttribute('for'); | ||
|
||
$I->click(['xpath' => "//fieldset[@id='$radioId']/label[contains(normalize-space(string(.)), '$option')]"]); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,12 +37,12 @@ public function iSaveAnArticle() | |
} | ||
|
||
/** | ||
* @Then I should see the :arg1 message | ||
* @Then I wait for the title :title and see the message :message | ||
*/ | ||
public function iShouldSeeTheMessage($message) | ||
public function iShouldSeeTheMessage($title, $message) | ||
{ | ||
$I = $this; | ||
$I->waitForPageTitle('Articles'); | ||
$I->waitForPageTitle($title); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would suggest to do atomic steps when possible with single or minimum responsibilities. In the present case, I see here two steps instead of one:
Why do you prefer it over, having just the responsibility of seeing a message?: /**
* @Then I should see the :arg1 message
*/
public function iShouldSeeTheMessage($message)
{
$I = $this;
$I->waitForText($message, 60, AdminPage::$systemMessageContainer);
$I->see($message, AdminPage::$systemMessageContainer);
} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok. Thanks Javi. Getting you. I misunderstood it before. I will do it in two steps. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. created issue #37 |
||
$I->see($message, AdminPage::$systemMessageContainer); | ||
} | ||
|
||
|
@@ -70,12 +70,12 @@ public function iFeatureTheContentWithTitle() | |
/** | ||
* @Then I save and see the :arg1 message | ||
*/ | ||
public function iSaveAndSeeTheMessage($message) | ||
/*public function iSaveAndSeeTheMessage($message) | ||
{ | ||
$I = $this; | ||
$I->waitForPageTitle('Articles'); | ||
$I->waitForPageTitle($message, AdminPage::$systemMessageContainer); | ||
$I->see($message, AdminPage::$systemMessageContainer); | ||
} | ||
}*/ | ||
|
||
/** | ||
* @Given I select the content article with title :arg1 | ||
|
@@ -129,12 +129,12 @@ public function iUnpublish() | |
$I->clickToolbarButton('unpublish'); | ||
} | ||
/** | ||
* @Then I see article unpublish message :arg1 | ||
* @Then I wait for title :title and see the unpublish message :message | ||
*/ | ||
public function iSeeArticleUnpublishMessage($message) | ||
public function iSeeArticleUnpublishMessage($title, $message) | ||
{ | ||
$I = $this; | ||
$I->waitForPageTitle('Articles'); | ||
$I->waitForPageTitle($title); | ||
$I->see($message, AdminPage::$systemMessageContainer); | ||
} | ||
|
||
|
@@ -161,12 +161,12 @@ public function iTrashTheArticleWithName() | |
} | ||
|
||
/** | ||
* @Then I see article trash message :arg1 | ||
* @Then I wait for the title :title and see article trash message :message | ||
*/ | ||
public function iSeeArticleTrashMessage($message) | ||
public function iSeeArticleTrashMessage($title, $message) | ||
{ | ||
$I = $this; | ||
$I->waitForPageTitle('Articles'); | ||
$I->waitForPageTitle($title); | ||
$I->see($message, AdminPage::$systemMessageContainer); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you switching to 20? note that we have a best practice for this: https://docs.joomla.org/Testing_Joomla_Extensions_with_Codeception#How_much_time_should_I_wait_for_an_Element_or_Text.3F