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

codeception/acceptance/EF06OtherCest.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
use Codeception\Util\Fixtures;
4
5
/**
6
 * @group front
7
 * @group other
8
 * @group ef6
9
 */
10
class EF06OtherCest
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
11
{
12
    public function _before(\AcceptanceTester $I)
13
    {
14
    }
15
16
    public function _after(\AcceptanceTester $I)
17
    {
18
    }
19
20 View Code Duplication
    public function other_ログイン正常(\AcceptanceTester $I)
21
    {
22
        $I->wantTo('EF0601-UC01-T01 ログイン 正常パターン');
23
        $I->logoutAsMember();
24
25
        $createCustomer = Fixtures::get('createCustomer');
26
        $customer = $createCustomer();
27
        $I->loginAsMember($customer->getEmail(), 'password');
28
    }
29
30 View Code Duplication
    public function other_ログイン異常1(\AcceptanceTester $I)
31
    {
32
        $I->wantTo('EF0601-UC01-T02 ログイン 異常パターン(仮会員)');
33
        $I->logoutAsMember();
34
35
        $createCustomer = Fixtures::get('createCustomer');
36
        $customer = $createCustomer(null, false);
37
38
        $I->amOnPage('/mypage/login');
39
        $I->submitForm('#login_mypage', [
40
            'login_email' => $customer->getEmail(),
41
            'login_pass' => 'password'
42
        ]);
43
44
        $I->see('ログインできませんでした。', 'div.ec-login p.ec-errorMessage');
45
    }
46
47 View Code Duplication
    public function other_ログイン異常2(\AcceptanceTester $I)
48
    {
49
        $I->wantTo('EF0601-UC01-T03 ログイン 異常パターン(入力ミス)');
50
        $I->logoutAsMember();
51
52
        $createCustomer = Fixtures::get('createCustomer');
53
        $customer = $createCustomer(null, false);
54
55
        $I->amOnPage('/mypage/login');
56
        $I->submitForm('#login_mypage', [
57
            'login_email' => $customer->getEmail().'.bad',
58
            'login_pass' => 'password'
59
        ]);
60
61
        $I->see('ログインできませんでした。', 'div.ec-login p.ec-errorMessage');
62
    }
63
64
    public function other_パスワード再発行(\AcceptanceTester $I)
65
    {
66
        $I->wantTo('EF0602-UC01-T01 パスワード再発行');
67
        $I->logoutAsMember();
68
        $BaseInfo = Fixtures::get('baseinfo');
69
70
        // TOPページ→ログイン(「ログイン情報をお忘れですか?」リンクを押下する)→パスワード再発行
71
        $I->amOnPage('/mypage/login');
72
        //$I->click('ログイン情報をお忘れですか', '#login_mypage #login_box .btn_area ul li a');
73
        $I->amOnPage('/forgot');
74
75
        // TOPページ>ログイン>パスワード再発行
76
        $I->see('パスワードの再発行', 'div.ec-pageHeader h1');
77
78
        // メールアドレスを入力する
79
        // 「次のページへ」ボタンを押下する
80
        $createCustomer = Fixtures::get('createCustomer');
81
        $customer = $createCustomer();
82
        $I->resetEmails();
83
        $I->submitForm('#form1', [
84
            'login_email' => $customer->getEmail()
85
        ]);
86
        $I->see('パスワード発行メールの送信 完了', 'div.ec-pageHeader h1');
87
88
        $I->seeEmailCount(2);
89
        foreach (array($customer->getEmail(), $BaseInfo->getEmail01()) as $email) {
90
            $I->seeInLastEmailSubjectTo($email, 'パスワード変更のご確認');
91
        }
92
        $url = $I->grabFromLastEmailTo($customer->getEmail(), '@/forgot/reset/(.*)@');
93
94
        $I->resetEmails();
95
        $I->amOnPage($url);
96
        $I->see('パスワード変更(完了ページ)', 'div.ec-pageHeader h1');
97
        $I->seeEmailCount(2);
98
        foreach (array($customer->getEmail(), $BaseInfo->getEmail01()) as $email) {
99
            $I->seeInLastEmailSubjectTo($email, 'パスワード変更のお知らせ');
100
        }
101
        $new_password = $I->grabFromLastEmailTo($customer->getEmail(), '@新しいパスワード:(.*)@');
102
        $I->loginAsMember($customer->getEmail(), trim(str_replace('新しいパスワード:', '', $new_password)));
103
    }
104
105 View Code Duplication
    public function other_ログアウト(\AcceptanceTester $I)
106
    {
107
        $I->wantTo('EF0603-UC01-T01 ログアウト');
108
        $I->logoutAsMember();
109
110
        $createCustomer = Fixtures::get('createCustomer');
111
        $customer = $createCustomer();
112
        $I->loginAsMember($customer->getEmail(), 'password');
113
114
        $I->logoutAsMember();
115
    }
116
117
    public function other_当サイトについて(\AcceptanceTester $I)
118
    {
119
        $I->wantTo('EF0604-UC01-T01 当サイトについて');
120
        $I->amOnPage('/');
121
122
        $I->click('.ec-footerNavi .ec-footerNavi__link:nth-child(1) a');
123
        $I->see('当サイトについて', 'div.ec-pageHeader h1');
124
        $baseinfo = Fixtures::get('baseinfo');
125
        $I->see($baseinfo->getShopName(), '#help_about_box__shop_name');
126
    }
127
128
    public function other_プライバシーポリシー(\AcceptanceTester $I)
129
    {
130
        $I->wantTo('EF0605-UC01-T01 プライバシーポリシー');
131
        $I->amOnPage('/');
132
133
        $I->click('.ec-footerNavi .ec-footerNavi__link:nth-child(2) a');
134
        $I->see('プライバシーポリシー', 'div.ec-pageHeader h1');
135
        $I->see('個人情報保護の重要性に鑑み、「個人情報の保護に関する法律」及び本プライバシーポリシーを遵守し、お客さまのプライバシー保護に努めます。', 'div.ec-layoutRole__main p:nth-child(1)');
136
    }
137
138
    public function other_特定商取引法に基づく表記(\AcceptanceTester $I)
139
    {
140
        $I->wantTo('EF0606-UC01-T01 特定商取引法に基づく表記');
141
        $I->amOnPage('/');
142
143
        $I->click('.ec-footerNavi .ec-footerNavi__link:nth-child(3) a');
144
        $I->see('特定商取引法に基づく表記', 'div.ec-pageHeader h1');
145
    }
146
147
    public function other_お問い合わせ1(\AcceptanceTester $I)
148
    {
149
        $I->wantTo('EF0607-UC01-T01 お問い合わせ');
150
        $I->amOnPage('/');
151
        $I->resetEmails();
152
        $faker = Fixtures::get('faker');
153
        $new_email = microtime(true).'.'.$faker->safeEmail;
154
        $BaseInfo = Fixtures::get('baseinfo');
155
156
        $I->click('.ec-footerNavi .ec-footerNavi__link:nth-child(4) a');
157
        $I->see('お問い合わせ', 'div.ec-pageHeader h1');
158
159
        $I->fillField(['id' => 'contact_name_name01'], '姓');
160
        $I->fillField(['id' => 'contact_name_name02'], '名');
161
        $I->fillField(['id' => 'contact_kana_kana01'], 'セイ');
162
        $I->fillField(['id' => 'contact_kana_kana02'], 'メイ');
163
        $I->fillField(['id' => 'contact_postal_code'], '530-0001');
164
        $I->selectOption(['id' => 'contact_address_pref'], ['value' => '27']);
165
        $I->fillField(['id' => 'contact_address_addr01'], '大阪市北区');
166
        $I->fillField(['id' => 'contact_address_addr02'], '梅田2-4-9 ブリーゼタワー13F');
167
        $I->fillField(['id' => 'contact_phone_number'], '111-111-111');
168
        $I->fillField(['id' => 'contact_email'], $new_email);
169
        $I->fillField(['id' => 'contact_contents'], 'お問い合わせ内容の送信');
170
        $I->click('div.ec-RegisterRole__actions button.ec-blockBtn--action');
171
172
        $I->see('お問い合わせ', 'div.ec-pageHeader h1');
173
        $I->click('div.ec-contactConfirmRole div.ec-RegisterRole__actions button.ec-blockBtn--action');
174
175
        // 完了ページ
176
        $I->see('お問い合わせ完了', 'div.ec-pageHeader h1');
177
178
        // メールチェック
179
        $I->seeEmailCount(2);
180 View Code Duplication
        foreach (array($new_email, $BaseInfo->getEmail01()) as $email) {
181
            $I->seeInLastEmailSubjectTo($email, 'お問い合わせを受け付けました');
182
            $I->seeInLastEmailTo($email, '姓 名 様');
183
            $I->seeInLastEmailTo($email, 'お問い合わせ内容の送信');
184
        }
185
    }
186
}
187