Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
Footer Class Reference
Inheritance diagram for Footer:

Public Member Functions

 clickLink ($linkName)
 
 isLinkVisible ($linkName)
 
 checkVariable ($htmlValue)
 
 selectStoreGroup (Store $store)
 
 isStoreGroupVisible (Store $store)
 
 isStoreGroupSwitcherVisible ()
 
 openAdvancedSearch ()
 

Protected Attributes

 $linkSelector = '//*[contains(@class, "links")]//a[contains(text(), "%s")]'
 
 $variableSelector = './/ul[contains(@class, "links")]/*[text()="%s"]'
 
 $storeGroupDropdown = '.switcher.store'
 
 $storeGroupSwitch = '[data-toggle="dropdown"]'
 
 $storeGroupSelector = './/a[contains(.,"%s")]'
 
 $advancedSearchSelector = '[data-action="advanced-search"]'
 

Detailed Description

Footer block CmsIndex page Footer block

Definition at line 17 of file Footer.php.

Member Function Documentation

◆ checkVariable()

checkVariable (   $htmlValue)

Check Variable visibility by html value.

Parameters
string$htmlValue
Returns
bool

Definition at line 94 of file Footer.php.

95  {
96  return $this->_rootElement->find(
97  sprintf($this->variableSelector, $htmlValue),
98  Locator::SELECTOR_XPATH
99  )->isVisible();
100  }

◆ clickLink()

clickLink (   $linkName)

Click on link by its title.

Parameters
string$linkName
Returns
void
Exceptions

Definition at line 68 of file Footer.php.

69  {
70  $link = $this->_rootElement->find(sprintf($this->linkSelector, $linkName), Locator::SELECTOR_XPATH);
71  if (!$link->isVisible()) {
72  throw new \Exception(sprintf('"%s" link is not visible', $linkName));
73  }
74  $link->click();
75  }

◆ isLinkVisible()

isLinkVisible (   $linkName)

Check is link is visible.

Parameters
string$linkName
Returns
bool

Definition at line 83 of file Footer.php.

84  {
85  return $this->_rootElement->find(sprintf($this->linkSelector, $linkName), Locator::SELECTOR_XPATH)->isVisible();
86  }

◆ isStoreGroupSwitcherVisible()

isStoreGroupSwitcherVisible ( )

Check if "Store" switcher is visible or not.

Returns
bool

Definition at line 143 of file Footer.php.

144  {
145  return $this->_rootElement->find($this->storeGroupSwitch)->isVisible();
146  }

◆ isStoreGroupVisible()

isStoreGroupVisible ( Store  $store)

Check if correspondent "Store" is present in "Store" switcher or not.

Parameters
Store$store
Returns
bool

Definition at line 128 of file Footer.php.

129  {
130  $storeGroupName = explode("/", $store->getGroupId())[1];
131  $this->_rootElement->find($this->storeGroupSwitch)->click();
132  return $this->_rootElement->find(
133  sprintf($this->storeGroupSelector, $storeGroupName),
134  Locator::SELECTOR_XPATH
135  )->isVisible();
136  }

◆ openAdvancedSearch()

openAdvancedSearch ( )

Open Advanced Search.

Returns
void

Definition at line 153 of file Footer.php.

154  {
155  $this->_rootElement->find($this->advancedSearchSelector)->click();
156  }

◆ selectStoreGroup()

selectStoreGroup ( Store  $store)

Select Store group.

Parameters
Store$store
Returns
void

Definition at line 108 of file Footer.php.

109  {
110  $storeGroupName = explode("/", $store->getGroupId())[1];
111  $storeGroup = $this->_rootElement->find(
112  sprintf($this->storeGroupSelector, $storeGroupName),
113  Locator::SELECTOR_XPATH
114  );
115  if (!$storeGroup->isVisible()) {
116  $this->_rootElement->find($this->storeGroupSwitch)->click();
117  }
118 
119  $storeGroup->click();
120  }

Field Documentation

◆ $advancedSearchSelector

$advancedSearchSelector = '[data-action="advanced-search"]'
protected

Definition at line 59 of file Footer.php.

◆ $linkSelector

$linkSelector = '//*[contains(@class, "links")]//a[contains(text(), "%s")]'
protected

Definition at line 24 of file Footer.php.

◆ $storeGroupDropdown

$storeGroupDropdown = '.switcher.store'
protected

Definition at line 38 of file Footer.php.

◆ $storeGroupSelector

$storeGroupSelector = './/a[contains(.,"%s")]'
protected

Definition at line 52 of file Footer.php.

◆ $storeGroupSwitch

$storeGroupSwitch = '[data-toggle="dropdown"]'
protected

Definition at line 45 of file Footer.php.

◆ $variableSelector

$variableSelector = './/ul[contains(@class, "links")]/*[text()="%s"]'
protected

Definition at line 31 of file Footer.php.


The documentation for this class was generated from the following file: