|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
|
|
4
|
|
|
namespace Page\Admin; |
|
5
|
|
|
|
|
6
|
|
|
|
|
7
|
|
|
class FileManagePage extends AbstractAdminPageStyleGuide |
|
8
|
|
|
{ |
|
9
|
|
|
|
|
10
|
|
|
/** |
|
11
|
|
|
* FileManagePage constructor. |
|
12
|
|
|
*/ |
|
13
|
|
|
public function __construct(\AcceptanceTester $I) |
|
14
|
|
|
{ |
|
15
|
|
|
parent::__construct($I); |
|
16
|
|
|
} |
|
17
|
|
|
|
|
18
|
|
|
public static function go($I) |
|
19
|
|
|
{ |
|
20
|
|
|
$page = new self($I); |
|
21
|
|
|
return $page->goPage('/content/file_manager', 'ファイル管理コンテンツ管理'); |
|
22
|
|
|
} |
|
23
|
|
|
|
|
24
|
|
|
public function 入力_ファイル($fileName) |
|
25
|
|
|
{ |
|
26
|
|
|
$this->tester->attachFile(['id' => 'form_file'], $fileName); |
|
27
|
|
|
return $this; |
|
28
|
|
|
} |
|
29
|
|
|
|
|
30
|
|
|
public function アップロード() |
|
31
|
|
|
{ |
|
32
|
|
|
$this->tester->click('#upload_box__file a.action-upload'); |
|
33
|
|
|
return $this; |
|
34
|
|
|
} |
|
35
|
|
|
|
|
36
|
|
|
public function 入力_フォルダ名($value) |
|
37
|
|
|
{ |
|
38
|
|
|
$this->tester->fillField(['id' => 'form_create_file'], $value); |
|
39
|
|
|
return $this; |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
public function フォルダ作成() |
|
43
|
|
|
{ |
|
44
|
|
|
$this->tester->click('#form1 a.action-create'); |
|
45
|
|
|
return $this; |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
public function ファイル名($rowNum) |
|
49
|
|
|
{ |
|
50
|
|
|
return "#fileList table > tbody > tr:nth-child(${rowNum}) > td:nth-child(2)"; |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
public function 一覧_ダウンロード($rowNum) |
|
54
|
|
|
{ |
|
55
|
|
|
$this->tester->click("#fileList table > tbody > tr:nth-child(${rowNum}) > td:nth-child(5) a.action-download"); |
|
56
|
|
|
return $this; |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
public function 一覧_表示($rowNum) |
|
60
|
|
|
{ |
|
61
|
|
|
$this->tester->click("#fileList table > tbody > tr:nth-child(${rowNum}) > td:nth-child(5) a.action-view"); |
|
62
|
|
|
return $this; |
|
63
|
|
|
} |
|
64
|
|
|
|
|
65
|
|
|
public function 一覧_ファイル名_クリック($rowNum) |
|
66
|
|
|
{ |
|
67
|
|
|
$this->tester->click("#fileList table > tbody > tr:nth-child(${rowNum}) > td:nth-child(2) a"); |
|
68
|
|
|
return $this; |
|
69
|
|
|
} |
|
70
|
|
|
|
|
71
|
|
|
public function 一覧_削除($rowNum) |
|
72
|
|
|
{ |
|
73
|
|
|
$this->tester->click("#fileList table > tbody > tr:nth-child(${rowNum}) > td:nth-child(5) a.action-delete"); |
|
74
|
|
|
return $this; |
|
75
|
|
|
} |
|
76
|
|
|
|
|
77
|
|
|
public function 一覧_削除_accept($rowNum) |
|
78
|
|
|
{ |
|
79
|
|
|
$this->tester->waitForElementVisible("#confirmModal-${rowNum} div.modal-footer a.btn-ec-delete"); |
|
80
|
|
|
$this->tester->click("#confirmModal-${rowNum} div.modal-footer a.btn-ec-delete"); |
|
81
|
|
|
return $this; |
|
82
|
|
|
} |
|
83
|
|
|
|
|
84
|
|
|
/** |
|
85
|
|
|
* パンくずのパスを取得 |
|
86
|
|
|
* @param $index int 1から始まる(1はuser_data) |
|
87
|
|
|
* @return string |
|
88
|
|
|
*/ |
|
89
|
|
|
public function パンくず($index) |
|
90
|
|
|
{ |
|
91
|
|
|
return "//*[@id=\"bread\"]/li[${index}]"; |
|
92
|
|
|
} |
|
93
|
|
|
} |