| @@ 10-72 (lines=63) @@ | ||
| 7 | use hipanel\tests\_support\Page\Widget\Input\Select2; |
|
| 8 | use hipanel\tests\_support\Step\Acceptance\Admin; |
|
| 9 | ||
| 10 | class RequestsCest |
|
| 11 | { |
|
| 12 | /** |
|
| 13 | * @var IndexPage |
|
| 14 | */ |
|
| 15 | private $index; |
|
| 16 | ||
| 17 | public function _before(Admin $I) |
|
| 18 | { |
|
| 19 | $this->index = new IndexPage($I); |
|
| 20 | } |
|
| 21 | ||
| 22 | public function ensureIndexPageWorks(Admin $I) |
|
| 23 | { |
|
| 24 | $I->login(); |
|
| 25 | $I->needPage(Url::to('@request')); |
|
| 26 | $I->see('Requests', 'h1'); |
|
| 27 | $this->ensureICanSeeAdvancedSearchBox(); |
|
| 28 | $this->ensureICanSeeLegendBox(); |
|
| 29 | $this->ensureICanSeeBulkSearchBox(); |
|
| 30 | } |
|
| 31 | ||
| 32 | private function ensureICanSeeAdvancedSearchBox() |
|
| 33 | { |
|
| 34 | $this->index->containsFilters([ |
|
| 35 | new Select2('Server'), |
|
| 36 | new Select2('Account'), |
|
| 37 | new Select2('Status'), |
|
| 38 | new Select2('Object'), |
|
| 39 | new Select2('Client'), |
|
| 40 | ]); |
|
| 41 | } |
|
| 42 | ||
| 43 | private function ensureICanSeeLegendBox() |
|
| 44 | { |
|
| 45 | $this->index->containsLegend([ |
|
| 46 | 'Scheduled time:', |
|
| 47 | 'Already', |
|
| 48 | 'Deferred', |
|
| 49 | 'State:', |
|
| 50 | 'New', |
|
| 51 | 'In progress', |
|
| 52 | 'Done', |
|
| 53 | 'Error', |
|
| 54 | 'Buzzed', |
|
| 55 | ]); |
|
| 56 | } |
|
| 57 | ||
| 58 | private function ensureICanSeeBulkSearchBox() |
|
| 59 | { |
|
| 60 | $this->index->containsBulkButtons([ |
|
| 61 | 'Delete', |
|
| 62 | ]); |
|
| 63 | $this->index->containsColumns([ |
|
| 64 | 'Action', |
|
| 65 | 'Server', |
|
| 66 | 'Account', |
|
| 67 | 'Object', |
|
| 68 | 'Time', |
|
| 69 | 'Status', |
|
| 70 | ]); |
|
| 71 | } |
|
| 72 | } |
|
| 73 | ||
| @@ 10-71 (lines=62) @@ | ||
| 7 | use hipanel\tests\_support\Page\Widget\Input\Select2; |
|
| 8 | use hipanel\tests\_support\Step\Acceptance\Client; |
|
| 9 | ||
| 10 | class RequestsCest |
|
| 11 | { |
|
| 12 | /** |
|
| 13 | * @var IndexPage |
|
| 14 | */ |
|
| 15 | private $index; |
|
| 16 | ||
| 17 | public function _before(Client $I) |
|
| 18 | { |
|
| 19 | $this->index = new IndexPage($I); |
|
| 20 | } |
|
| 21 | ||
| 22 | public function ensureIndexPageWorks(Client $I) |
|
| 23 | { |
|
| 24 | $I->login(); |
|
| 25 | $I->needPage(Url::to('@request')); |
|
| 26 | $I->see('Requests', 'h1'); |
|
| 27 | $this->ensureICanSeeAdvancedSearchBox(); |
|
| 28 | $this->ensureICanSeeLegendBox(); |
|
| 29 | $this->ensureICanSeeBulkSearchBox(); |
|
| 30 | } |
|
| 31 | ||
| 32 | private function ensureICanSeeAdvancedSearchBox() |
|
| 33 | { |
|
| 34 | $this->index->containsFilters([ |
|
| 35 | new Select2('Server'), |
|
| 36 | new Select2('Account'), |
|
| 37 | new Select2('Status'), |
|
| 38 | new Select2('Object'), |
|
| 39 | ]); |
|
| 40 | } |
|
| 41 | ||
| 42 | private function ensureICanSeeLegendBox() |
|
| 43 | { |
|
| 44 | $this->index->containsLegend([ |
|
| 45 | 'Scheduled time:', |
|
| 46 | 'Already', |
|
| 47 | 'Deferred', |
|
| 48 | 'State:', |
|
| 49 | 'New', |
|
| 50 | 'In progress', |
|
| 51 | 'Done', |
|
| 52 | 'Error', |
|
| 53 | 'Buzzed', |
|
| 54 | ]); |
|
| 55 | } |
|
| 56 | ||
| 57 | private function ensureICanSeeBulkSearchBox() |
|
| 58 | { |
|
| 59 | $this->index->containsBulkButtons([ |
|
| 60 | 'Delete', |
|
| 61 | ]); |
|
| 62 | $this->index->containsColumns([ |
|
| 63 | 'Action', |
|
| 64 | 'Server', |
|
| 65 | 'Account', |
|
| 66 | 'Object', |
|
| 67 | 'Time', |
|
| 68 | 'Status', |
|
| 69 | ]); |
|
| 70 | } |
|
| 71 | } |
|
| 72 | ||
| @@ 10-72 (lines=63) @@ | ||
| 7 | use hipanel\tests\_support\Page\Widget\Input\Select2; |
|
| 8 | use hipanel\tests\_support\Step\Acceptance\Seller; |
|
| 9 | ||
| 10 | class RequestsCest |
|
| 11 | { |
|
| 12 | /** |
|
| 13 | * @var IndexPage |
|
| 14 | */ |
|
| 15 | private $index; |
|
| 16 | ||
| 17 | public function _before(Seller $I) |
|
| 18 | { |
|
| 19 | $this->index = new IndexPage($I); |
|
| 20 | } |
|
| 21 | ||
| 22 | public function ensureIndexPageWorks(Seller $I) |
|
| 23 | { |
|
| 24 | $I->login(); |
|
| 25 | $I->needPage(Url::to('@request')); |
|
| 26 | $I->see('Requests', 'h1'); |
|
| 27 | $this->ensureICanSeeAdvancedSearchBox(); |
|
| 28 | $this->ensureICanSeeLegendBox(); |
|
| 29 | $this->ensureICanSeeBulkSearchBox(); |
|
| 30 | } |
|
| 31 | ||
| 32 | private function ensureICanSeeAdvancedSearchBox() |
|
| 33 | { |
|
| 34 | $this->index->containsFilters([ |
|
| 35 | new Select2('Server'), |
|
| 36 | new Select2('Account'), |
|
| 37 | new Select2('Status'), |
|
| 38 | new Select2('Object'), |
|
| 39 | new Select2('Client'), |
|
| 40 | ]); |
|
| 41 | } |
|
| 42 | ||
| 43 | private function ensureICanSeeLegendBox() |
|
| 44 | { |
|
| 45 | $this->index->containsLegend([ |
|
| 46 | 'Scheduled time:', |
|
| 47 | 'Already', |
|
| 48 | 'Deferred', |
|
| 49 | 'State:', |
|
| 50 | 'New', |
|
| 51 | 'In progress', |
|
| 52 | 'Done', |
|
| 53 | 'Error', |
|
| 54 | 'Buzzed', |
|
| 55 | ]); |
|
| 56 | } |
|
| 57 | ||
| 58 | private function ensureICanSeeBulkSearchBox() |
|
| 59 | { |
|
| 60 | $this->index->containsBulkButtons([ |
|
| 61 | 'Delete', |
|
| 62 | ]); |
|
| 63 | $this->index->containsColumns([ |
|
| 64 | 'Action', |
|
| 65 | 'Server', |
|
| 66 | 'Account', |
|
| 67 | 'Object', |
|
| 68 | 'Time', |
|
| 69 | 'Status', |
|
| 70 | ]); |
|
| 71 | } |
|
| 72 | } |
|
| 73 | ||