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
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,31 @@ class AdminPage extends \AcceptanceTester
public static $pageTitle = ['class' => 'page-title'];

/**
* Locator for user's page title
* Locator for page title
*
* @var array
* @since __DEPLOY_VERSION__
*/
public static $title = ['id' => 'jform_title'];

/**
* Locator for user's search input field
* Locator for search input field
*
* @var array
* @since __DEPLOY_VERSION__
*/
public static $filterSearch = ['id' => 'filter_search'];

/**
* Locator for user's search button icon
* Locator for status filter under search tool
*
* @var array
* @since __DEPLOY_VERSION__
*/
public static $filterPublished = 'filter_published';

/**
* Locator for search button icon
*
* @var array
* @since __DEPLOY_VERSION__
Expand All @@ -75,7 +83,7 @@ class AdminPage extends \AcceptanceTester
public static $checkAll = ['xpath' => "//thead//input[@name='checkall-toggle' or @name='toggle']"];

/**
* Method to search using user's name
* Method to search using given keyword
*
* @param string $keyword The keyword to search
*
Expand All @@ -87,6 +95,7 @@ public function search($keyword)
{
$I = $this;

$I->amGoingTo('search for "' . $keyword . '"');
$I->fillField(static::$filterSearch, $keyword);
$I->click(static::$iconSearch);
}
Expand All @@ -107,6 +116,7 @@ public function haveItemUsingSearch($keyword)
$I->amOnPage(static::$url);
$I->search($keyword);
$I->checkAllResults();
$I->wait(1);
}

/**
Expand All @@ -128,7 +138,7 @@ public function seeSystemMessage($title, $message)
}

/**
* Method is to Wait for page title untill default timeout.
* Method is to Wait for page title until default timeout.
*
* @param string $title Page Title text
*
Expand Down Expand Up @@ -304,7 +314,7 @@ public function doAdministratorLogout()
*
* @return void
*/
public function verifyAvailableTabs($expectedTabs, $tabsLocator = NULL)
public function verifyAvailableTabs($expectedTabs, $tabsLocator = null)
{
$I = $this;

Expand All @@ -321,4 +331,43 @@ public function verifyAvailableTabs($expectedTabs, $tabsLocator = NULL)

$I->comment('Verify the Tabs');
}

/**
* Method to see that item is saved
*
* @param string $item The item Name
*
* @since __DEPLOY_VERSION__
*
* @return void
*/
public function seeItemIsCreated($item)
{
$I = $this;

$I->amOnPage(static::$url);
$I->search($item);
$I->see($item, static::$seeName);
}

