Skip to content
Closed
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
6 changes: 3 additions & 3 deletions administrator/modules/mod_login/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<?php echo JText::_('JGLOBAL_USERNAME'); ?>
</label>
</span>
<input name="username" tabindex="1" id="mod-login-username" type="text" class="input-medium" placeholder="<?php echo JText::_('JGLOBAL_USERNAME'); ?>" size="15" autofocus="true" data-tests="username"/>
<input name="username" tabindex="1" id="mod-login-username" type="text" class="input-medium" placeholder="<?php echo JText::_('JGLOBAL_USERNAME'); ?>" size="15" autofocus="true"/>
<a href="<?php echo JUri::root(); ?>index.php?option=com_users&view=remind" class="btn width-auto hasTooltip" title="<?php echo JText::_('MOD_LOGIN_REMIND'); ?>">
<span class="icon-help"></span>
</a>
Expand All @@ -41,7 +41,7 @@
<?php echo JText::_('JGLOBAL_PASSWORD'); ?>
</label>
</span>
<input name="passwd" tabindex="2" id="mod-login-password" type="password" class="input-medium" placeholder="<?php echo JText::_('JGLOBAL_PASSWORD'); ?>" size="15" data-tests="password"/>
<input name="passwd" tabindex="2" id="mod-login-password" type="password" class="input-medium" placeholder="<?php echo JText::_('JGLOBAL_PASSWORD'); ?>" size="15"/>
<a href="<?php echo JUri::root(); ?>index.php?option=com_users&view=reset" class="btn width-auto hasTooltip" title="<?php echo JText::_('MOD_LOGIN_RESET'); ?>">
<span class="icon-help"></span>
</a>
Expand Down Expand Up @@ -84,7 +84,7 @@
<div class="control-group">
<div class="controls">
<div class="btn-group">
<button tabindex="3" class="btn btn-primary btn-block btn-large" data-tests="log in">
<button tabindex="3" class="btn btn-primary btn-block btn-large">
<span class="icon-lock icon-white"></span> <?php echo JText::_('MOD_LOGIN_LOGIN'); ?>
</button>
</div>
Expand Down
31 changes: 0 additions & 31 deletions tests/_support/AcceptanceTester.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,6 @@ class AcceptanceTester extends \Codeception\Actor
{
use _generated\AcceptanceTesterActions;

/**
* Install joomla CMS
*
* @Given Joomla CMS is installed
*/
public function joomlaCMSIsInstalled()
{
// throw new \Codeception\Exception\Incomplete("Step `Joomla CMS is installed` is not defined");
}

/**
* @When Login into Joomla administrator with username :arg1 and password :arg1
*/
public function loginIntoJoomlaAdministrator($username, $password)
{
$I = $this;
$I->amOnPage('administrator/');
$I->fillField(LoginPage::$usernameField, $username);
$I->fillField(LoginPage::$passwordField, $password);
$I->click(LoginPage::$loginButton);
}

/**
* @Then I see administrator dashboard
*/
public function iSeeAdministratorDashboard()
{
$I = $this;
$I->waitForText(AdminPage::$controlPanelText, 4, AdminPage::$pageTitle);
}

/**
* Method is to set Wait for page title
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ class ArticleManagerPage extends AdminPage

public static $iconSearch = ['class' => 'icon-search'];

public static $pageURL = "/administrator/index.php?option=com_content&view=articles";
public static $url = "/administrator/index.php?option=com_content&view=articles";

}
13 changes: 13 additions & 0 deletions tests/_support/Page/Acceptance/Administrator/ControlPanelPage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
namespace Page\Acceptance\Administrator;

use Page\Acceptance\Administrator\AdminPage;

class ControlPanelPage extends AdminPage
{
public static $url = "/administrator/index.php";

public static $pageTitle = 'Control Panel';

public static $pageTitleContext = ['class' => 'page-title'];
}
36 changes: 0 additions & 36 deletions tests/_support/Page/Acceptance/Administrator/Login.php

This file was deleted.

23 changes: 15 additions & 8 deletions tests/_support/Page/Acceptance/Administrator/LoginPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@

class LoginPage extends AdminPage
{
public static $usernameField = ['css' => 'input[data-tests="username"]'];

public static $passwordField = ['css' => 'input[data-tests="password"]'];

public static $pageTitle = ['class' => 'page-title'];

public static $loginButton = ['css' => 'button[data-tests="log in"]'];
/**
* @var array Locator for username login form textfield
*/
public static $usernameField = ['id' => 'mod-login-username'];

/**
* @var array Locator for password login form textfield
*/
public static $passwordField = ['id' => 'mod-login-password'];

/**
* @var array Locator for Log in button
*/
public static $loginButton = 'Log in';

public static $pageURL = "/administrator/index.php";
public static $url = "/administrator/index.php";
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
class UserAclPage extends AdminPage
{
// include url of current page
public static $aclPageURL = 'administrator/index.php?option=com_users&view=levels';
public static $url = 'administrator/index.php?option=com_users&view=levels';

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class UserGroupPage extends AdminPage
{
// include url of current page
public static $groupPageURL = 'administrator/index.php?option=com_users&view=groups';
public static $url = 'administrator/index.php?option=com_users&view=groups';


}
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ class UserManagerPage extends AdminPage

public static $title = ['id' => 'jform_title'];

public static $pageURL = "administrator/index.php?option=com_users&view=users";
public static $url = "administrator/index.php?option=com_users&view=users";
}
30 changes: 10 additions & 20 deletions tests/_support/Step/Acceptance/Administrator/Content.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Content extends \AcceptanceTester
public function thereIsAAddContentLink()
{
$I = $this;
$I->amOnPage(ArticleManagerPage::$pageURL);
$I->amOnPage(ArticleManagerPage::$url);
$I->clickToolbarButton('New');
}

Expand All @@ -37,12 +37,12 @@ public function iSaveAnArticle()
}

