Skip to content

Commit a75f773

Browse files
committed
Use locators class
1 parent 32e9a40 commit a75f773

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

src/JoomlaBrowser.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class JoomlaBrowser extends WebDriver
4646
/**
4747
* The locator
4848
*
49-
* @var Codeception\Module\Locators\Locators
49+
* @var Locators
5050
* @since 3.7.4.2
5151
*/
5252
protected $locator;
@@ -1130,15 +1130,15 @@ public function createCategory($title, $extension = '')
11301130
$this->checkForPhpNoticesOrWarnings();
11311131

11321132
$this->debug('Click new category button');
1133-
$this->click(['class' => 'button-new']);
1133+
$this->click($this->locator->adminToolbarButtonNew);
11341134

11351135
$this->waitForElement(['class' => 'page-title']);
11361136

11371137
$this->checkForPhpNoticesOrWarnings();
11381138
$this->fillField(['id' => 'jform_title'], $title);
11391139

11401140
$this->debug('Click new category apply button');
1141-
$this->click(['class' => 'button-apply']);
1141+
$this->click($this->locator->adminToolbarButtonApply);
11421142

11431143
$this->debug('see a success message after saving the category');
11441144

src/Locators/Locators.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,20 @@ class Locators
105105
* @since 3.7.4.2
106106
*/
107107
public $frontEndLoginUrl = '/index.php?option=com_users&view=login';
108+
109+
/**
110+
* New Button in the Admin toolbar
111+
*
112+
* @var array
113+
* @since 3.7.5
114+
*/
115+
public $adminToolbarButtonNew = ['class' => 'button-new'];
116+
117+
/**
118+
* Apply Button in the Admin toolbar
119+
*
120+
* @var array
121+
* @since 3.7.5
122+
*/
123+
public $adminToolbarButtonApply = ['class' => 'button-apply'];
108124
}

0 commit comments

Comments
 (0)