public function customer_会員登録正常(\AcceptanceTester $I, \Codeception\Scenario $scenario)
 {
     $I->wantTo('EF0401-UC01-T01 会員登録 正常パターン');
     $I->amOnPage('/entry');
     $faker = Fixtures::get('faker');
     $BaseInfo = Fixtures::get('baseinfo');
     $new_email = microtime(true) . '.' . $faker->safeEmail;
     // 会員情報入力フォームに、会員情報を入力する
     // 「同意する」ボタンを押下する
     $form = ['entry[name][name01]' => '姓', 'entry[name][name02]' => '名', 'entry[kana][kana01]' => 'セイ', 'entry[kana][kana02]' => 'メイ', 'entry[zip][zip01]' => '530', 'entry[zip][zip02]' => '0001', 'entry[address][pref]' => 27, 'entry[address][addr01]' => '大阪市北区', 'entry[address][addr02]' => '梅田2-4-9 ブリーゼタワー13F', 'entry[tel][tel01]' => '111', 'entry[tel][tel02]' => '111', 'entry[tel][tel03]' => '111', 'entry[email][first]' => $new_email, 'entry[email][second]' => $new_email, 'entry[password][first]' => 'password', 'entry[password][second]' => 'password'];
     $findPluginByCode = Fixtures::get('findPluginByCode');
     $Plugin = $findPluginByCode('MailMagazine');
     if ($Plugin) {
         $I->amGoingTo('メルマガプラグインを発見したため、メルマガを購読します');
         $form['entry[mailmaga_flg]'] = '1';
     }
     $I->submitForm("#main_middle form", $form);
     // 入力した会員情報を確認する。
     $I->see('姓 名', '#main_middle form .dl_table dl:nth-child(1) dd');
     $I->see('111 - 111 - 111', '#main_middle form .dl_table dl:nth-child(5) dd');
     $I->see($new_email, '#main_middle form .dl_table dl:nth-child(7) dd');
     $I->resetEmails();
     // 「会員登録をする」ボタンを押下する
     $I->click('#main_middle form .btn_group p:nth-child(1) button');
     $I->seeEmailCount(2);
     foreach (array($new_email, $BaseInfo->getEmail01()) as $email) {
         $I->seeInLastEmailSubjectTo($email, '会員登録のご確認');
         $I->seeInLastEmailTo($email, '姓 名 様');
         $I->seeInLastEmailTo($email, 'この度は会員登録依頼をいただきまして、有り難うございます。');
     }
     // 「トップページへ」ボタンを押下する
     $I->click('#main_middle .btn_group p a');
     $I->see('新着情報', '#contents_bottom #news_area h2');
     // アクティベートURL取得
     $activateUrl = $I->grabFromLastEmailTo($new_email, '@/entry/activate/(.*)@');
     $I->resetEmails();
     // アクティベートURLからトップページへ
     $I->amOnPage($activateUrl);
     $I->see('新規会員登録(完了)', '#contents #main #main_middle h1');
     $I->seeEmailCount(2);
     foreach (array($new_email, $BaseInfo->getEmail01()) as $email) {
         $I->seeInLastEmailSubjectTo($email, '会員登録が完了しました。');
         $I->seeInLastEmailTo($email, '姓 名 様');
         $I->seeInLastEmailTo($email, '本会員登録が完了いたしました。');
     }
     $I->click('#main_middle .btn_group p a');
     $I->see('新着情報', '#contents_bottom #news_area h2');
 }
 public function order_一括メール通知(\AcceptanceTester $I)
 {
     $I->wantTo('EA0402-UC02-T01(& UC02-T02) 一括メール通知');
     $I->resetEmails();
     $config = Fixtures::get('config');
     $findOrders = Fixtures::get('findOrders');
     // Closure
     $TargetOrders = array_filter($findOrders(), function ($Order) use($config) {
         return $Order->getOrderStatus()->getId() != $config['order_processing'];
     });
     $OrderListPage = OrderManagePage::go($I)->検索();
     $I->see('検索結果 ' . count($TargetOrders) . ' 件 が該当しました', OrderManagePage::$検索結果_メッセージ);
     $OrderListPage->一覧_全選択()->メール一括通知();
     $I->selectOption(['id' => 'template-change'], ['1' => 'ご注文ありがとうございます']);
     $I->click(['css' => '#top_box__button_menu > button']);
     $I->click(['css' => '#confirm_box__button_menu > p:nth-child(2) > button']);
     $I->seeEmailCount(20);
 }
 public function order_ゲスト購入情報変更(\AcceptanceTester $I)
 {
     $I->wantTo('EF0305-UC02-T01 ゲスト購入 情報変更');
     // EF0305-UC04-T01も一緒にテスト
     $I->logoutAsMember();
     $faker = Fixtures::get('faker');
     $new_email = microtime(true) . '.' . $faker->safeEmail;
     $BaseInfo = Fixtures::get('baseinfo');
     // 商品詳細パーコレータ カートへ
     $I->amOnPage('products/detail/2');
     $I->buyThis(1);
     // レジへ
     $I->click('#main_middle .total_box .btn_group p a');
     $I->see('ログイン', '#main_middle .page-heading');
     // ゲスト購入
     $I->click('#main_middle #login_box div:nth-child(2) .btn_area a');
     $I->see('お客様情報の入力', '#main_middle .page-heading');
     $I->submitForm("#main_middle form", ['nonmember[name][name01]' => '姓03', 'nonmember[name][name02]' => '名03', 'nonmember[kana][kana01]' => 'セイ', 'nonmember[kana][kana02]' => 'メイ', 'nonmember[zip][zip01]' => '530', 'nonmember[zip][zip02]' => '0001', 'nonmember[address][pref]' => 27, 'nonmember[address][addr01]' => '大阪市北区', 'nonmember[address][addr02]' => '梅田2-4-9 ブリーゼタワー13F', 'nonmember[tel][tel01]' => '111', 'nonmember[tel][tel02]' => '111', 'nonmember[tel][tel03]' => '111', 'nonmember[email][first]' => $new_email, 'nonmember[email][second]' => $new_email]);
     // 確認
     $I->see('ご注文内容のご確認', '#main_middle .page-heading');
     $I->see('お客様情報', '#main_middle #shopping-form #confirm_main');
     $I->see('配送情報', '#main_middle #shopping-form #confirm_main');
     $I->see('お届け先', '#main_middle #shopping-form #confirm_main');
     $I->see('お支払方法', '#main_middle #shopping-form #confirm_main');
     $I->see('お問い合わせ欄', '#main_middle #shopping-form #confirm_main');
     $I->see('小計', '#main_middle #shopping-form #confirm_side');
     $I->see('手数料', '#main_middle #shopping-form #confirm_side');
     $I->see('送料', '#main_middle #shopping-form #confirm_side');
     $I->see('合計', '#main_middle #shopping-form #confirm_side');
     // お客様情報変更
     $I->click('#main_middle #shopping-form #confirm_main #customer');
     $I->wait(10);
     $I->fillField(['id' => 'edit0'], '姓0301');
     $I->click('#main_middle #shopping-form #confirm_main #customer-ok button');
     $I->wait(10);
     $I->see('姓0301', '#main_middle #shopping-form #confirm_main .address');
     // 配送情報
     $I->click('#main_middle #shopping-form #confirm_main .btn-shipping-edit');
     $I->see('お届け先の追加', '#main_middle .page-heading');
     $I->fillField(['id' => 'shopping_shipping_name_name01'], '姓0302');
     $I->click('#main_middle form .btn_group p:nth-child(1) button');
     $I->see('姓0302', '#main_middle #shopping-form #confirm_main .address');
     $I->resetEmails();
     // 注文
     $I->click('#main_middle #shopping-form #confirm_side .total_amount p:nth-child(2) button');
     $I->wait(1);
     // 確認
     $I->see('ご注文完了', '#main_middle .page-heading');
     $I->seeEmailCount(2);
     foreach (array($new_email, $BaseInfo->getEmail01()) as $email) {
         // TODO 注文した商品の内容もチェックしたい
         $I->seeInLastEmailSubjectTo($email, 'ご注文ありがとうございます');
         $I->seeInLastEmailTo($email, '姓0301 名03 様');
         $I->seeInLastEmailTo($email, 'お名前 :姓0302名03 様', '変更後のお届け先');
         $I->seeInLastEmailTo($email, '郵便番号:〒530-0001');
         $I->seeInLastEmailTo($email, '住所  :大阪府大阪市北区梅田2-4-9 ブリーゼタワー13F');
         $I->seeInLastEmailTo($email, '電話番号:111-111-111');
         $I->seeInLastEmailTo($email, 'メールアドレス:' . $new_email);
     }
     // topへ
     $I->click('#main_middle #deliveradd_input .btn_group p a');
     $I->see('新着情報', '#contents_bottom #news_area h2');
 }
 public function other_お問い合わせ1(\AcceptanceTester $I)
 {
     $I->wantTo('EF0607-UC01-T01 お問い合わせ');
     $I->amOnPage('/');
     $I->resetEmails();
     $faker = Fixtures::get('faker');
     $new_email = microtime(true) . '.' . $faker->safeEmail;
     $BaseInfo = Fixtures::get('baseinfo');
     $I->click('#footer ul li:nth-child(4) a');
     $I->see('お問い合わせ', '#main h1');
     $I->submitForm("#form1", ['contact[name][name01]' => '姓', 'contact[name][name02]' => '名', 'contact[kana][kana01]' => 'セイ', 'contact[kana][kana02]' => 'メイ', 'contact[zip][zip01]' => '530', 'contact[zip][zip02]' => '0001', 'contact[address][pref]' => 27, 'contact[address][addr01]' => '大阪市北区', 'contact[address][addr02]' => '梅田2-4-9 ブリーゼタワー13F', 'contact[tel][tel01]' => '111', 'contact[tel][tel02]' => '111', 'contact[tel][tel03]' => '111', 'contact[email]' => $new_email, 'contact[contents]' => 'お問い合わせ内容の送信']);
     $I->see('お問い合わせ', '#main h1');
     $I->click('#confirm_box__confirm_button > button');
     // 完了ページ
     $I->see('お問い合わせ完了', '#main h1');
     // メールチェック
     $I->seeEmailCount(2);
     foreach (array($new_email, $BaseInfo->getEmail01()) as $email) {
         $I->seeInLastEmailSubjectTo($email, 'お問い合わせを受け付けました');
         $I->seeInLastEmailTo($email, '姓 名 様');
         $I->seeInLastEmailTo($email, 'お問い合わせ内容の送信');
     }
 }
 public function customer_仮会員メール再送(\AcceptanceTester $I)
 {
     $I->wantTo('EA0501-UC06-T01(& UC06-T02) 仮会員メール再送');
     $I->resetEmails();
     $createCustomer = Fixtures::get('createCustomer');
     $customer = $createCustomer(null, false);
     $BaseInfo = Fixtures::get('baseinfo');
     CustomerManagePage::go($I)->検索($customer->getEmail())->一覧_仮会員メール再送(1);
     $I->acceptPopup();
     $I->wait(10);
     $I->seeEmailCount(2);
     foreach (array($customer->getEmail(), $BaseInfo->getEmail01()) as $email) {
         $I->seeInLastEmailSubjectTo($email, '会員登録のご確認');
         $I->seeInLastEmailTo($email, $customer->getName01() . ' ' . $customer->getName02() . ' 様');
     }
 }