/**
* Assure the item is trashed.
*
* @param string $item The item name
* @param string $pageTitle The page title
*
* @since __DEPLOY_VERSION__
*
* @return void
*/
public function seeItemInTrash($item, $pageTitle)
{
$I = $this;

$I->click('Search Tools');
$I->wait(2);
$I->selectOptionInChosenById(static::$filterPublished, 'Trashed');
$I->waitForPageTitle($pageTitle);
$I->see($item, static::$seeName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,38 @@ class ArticleManagerPage extends AdminPage
*/
public static $url = "/administrator/index.php?option=com_content&view=articles";

/**
* Locator for article's name field
*
* @var array
* @since __DEPLOY_VERSION__
*/
public static $seeName = ['xpath' => "//table[@id='articleList']//tr[1]//td[4]"];

/**
* Locator for article's featured icon
*
* @var array
* @since __DEPLOY_VERSION__
*/
public static $seeFeatured = ['xpath' => "//table[@id='articleList']//*//span[@class='icon-featured']"];

/**
* Locator for article's name field
*
* @var array
* @since __DEPLOY_VERSION__
*/
public static $seeAccessLevel = ['xpath' => "//table[@id='articleList']//tr[1]//td[5]"];

/**
* Locator for article's unpublish icon
*
* @var array
* @since __DEPLOY_VERSION__
*/
public static $seeUnpublished = ['xpath' => "//table[@id='articleList']//*//span[@class='icon-unpublish']"];

/**
* Method to create new article
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,38 @@ class CategoryManagerPage extends AdminPage
*/
public static $url = '/administrator/index.php?option=com_categories&view=categories&extension=com_content';

/**
* Locator for category name field
*
* @var array
* @since __DEPLOY_VERSION__
*/
public static $seeName = ['xpath' => "//table[@id='categoryList']//tr[1]//td[4]"];

/**
* Locator for category unpublished icon
*
* @var array
* @since __DEPLOY_VERSION__
*/
public static $seeUnpublished = ['xpath' => "//table[@id='categoryList']//*//span[@class='icon-unpublish']"];

/**
* Locator for category access level field
*
* @var array
* @since __DEPLOY_VERSION__
*/
public static $seeAccessLevel = ['xpath' => "//table[@id='categoryList']//tr[1]//td[9]"];

/**
* Locator for category language field
*
* @var array
* @since __DEPLOY_VERSION__
*/
public static $seeLanguage = ['xpath' => "//table[@id='categoryList']//tr[1]//td[10]"];

/**
* Locator for invalid category alert
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,15 @@ class MenuManagerPage extends AdminPage
* @var string
* @since __DEPLOY_VERSION__
*/
public static $url = 'administrator/index.php?option=com_menus&view=item&layout=edit&menutype=mainmenu';
public static $url = 'administrator/index.php?option=com_menus&view=items&menutype=mainmenu';

/**
* Locator for menu item name field
*
* @var array
* @since __DEPLOY_VERSION__
*/
public static $seeName = ['xpath' => "//table[@id='itemList']//tr[1]//td[4]"];

/**
* Locator for select article for menu item
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,12 @@ class UserAclPage extends AdminPage
* @since __DEPLOY_VERSION__
*/
public static $url = 'administrator/index.php?option=com_users&view=levels';

/**
* Locator for user's acl name field
*
* @var array
* @since __DEPLOY_VERSION__
*/
public static $seeName = ['xpath' => "//table[@id='levelList']//tr[1]/td[3]"];
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,12 @@ class UserGroupPage extends AdminPage
* @since __DEPLOY_VERSION__
*/
public static $url = 'administrator/index.php?option=com_users&view=groups';

/**
* Locator for user's group name field
*
* @var array
* @since __DEPLOY_VERSION__
*/
public static $seeName = ['xpath' => "//table[@id='groupList']//tr[1]/td[2]"];
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ class UserManagerPage extends AdminPage
public static $email2Field = ['id' => 'jform_email2'];

/**
* Locator for user's username field in frontend
* Locator for user's username field
*
* @var array
* @since __DEPLOY_VERSION__
*/
public static $seeUserName = ['xpath' => "//table[@id='userList']//tr[1]/td[3]"];

/**
* Locator for user's name field in frontend
* Locator for user's name field
*
* @var array
* @since __DEPLOY_VERSION__
Expand All @@ -122,6 +122,30 @@ class UserManagerPage extends AdminPage
*/
public static $lastLoginDate = ['xpath' => "//table[@id='userList']//tr[1]/td[8]"];

/**
* Locator for user is blocked
*
* @var array
* @since __DEPLOY_VERSION__
*/
public static $seeBlocked = ['xpath' => "//table[@id='userList']//*//td[4]//span[@class='icon-unpublish']"];

/**
* Locator for user is unblocked
*
* @var array
* @since __DEPLOY_VERSION__
*/
public static $seeUnblocked = ['xpath' => "//table[@id='userList']//*//td[4]//span[@class='icon-publish']"];

/**
* Locator for user is deleted and not found
*
* @var array
* @since __DEPLOY_VERSION__
*/
public static $noItems = ['class' => 'alert-no-items'];

/**
* Method is a page object to fill user form with given information and prepare to save user.
*
Expand Down
Loading