Failed Conditions
Push — modify-scrutinizeryml ( 361e25...08b4c1 )
by Kentaro
63:54 queued 57:30
created

ProductEditPage::クリックして選択タグ()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
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->click(['css' => 'div[href="#allTags"] > a']);
61
        return $this;
62
    }
63
64
    public function クリックして選択タグ($num)
65
    {
66
        $this->tester->click(['css' => "#allTags > div:nth-child(${num}) button"]);
67
        return $this;
68
    }
69
70
    public function 入力_カテゴリ($category_id)
71
    {
72
        $this->tester->checkOption(['id' => 'admin_product_category_'.$category_id]);
73
        return $this;
74
    }
75
76 View Code Duplication
    public function 規格管理()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
77
    {
78
        $this->tester->click(['css' => '#standardConfig > div > div.d-block.text-center.text-center > a']);
79
        $this->tester->waitForElement(['css' => '#confirmFormChangeModal > div > div > div.modal-footer > a']);
80
        $this->tester->wait(1);
81
        $this->tester->click(['css' => '#confirmFormChangeModal > div > div > div.modal-footer > a']);
82
        return $this;
83
    }
84
85
    public function 登録()
86
    {
87
        $this->tester->click('#form1 > div.c-conversionArea > div > div > div:nth-child(2) > div > div:nth-child(2) > button');
88
        return $this;
89
    }
90
91
}
92