1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace hipanel\modules\server\tests\acceptance\client; |
4
|
|
|
|
5
|
|
|
use hipanel\helpers\Url; |
6
|
|
|
use hipanel\tests\_support\Page\IndexPage; |
7
|
|
|
use hipanel\tests\_support\Step\Acceptance\Client; |
8
|
|
|
|
9
|
|
|
class ServerCest |
10
|
|
|
{ |
11
|
|
|
/** |
12
|
|
|
* @var IndexPage |
13
|
|
|
*/ |
14
|
|
|
private $index; |
15
|
|
|
|
16
|
|
|
public function _before(Client $I) |
17
|
|
|
{ |
18
|
|
|
$this->index = new IndexPage($I); |
19
|
|
|
} |
20
|
|
|
|
21
|
|
|
public function ensureIndexPageWorks(Client $I) |
22
|
|
|
{ |
23
|
|
|
$I->login(); |
24
|
|
|
$I->needPage(Url::to('@server')); |
25
|
|
|
$I->see('Servers', 'h1'); |
26
|
|
|
$this->ensureICanSeeAdvancedSearchBox($I); |
27
|
|
|
$this->ensureICanSeeBulkServerSearchBox($I); |
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
private function ensureICanSeeAdvancedSearchBox(Client $I) |
31
|
|
|
{ |
32
|
|
|
$I->seeLink('Buy server', Url::to('/server/order/index')); |
33
|
|
|
$I->see('Advanced search', 'h3'); |
34
|
|
|
|
35
|
|
|
$this->index->containsFilters('form-advancedsearch-server-search', [ |
36
|
|
|
['input' => [ |
37
|
|
|
'id' => 'serversearch-name_like', |
38
|
|
|
'placeholder' => 'Name', |
39
|
|
|
]], |
40
|
|
|
['input' => [ |
41
|
|
|
'id' => 'serversearch-note_like', |
42
|
|
|
'placeholder' => 'Note', |
43
|
|
|
]], |
44
|
|
|
['input' => [ |
45
|
|
|
'id' => 'serversearch-ip_like', |
46
|
|
|
'placeholder' => 'IP', |
47
|
|
|
]], |
48
|
|
|
['input' => ['placeholder' => 'Type']], |
49
|
|
|
['input' => ['placeholder' => 'Status']], |
50
|
|
|
]); |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
private function ensureICanSeeBulkServerSearchBox(Client $I) |
|
|
|
|
54
|
|
|
{ |
55
|
|
|
$this->index->containsBulkButtons([ |
56
|
|
|
["//button[@type='button']" => 'Basic actions'], |
57
|
|
|
]); |
58
|
|
|
$this->index->containsColumns('bulk-server-search', [ |
59
|
|
|
'Name', |
60
|
|
|
'IPs', |
61
|
|
|
'Status', |
62
|
|
|
'Expires', |
63
|
|
|
'Tariff', |
64
|
|
|
]); |
65
|
|
|
} |
66
|
|
|
} |
67
|
|
|
|
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.