@@ 19-83 (lines=65) @@ | ||
16 | use hipanel\tests\_support\Page\Widget\Input\Select2; |
|
17 | use hipanel\tests\_support\Step\Acceptance\Admin; |
|
18 | ||
19 | class DomainsCest |
|
20 | { |
|
21 | /** |
|
22 | * @var IndexPage |
|
23 | */ |
|
24 | private $index; |
|
25 | ||
26 | public function _before(Admin $I) |
|
27 | { |
|
28 | $this->index = new IndexPage($I); |
|
29 | } |
|
30 | ||
31 | public function ensureIndexPageWorks(Admin $I) |
|
32 | { |
|
33 | $I->login(); |
|
34 | $I->needPage(Url::to('@hdomain')); |
|
35 | $I->see('Domains', 'h1'); |
|
36 | $I->see('Create domain', 'a'); |
|
37 | $this->ensureICanSeeAdvancedSearchBox($I); |
|
38 | $this->ensureICanSeeLegendBox(); |
|
39 | $this->ensureICanSeeBulkSearchBox(); |
|
40 | } |
|
41 | ||
42 | private function ensureICanSeeAdvancedSearchBox(Admin $I) |
|
43 | { |
|
44 | $this->index->containsFilters([ |
|
45 | Input::asAdvancedSearch($I, 'Domain name'), |
|
46 | Input::asAdvancedSearch($I, 'Domain list (comma-separated)'), |
|
47 | Input::asAdvancedSearch($I, 'IP'), |
|
48 | Select2::asAdvancedSearch($I, 'Status'), |
|
49 | Select2::asAdvancedSearch($I, 'Show aliases only'), |
|
50 | Select2::asAdvancedSearch($I, 'Client'), |
|
51 | Select2::asAdvancedSearch($I, 'Reseller'), |
|
52 | Select2::asAdvancedSearch($I, 'Server'), |
|
53 | ]); |
|
54 | } |
|
55 | ||
56 | private function ensureICanSeeLegendBox() |
|
57 | { |
|
58 | $this->index->containsLegend([ |
|
59 | 'Domain', |
|
60 | 'DNS records', |
|
61 | 'Alias', |
|
62 | 'Name server', |
|
63 | 'Complex domain', |
|
64 | ]); |
|
65 | } |
|
66 | ||
67 | private function ensureICanSeeBulkSearchBox() |
|
68 | { |
|
69 | $this->index->containsBulkButtons([ |
|
70 | 'Delete', |
|
71 | ]); |
|
72 | $this->index->containsColumns([ |
|
73 | 'Domain name', |
|
74 | 'Client', |
|
75 | 'Reseller', |
|
76 | 'Account', |
|
77 | 'Server', |
|
78 | 'Status', |
|
79 | 'IP', |
|
80 | 'Service', |
|
81 | ]); |
|
82 | } |
|
83 | } |
|
84 |
@@ 19-83 (lines=65) @@ | ||
16 | use hipanel\tests\_support\Page\Widget\Input\Select2; |
|
17 | use hipanel\tests\_support\Step\Acceptance\Seller; |
|
18 | ||
19 | class DomainsCest |
|
20 | { |
|
21 | /** |
|
22 | * @var IndexPage |
|
23 | */ |
|
24 | private $index; |
|
25 | ||
26 | public function _before(Seller $I) |
|
27 | { |
|
28 | $this->index = new IndexPage($I); |
|
29 | } |
|
30 | ||
31 | public function ensureIndexPageWorks(Seller $I) |
|
32 | { |
|
33 | $I->login(); |
|
34 | $I->needPage(Url::to('@hdomain')); |
|
35 | $I->see('Domains', 'h1'); |
|
36 | $I->see('Create domain', 'a'); |
|
37 | $this->ensureICanSeeAdvancedSearchBox($I); |
|
38 | $this->ensureICanSeeLegendBox(); |
|
39 | $this->ensureICanSeeBulkSearchBox(); |
|
40 | } |
|
41 | ||
42 | private function ensureICanSeeAdvancedSearchBox(Seller $I) |
|
43 | { |
|
44 | $this->index->containsFilters([ |
|
45 | Input::asAdvancedSearch($I, 'Domain name'), |
|
46 | Input::asAdvancedSearch($I, 'Domain list (comma-separated)'), |
|
47 | Input::asAdvancedSearch($I, 'IP'), |
|
48 | Select2::asAdvancedSearch($I, 'Status'), |
|
49 | Select2::asAdvancedSearch($I, 'Show aliases only'), |
|
50 | Select2::asAdvancedSearch($I, 'Client'), |
|
51 | Select2::asAdvancedSearch($I, 'Reseller'), |
|
52 | Select2::asAdvancedSearch($I, 'Server'), |
|
53 | ]); |
|
54 | } |
|
55 | ||
56 | private function ensureICanSeeLegendBox() |
|
57 | { |
|
58 | $this->index->containsLegend([ |
|
59 | 'Domain', |
|
60 | 'DNS records', |
|
61 | 'Alias', |
|
62 | 'Name server', |
|
63 | 'Complex domain', |
|
64 | ]); |
|
65 | } |
|
66 | ||
67 | private function ensureICanSeeBulkSearchBox() |
|
68 | { |
|
69 | $this->index->containsBulkButtons([ |
|
70 | 'Delete', |
|
71 | ]); |
|
72 | $this->index->containsColumns([ |
|
73 | 'Domain name', |
|
74 | 'Client', |
|
75 | 'Reseller', |
|
76 | 'Account', |
|
77 | 'Server', |
|
78 | 'Status', |
|
79 | 'IP', |
|
80 | 'Service', |
|
81 | ]); |
|
82 | } |
|
83 | } |
|
84 |