|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
use Codeception\Util\Fixtures; |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* @group front |
|
7
|
|
|
* @group customer |
|
8
|
|
|
* @group ef4 |
|
9
|
|
|
*/ |
|
10
|
|
|
class EF04CustomerCest |
|
|
|
|
|
|
11
|
|
|
{ |
|
12
|
|
|
public function customer_会員登録正常(\AcceptanceTester $I) |
|
13
|
|
|
{ |
|
14
|
|
|
$I->wantTo('EF0401-UC01-T01 会員登録 正常パターン'); |
|
15
|
|
|
$I->amOnPage('/entry'); |
|
16
|
|
|
$faker = Fixtures::get('faker'); |
|
17
|
|
|
$BaseInfo = Fixtures::get('baseinfo'); |
|
18
|
|
|
$new_email = microtime(true).'.'.$faker->safeEmail; |
|
19
|
|
|
// 会員情報入力フォームに、会員情報を入力する |
|
20
|
|
|
// 「同意する」ボタンを押下する |
|
21
|
|
|
$form = [ |
|
22
|
|
|
'entry[name][name01]' => '姓', |
|
23
|
|
|
'entry[name][name02]' => '名', |
|
24
|
|
|
'entry[kana][kana01]' => 'セイ', |
|
25
|
|
|
'entry[kana][kana02]' => 'メイ', |
|
26
|
|
|
'entry[postal_code]' => '530-0001', |
|
27
|
|
|
'entry[address][pref]' => ['value' => '27'], |
|
28
|
|
|
'entry[address][addr01]' => '大阪市北区', |
|
29
|
|
|
'entry[address][addr02]' => '梅田2-4-9 ブリーゼタワー13F', |
|
30
|
|
|
'entry[phone_number]' => '111-111-111', |
|
31
|
|
|
'entry[email][first]' => $new_email, |
|
32
|
|
|
'entry[email][second]' => $new_email, |
|
33
|
|
|
'entry[password][first]' => 'password', |
|
34
|
|
|
'entry[password][second]' => 'password', |
|
35
|
|
|
'entry[job]' => ['value' => '1'], |
|
36
|
|
|
]; |
|
37
|
|
|
$findPluginByCode = Fixtures::get('findPluginByCode'); |
|
38
|
|
|
$Plugin = $findPluginByCode('MailMagazine'); |
|
39
|
|
|
if ($Plugin) { |
|
40
|
|
|
$I->amGoingTo('メルマガプラグインを発見したため、メルマガを購読します'); |
|
41
|
|
|
$form['entry[mailmaga_flg]'] = '1'; |
|
42
|
|
|
} |
|
43
|
|
|
$I->submitForm(['css' => '.ec-layoutRole__main form'], $form, ['css' => 'button.ec-blockBtn--action']); |
|
44
|
|
|
|
|
45
|
|
|
// 入力した会員情報を確認する。 |
|
46
|
|
|
$I->see('姓 名', '.ec-registerRole form .ec-borderedDefs dl:nth-child(1) dd'); |
|
47
|
|
|
$I->see('111111111', '.ec-registerRole form .ec-borderedDefs dl:nth-child(5) dd'); |
|
48
|
|
|
$I->see($new_email, '.ec-registerRole form .ec-borderedDefs dl:nth-child(6) dd'); |
|
49
|
|
|
|
|
50
|
|
|
$I->resetEmails(); |
|
51
|
|
|
// 「会員登録をする」ボタンを押下する |
|
52
|
|
|
$I->click('.ec-registerRole form button.ec-blockBtn--action'); |
|
53
|
|
|
|
|
54
|
|
|
$I->seeEmailCount(2); |
|
55
|
|
View Code Duplication |
foreach (array($new_email, $BaseInfo->getEmail01()) as $email) { |
|
|
|
|
|
|
56
|
|
|
$I->seeInLastEmailSubjectTo($email, '会員登録のご確認'); |
|
57
|
|
|
$I->seeInLastEmailTo($email, '姓 名 様'); |
|
58
|
|
|
$I->seeInLastEmailTo($email, 'この度は会員登録依頼をいただきまして、有り難うございます。'); |
|
59
|
|
|
} |
|
60
|
|
|
|
|
61
|
|
|
// 「トップページへ」ボタンを押下する |
|
62
|
|
|
$I->click('a.ec-blockBtn--cancel'); |
|
63
|
|
|
$I->see('新着情報', '.ec-news__title'); |
|
64
|
|
|
|
|
65
|
|
|
|
|
66
|
|
|
// アクティベートURL取得 |
|
67
|
|
|
$activateUrl = $I->grabFromLastEmailTo($new_email, '@/entry/activate/(.*)@'); |
|
68
|
|
|
$I->resetEmails(); |
|
69
|
|
|
|
|
70
|
|
|
// アクティベートURLからトップページへ |
|
71
|
|
|
$I->amOnPage($activateUrl); |
|
72
|
|
|
$I->see('新規会員登録(完了)', 'div.ec-pageHeader h1'); |
|
73
|
|
|
|
|
74
|
|
|
$I->seeEmailCount(2); |
|
75
|
|
View Code Duplication |
foreach (array($new_email, $BaseInfo->getEmail01()) as $email) { |
|
|
|
|
|
|
76
|
|
|
$I->seeInLastEmailSubjectTo($email, '会員登録が完了しました。'); |
|
77
|
|
|
$I->seeInLastEmailTo($email, '姓 名 様'); |
|
78
|
|
|
$I->seeInLastEmailTo($email, '本会員登録が完了いたしました。'); |
|
79
|
|
|
} |
|
80
|
|
|
|
|
81
|
|
|
$I->click('div.ec-registerCompleteRole a.ec-blockBtn--cancel'); |
|
82
|
|
|
$I->see('新着情報', '.ec-news__title'); |
|
83
|
|
|
} |
|
84
|
|
|
|
|
85
|
|
|
public function customer_会員登録異常1(\AcceptanceTester $I) |
|
86
|
|
|
{ |
|
87
|
|
|
$I->wantTo('EF0401-UC01-T02 会員登録 異常パターン 重複'); |
|
88
|
|
|
$I->amOnPage('/entry'); |
|
89
|
|
|
|
|
90
|
|
|
$createCustomer = Fixtures::get('createCustomer'); |
|
91
|
|
|
$customer = $createCustomer(); |
|
92
|
|
|
|
|
93
|
|
|
// 会員情報入力フォームに、会員情報を入力する |
|
94
|
|
|
// 「同意する」ボタンを押下する |
|
95
|
|
|
$I->submitForm(['css' => '.ec-layoutRole__main form'], [ |
|
96
|
|
|
'entry[name][name01]' => '姓', |
|
97
|
|
|
'entry[name][name02]' => '名', |
|
98
|
|
|
'entry[kana][kana01]' => 'セイ', |
|
99
|
|
|
'entry[kana][kana02]' => 'メイ', |
|
100
|
|
|
'entry[postal_code]' => '530-0001', |
|
101
|
|
|
'entry[address][pref]' => ['value' => '27'], |
|
102
|
|
|
'entry[address][addr01]' => '大阪市北区', |
|
103
|
|
|
'entry[address][addr02]' => '梅田2-4-9 ブリーゼタワー13F', |
|
104
|
|
|
'entry[phone_number]' => '111-111-111', |
|
105
|
|
|
'entry[email][first]' => $customer->getEmail(), // 会員登録済みのメールアドレスを入力する |
|
106
|
|
|
'entry[email][second]' => $customer->getEmail(), |
|
107
|
|
|
'entry[password][first]' => 'password', |
|
108
|
|
|
'entry[password][second]' => 'password', |
|
109
|
|
|
], ['css' => 'button.ec-blockBtn--action']); |
|
110
|
|
|
|
|
111
|
|
|
// 入力した会員情報を確認する。 |
|
112
|
|
|
$I->see('既に利用されているメールアドレスです', '.ec-registerRole form .ec-borderedDefs dl:nth-child(6) dd'); |
|
113
|
|
|
} |
|
114
|
|
|
|
|
115
|
|
|
public function customer_会員登録異常2(\AcceptanceTester $I) |
|
116
|
|
|
{ |
|
117
|
|
|
$I->wantTo('EF0401-UC01-T03 会員登録 異常パターン 入力ミス'); |
|
118
|
|
|
$I->amOnPage('/entry'); |
|
119
|
|
|
|
|
120
|
|
|
$faker = Fixtures::get('faker'); |
|
121
|
|
|
$new_email = microtime(true).'.'.$faker->safeEmail; |
|
122
|
|
|
|
|
123
|
|
|
// 会員情報入力フォームに、会員情報を入力する |
|
124
|
|
|
// 「同意する」ボタンを押下する |
|
125
|
|
|
$I->submitForm(['css' => '.ec-layoutRole__main form'], [ |
|
126
|
|
|
'entry[name][name01]' => '', |
|
127
|
|
|
'entry[name][name02]' => '名', |
|
128
|
|
|
'entry[kana][kana01]' => 'セイ', |
|
129
|
|
|
'entry[kana][kana02]' => 'メイ', |
|
130
|
|
|
'entry[postal_code]' => '530-0001', |
|
131
|
|
|
'entry[address][pref]' => ['value' => '27'], |
|
132
|
|
|
'entry[address][addr01]' => '大阪市北区', |
|
133
|
|
|
'entry[address][addr02]' => '梅田2-4-9 ブリーゼタワー13F', |
|
134
|
|
|
'entry[phone_number]' => '111-111-111', |
|
135
|
|
|
'entry[email][first]' => $new_email, |
|
136
|
|
|
'entry[email][second]' => $new_email, |
|
137
|
|
|
'entry[password][first]' => 'password', |
|
138
|
|
|
'entry[password][second]' => 'password', |
|
139
|
|
|
], ['css' => 'button.ec-blockBtn--action']); |
|
140
|
|
|
|
|
141
|
|
|
// 入力した会員情報を確認する。 |
|
142
|
|
|
$I->see('新規会員登録', '.ec-pageHeader h1'); |
|
143
|
|
|
|
|
144
|
|
|
// TODO [fixture] 確認画面のあとでのメールアドレス重複エラー |
|
145
|
|
|
} |
|
146
|
|
|
|
|
147
|
|
|
public function customer_会員登録同意しない(\AcceptanceTester $I) |
|
148
|
|
|
{ |
|
149
|
|
|
$I->wantTo('EF0401-UC01-T04 会員登録 同意しないボタン'); |
|
150
|
|
|
$I->amOnPage('/entry'); |
|
151
|
|
|
|
|
152
|
|
|
$I->click('.ec-layoutRole__main form a.ec-blockBtn--cancel'); |
|
153
|
|
|
$I->see('新着情報', '.ec-news__title'); |
|
154
|
|
|
} |
|
155
|
|
|
|
|
156
|
|
|
public function customer_会員登録戻る(\AcceptanceTester $I) |
|
157
|
|
|
{ |
|
158
|
|
|
$I->wantTo('EF0401-UC01-T05 会員登録 戻るボタン'); |
|
159
|
|
|
$I->amOnPage('/entry'); |
|
160
|
|
|
|
|
161
|
|
|
$faker = Fixtures::get('faker'); |
|
162
|
|
|
$new_email = microtime(true).'.'.$faker->safeEmail; |
|
163
|
|
|
|
|
164
|
|
|
// 会員情報入力フォームに、会員情報を入力する |
|
165
|
|
|
// 「同意する」ボタンを押下する |
|
166
|
|
|
$form = [ |
|
167
|
|
|
'entry[name][name01]' => '姓', |
|
168
|
|
|
'entry[name][name02]' => '名', |
|
169
|
|
|
'entry[kana][kana01]' => 'セイ', |
|
170
|
|
|
'entry[kana][kana02]' => 'メイ', |
|
171
|
|
|
'entry[postal_code]' => '530-0001', |
|
172
|
|
|
'entry[address][pref]' => ['value' => '27'], |
|
173
|
|
|
'entry[address][addr01]' => '大阪市北区', |
|
174
|
|
|
'entry[address][addr02]' => '梅田2-4-9 ブリーゼタワー13F', |
|
175
|
|
|
'entry[phone_number]' => '111-111-111', |
|
176
|
|
|
'entry[email][first]' => $new_email, |
|
177
|
|
|
'entry[email][second]' => $new_email, |
|
178
|
|
|
'entry[password][first]' => 'password', |
|
179
|
|
|
'entry[password][second]' => 'password', |
|
180
|
|
|
'entry[job]' => ['value' => '1'], |
|
181
|
|
|
]; |
|
182
|
|
|
|
|
183
|
|
|
$findPluginByCode = Fixtures::get('findPluginByCode'); |
|
184
|
|
|
$Plugin = $findPluginByCode('MailMagazine'); |
|
185
|
|
|
if ($Plugin) { |
|
186
|
|
|
$I->amGoingTo('メルマガプラグインを発見したため、メルマガを購読します'); |
|
187
|
|
|
$form['entry[mailmaga_flg]'] = '1'; |
|
188
|
|
|
} |
|
189
|
|
|
$I->submitForm(['css' => '.ec-layoutRole__main form'], $form, ['css' => 'button.ec-blockBtn--action']); |
|
190
|
|
|
|
|
191
|
|
|
$I->click('.ec-registerRole form button.ec-blockBtn--cancel'); |
|
192
|
|
|
$I->see('新規会員登録', '.ec-pageHeader h1'); |
|
193
|
|
|
} |
|
194
|
|
|
|
|
195
|
|
|
public function customer_会員登録利用規約(\AcceptanceTester $I) |
|
196
|
|
|
{ |
|
197
|
|
|
$I->wantTo('EF0404-UC01-T01 会員登録 利用規約'); |
|
198
|
|
|
$I->amOnPage('/entry'); |
|
199
|
|
|
|
|
200
|
|
|
$I->click('.ec-registerRole form a.ec-link'); |
|
201
|
|
|
|
|
202
|
|
|
$I->switchToNewWindow(); |
|
203
|
|
|
$I->seeInCurrentUrl('/help/agreement'); |
|
204
|
|
|
} |
|
205
|
|
|
} |
|
206
|
|
|
|
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.