1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* 商品管理/商品登録 |
5
|
|
|
*/ |
6
|
|
|
namespace Page\Admin; |
7
|
|
|
|
8
|
|
|
class ProductEditPage extends AbstractAdminPageStyleGuide |
9
|
|
|
{ |
10
|
|
|
public static $登録結果メッセージ = '#page_admin_product_product_edit > div.c-container > div.c-contentsArea > div.alert.alert-success.alert-dismissible.fade.show.m-3'; |
11
|
|
|
public static $販売種別 = ['id' => 'admin_product_class_sale_type']; |
12
|
|
|
public static $通常価格 = ['id' => 'admin_product_class_price01']; |
13
|
|
|
public static $販売価格 = ['id' => 'admin_product_class_price02']; |
14
|
|
|
public static $在庫数 = ['id' => 'admin_product_class_stock']; |
15
|
|
|
public static $商品コード = ['id' => 'admin_product_class_code']; |
16
|
|
|
public static $販売制限数 = ['id' => 'admin_product_class_sale_limit']; |
17
|
|
|
public static $お届可能日 = ['id' => 'admin_product_class_delivery_duration']; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* ProductRegisterPage constructor. |
21
|
|
|
*/ |
22
|
|
|
public function __construct(\AcceptanceTester $I) |
23
|
|
|
{ |
24
|
|
|
parent::__construct($I); |
25
|
|
|
} |
26
|
|
|
|
27
|
|
|
public static function go($I) |
28
|
|
|
{ |
29
|
|
|
$page = new ProductEditPage($I); |
30
|
|
|
return $page->goPage('/product/product/new', '商品管理商品登録'); |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
public static function at($I) |
34
|
|
|
{ |
35
|
|
|
$page = new ProductEditPage($I); |
36
|
|
|
$page->tester->see('商品管理商品登録', '#page_admin_product_product_edit > div.c-container > div.c-contentsArea > div > div'); |
37
|
|
|
return $page; |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
public function 入力_商品名($value) |
41
|
|
|
{ |
42
|
|
|
$this->tester->fillField(['id' => 'admin_product_name'], $value); |
43
|
|
|
return $this; |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
public function 入力_販売価格($value) |
47
|
|
|
{ |
48
|
|
|
$this->tester->fillField(self::$販売価格, $value); |
49
|
|
|
return $this; |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
public function 入力_公開() |
53
|
|
|
{ |
54
|
|
|
$this->tester->selectOption('#admin_product_Status', '公開'); |
55
|
|
|
return $this; |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
public function 入力_非公開() |
59
|
|
|
{ |
60
|
|
|
$this->tester->selectOption('#admin_product_Status', '非公開'); |
61
|
|
|
return $this; |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
public function クリックして開くタグリスト() |
65
|
|
|
{ |
66
|
|
|
$this->tester->click(['css' => 'div[href="#allTags"] > a']); |
67
|
|
|
return $this; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
public function クリックして選択タグ($num) |
71
|
|
|
{ |
72
|
|
|
$this->tester->click(['css' => "#allTags > div:nth-child(${num}) button"]); |
73
|
|
|
return $this; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
public function 入力_カテゴリ($category_id) |
77
|
|
|
{ |
78
|
|
|
$this->tester->checkOption(['id' => 'admin_product_category_'.$category_id]); |
79
|
|
|
return $this; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
public function 規格管理() |
83
|
|
|
{ |
84
|
|
|
$this->tester->scrollTo(['css' => '#standardConfig > div > div.d-block.text-center > a'],0, 200); |
85
|
|
|
$this->tester->click(['css' => '#standardConfig > div > div.d-block.text-center > a']); |
86
|
|
|
$this->tester->waitForElement(['css' => '#standardConfig > div > div.d-block.text-center > a']); |
87
|
|
|
$this->tester->wait(1); |
88
|
|
|
$this->tester->click(['css' => '#confirmFormChangeModal > div > div > div.modal-footer > a.btn.btn-ec-conversion']); |
89
|
|
|
return $this; |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
public function 登録() |
93
|
|
|
{ |
94
|
|
|
$this->tester->click('#form1 > div.c-conversionArea > div > div > div:nth-child(2) > div > div:nth-child(2) > button'); |
95
|
|
|
return $this; |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
public function プレビュー() |
99
|
|
|
{ |
100
|
|
|
$this->tester->click(['xpath' => "//*[@id='preview']/div/div/a[text()='プレビュー']"]); |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
} |
104
|
|
|
|