/**
* @Then I wait for the title :title and see the message :message
* @Then I should see the :arg1 message
*/
public function iShouldSeeTheMessage($title, $message)
public function iShouldSeeTheMessage($message)
{
$I = $this;
$I->waitForPageTitle($title);
$I->waitForText($message, 60, AdminPage::$systemMessageContainer);
$I->see($message, AdminPage::$systemMessageContainer);
}

Expand All @@ -52,7 +52,7 @@ public function iShouldSeeTheMessage($title, $message)
public function iSearchAndSelectContentArticleWithTitle($title)
{
$I = $this;
$I->amOnPage(ArticleManagerPage::$pageURL);
$I->amOnPage(ArticleManagerPage::$url);
$I->fillField(ArticleManagerPage::$filterSearch, $title);
$I->click(ArticleManagerPage::$iconSearch);
$I->checkAllResults();
Expand All @@ -67,23 +67,13 @@ public function iFeatureTheContentWithTitle()
$I->clickToolbarButton('featured');
}

/**
* @Then I save and see the :arg1 message
*/
/*public function iSaveAndSeeTheMessage($message)
{
$I = $this;
$I->waitForPageTitle($message, AdminPage::$systemMessageContainer);
$I->see($message, AdminPage::$systemMessageContainer);
}*/

/**
* @Given I select the content article with title :arg1
*/
public function iSelectTheContentArticleWithTitle($title)
{
$I = $this;
$I->amOnPage(ArticleManagerPage::$pageURL);
$I->amOnPage(ArticleManagerPage::$url);
$I->fillField(ArticleManagerPage::$filterSearch, $title);
$I->click(ArticleManagerPage::$iconSearch);
$I->checkAllResults();
Expand All @@ -109,12 +99,12 @@ public function iSaveTheArticle()
}

/**
* @Given I have article with name :arg1
* @Given I have article with name :title
*/
public function iHaveArticleWithName($title)
{
$I = $this;
$I->amOnPage(ArticleManagerPage::$pageURL);
$I->amOnPage(ArticleManagerPage::$url);
$I->fillField(ArticleManagerPage::$filterSearch, $title);
$I->click(ArticleManagerPage::$iconSearch);
$I->checkAllResults();
Expand Down Expand Up @@ -145,7 +135,7 @@ public function iSeeArticleUnpublishMessage($title, $message)
public function iHaveContentArticleWhichNeedsToBeTrash($title)
{
$I = $this;
$I->amOnPage(ArticleManagerPage::$pageURL);
$I->amOnPage(ArticleManagerPage::$url);
$I->fillField(ArticleManagerPage::$filterSearch, $title);
$I->click(ArticleManagerPage::$iconSearch);
$I->checkAllResults();
Expand All @@ -169,4 +159,4 @@ public function iSeeArticleTrashMessage($title, $message)
$I->waitForPageTitle($title);
$I->see($message, AdminPage::$systemMessageContainer);
}
}
}
30 changes: 30 additions & 0 deletions tests/_support/Step/Acceptance/Administrator/Login.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
namespace Step\Acceptance\Administrator;

use Page\Acceptance\Administrator\LoginPage;
use Page\Acceptance\Administrator\ControlPanelPage;

class Login extends \AcceptanceTester
{
/**
* @When I Login into Joomla administrator with username :arg1 and password :arg1
*/
public function loginIntoJoomlaAdministrator($username, $password)
{
$I = $this;
$I->amOnPage('administrator/');
$I->fillField(LoginPage::$usernameField, $username);
$I->fillField(LoginPage::$passwordField, $password);
$I->click(LoginPage::$loginButton);
}

/**
* @Then I should see the administrator dashboard
*/
public function iShouldSeeTheAdministratorDashboard()
{
$I = $this;
$I->waitForPageTitle(ControlPanelPage::$pageTitle, 60, ControlPanelPage::$pageTitleContext);
$I->see(ControlPanelPage::$pageTitle, ControlPanelPage::$pageTitleContext);
}
}
Loading