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