| @@ 19-63 (lines=45) @@ | ||
| 16 | use hipanel\tests\_support\Page\Widget\Input\Select2; |
|
| 17 | use hipanel\tests\_support\Step\Acceptance\Client; |
|
| 18 | ||
| 19 | class AccountsCest |
|
| 20 | { |
|
| 21 | /** |
|
| 22 | * @var IndexPage |
|
| 23 | */ |
|
| 24 | private $index; |
|
| 25 | ||
| 26 | public function _before(Client $I) |
|
| 27 | { |
|
| 28 | $this->index = new IndexPage($I); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function ensureIndexPageWorks(Client $I) |
|
| 32 | { |
|
| 33 | $I->login(); |
|
| 34 | $I->needPage(Url::to('@account')); |
|
| 35 | $I->see('Accounts', 'h1'); |
|
| 36 | $I->see('Create account', 'a'); |
|
| 37 | $this->ensureICanSeeAdvancedSearchBox($I); |
|
| 38 | $this->ensureICanSeeBulkSearchBox(); |
|
| 39 | } |
|
| 40 | ||
| 41 | private function ensureICanSeeAdvancedSearchBox(Client $I) |
|
| 42 | { |
|
| 43 | $this->index->containsFilters([ |
|
| 44 | Input::asAdvancedSearch($I, 'Login'), |
|
| 45 | Select2::asAdvancedSearch($I, 'Server'), |
|
| 46 | Select2::asAdvancedSearch($I, 'Type'), |
|
| 47 | Select2::asAdvancedSearch($I, 'Status'), |
|
| 48 | ]); |
|
| 49 | } |
|
| 50 | ||
| 51 | private function ensureICanSeeBulkSearchBox() |
|
| 52 | { |
|
| 53 | $this->index->containsBulkButtons([ |
|
| 54 | 'Basic actions', |
|
| 55 | ]); |
|
| 56 | $this->index->containsColumns([ |
|
| 57 | 'Account', |
|
| 58 | 'Server', |
|
| 59 | 'Status', |
|
| 60 | 'Type', |
|
| 61 | ]); |
|
| 62 | } |
|
| 63 | } |
|
| 64 | ||
| @@ 19-64 (lines=46) @@ | ||
| 16 | use hipanel\tests\_support\Page\Widget\Input\Select2; |
|
| 17 | use hipanel\tests\_support\Step\Acceptance\Client; |
|
| 18 | ||
| 19 | class DatabasesCest |
|
| 20 | { |
|
| 21 | /** |
|
| 22 | * @var IndexPage |
|
| 23 | */ |
|
| 24 | private $index; |
|
| 25 | ||
| 26 | public function _before(Client $I) |
|
| 27 | { |
|
| 28 | $this->index = new IndexPage($I); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function ensureIndexPageWorks(Client $I) |
|
| 32 | { |
|
| 33 | $I->login(); |
|
| 34 | $I->needPage(Url::to('@db')); |
|
| 35 | $I->see('Databases', 'h1'); |
|
| 36 | $I->seeLink('Create DB', Url::to('create')); |
|
| 37 | $this->ensureICanSeeAdvancedSearchBox($I); |
|
| 38 | $this->ensureICanSeeBulkSearchBox(); |
|
| 39 | } |
|
| 40 | ||
| 41 | private function ensureICanSeeAdvancedSearchBox(Client $I) |
|
| 42 | { |
|
| 43 | $this->index->containsFilters([ |
|
| 44 | Input::asAdvancedSearch($I, 'DB name'), |
|
| 45 | Input::asAdvancedSearch($I, 'Description'), |
|
| 46 | Select2::asAdvancedSearch($I, 'Status'), |
|
| 47 | Select2::asAdvancedSearch($I, 'Server'), |
|
| 48 | ]); |
|
| 49 | } |
|
| 50 | ||
| 51 | private function ensureICanSeeBulkSearchBox() |
|
| 52 | { |
|
| 53 | $this->index->containsBulkButtons([ |
|
| 54 | 'Delete', |
|
| 55 | ]); |
|
| 56 | $this->index->containsColumns([ |
|
| 57 | 'DB name', |
|
| 58 | 'Account', |
|
| 59 | 'Server', |
|
| 60 | 'Description', |
|
| 61 | 'Status', |
|
| 62 | ]); |
|
| 63 | } |
|
| 64 | } |
|
| 65 | ||