<?php

require_once __DIR__ . '../../ConstantFunctional.php';
$I = new FunctionalTester($scenario);
$I->wantTo('Check validate for Catalog input');
$I->amOnPage('/catalog/senior/input');
//submit form
//$I->checkOption('#dct195');
//$I->click('STEP2 お届け先の入力へ進む');
//url
//$I->seeCurrentUrlEquals('/catalog/senior/input');
//submit_button form
$I->click('STEP2 お届け先の入力へ進む');
//check required
$I->seeCurrentUrlEquals('/catalog/senior/input');
$I->seeFormErrorMessages(array('name1' => '姓は必須入力項目です。必ず入力してください。', 'name2' => '名は必須入力項目です。必ず入力してください。', 'kana1' => 'セイは必須入力項目です。必ず入力してください。', 'kana2' => 'メイは必須入力項目です。必ず入力してください。', 'tel1' => 'TELは必須入力項目です。必ず入力してください。', 'post1' => '郵便番号は必須入力項目です。必ず入力してください。', 'area' => '都道府県は必須入力項目です。必ず入力してください。', 'address1' => '市町村区・町名は必須入力項目です。必ず入力してください。', 'address2' => '地名・番地・建物名は必須入力項目です。必ず入力してください。', 'email1' => 'E-mailは必須入力項目です。必ず入力してください。'));
//check max length
$I->fillField('name1', INPUT_LENGTH_50 . '𪚲');
//length 51
$I->fillField('name2', INPUT_LENGTH_50 . '𪚲');
//length 51
$I->fillField('kana1', INPUT_LENGTH_50 . '𪚲');
//length 51
$I->fillField('kana2', INPUT_LENGTH_50 . '𪚲');
//length 51
$I->fillField('tel1', '12456-545-4564');
//length 14
$I->fillField('post1', '060-0000');
//length 14
$I->selectOption('area', '青森県');
$I->fillField('address1', INPUT_LENGTH_50 . '𪚲');
 public function testRequiredFields(FunctionalTester $I)
 {
     $I->click('Register', 'button');
     $I->seeFormErrorMessages(['name' => 'required', 'email' => 'required', 'password' => 'required']);
 }
<?php

require_once __DIR__ . '../../ConstantFunctional.php';
$I = new FunctionalTester($scenario);
$I->wantTo('Check validate for CatalogR3 input');
$I->amOnPage('/catalog/43up/cart?dct[]=71&dct[]=173&dct[]=213&dct[]=214&dct[]=141');
//submit form
$I->click('郵送先入力画面に進む');
//url
$I->seeCurrentUrlEquals('/catalog/43up/input');
//submit_button form
$I->click('STEP3 入力情報の確認へ進む');
//check required
$I->seeCurrentUrlEquals('/catalog/43up/input');
$I->seeFormErrorMessages(array('name1' => '姓は必須入力項目です。必ず入力してください。', 'name2' => '名は必須入力項目です。必ず入力してください。', 'kana1' => 'セイは必須入力項目です。必ず入力してください。', 'kana2' => 'メイは必須入力項目です。必ず入力してください。', 'sex' => '性別は必須入力項目です。必ず入力してください。', 'tel1' => 'TELは必須入力項目です。必ず入力してください。', 'post1' => '郵便番号は必須入力項目です。必ず入力してください。', 'area' => '都道府県は必須入力項目です。必ず入力してください。', 'address1' => '市町村区・町名は必須入力項目です。必ず入力してください。', 'address2' => '地名・番地・建物名は必須入力項目です。必ず入力してください。', 'email1' => 'E-mailは必須入力項目です。必ず入力してください。', 'age' => '年齢は必須入力項目です。必ず入力してください。', 'job' => 'ご職業は必須入力項目です。必ず入力してください。'));
//check max length
$I->fillField('name1', INPUT_LENGTH_50 . '𪚲');
//length 51
$I->fillField('name2', INPUT_LENGTH_50 . '𪚲');
//length 51
$I->fillField('kana1', INPUT_LENGTH_50 . '𪚲');
//length 51
$I->fillField('kana2', INPUT_LENGTH_50 . '𪚲');
//length 51
$I->fillField('tel1', '12456-545-4564');
//length 14
$I->fillField('post1', '98765-432-4321');
//length 14
$I->selectOption('area', '青森県');
$I->fillField('address1', INPUT_LENGTH_50 . '𪚲');
//length 51
Ejemplo n.º 4
0
<?php

$I = new FunctionalTester($scenario);
$I->wantTo('test session errors');
$I->amOnPage('/auth/register');
$I->click('button[type=submit]');
$I->seeCurrentUrlEquals('/auth/register');
$I->seeFormHasErrors();
$I->seeFormErrorMessage('name', 'The name field is required.');
$I->seeFormErrorMessages(array('name' => 'The name field is required.', 'email' => 'The email field is required.'));
Ejemplo n.º 5
0
<?php

$I = new FunctionalTester($scenario);
$I->wantTo('test session errors');
$I->amOnPage('/auth/register');
$I->click('button[type=submit]');
$I->seeCurrentUrlEquals('/auth/register');
$I->seeFormHasErrors();
$I->seeFormErrorMessage('name', 'The name field is required.');
$I->seeFormErrorMessages(['name' => 'The name field is required.', 'email' => 'The email field is required.']);
<?php

//define("INPUT_LENGTH_99", "*****@*****.**");
$I = new FunctionalTester($scenario);
$I->wantTo('Check validate for Catalog input');
$I->amOnPage('/catalog/digital_mail');
//submit form
$I->click('送信する');
//check required
$I->seeCurrentUrlEquals('/catalog/digital_mail');
$I->seeFormErrorMessages(array('email1' => 'E-mailは必須入力項目です。必ず入力してください。'));
//check max length
$I->fillField('email1', INPUT_LENGTH_99 . '.vn');
//length 102
//submit form
$I->click('送信する');
//check required
$I->seeCurrentUrlEquals('/catalog/digital_mail');
$I->seeFormErrorMessages(array('email1' => 'E-mailは100文字以下で入力してください。'));
//
//
//-----------------------------------check email can be apply-----------------------------------
//
//
//fill value
$I->fillField('email1', 'email1@gmail');
//submit form
$I->click('送信する');
//check required
$I->seeCurrentUrlEquals('/catalog/digital_mail');
//check error
Ejemplo n.º 7
0
<?php

$I = new FunctionalTester($scenario);
$I->wantTo('register a user');
$I->amOnPage('/register');
$I->fillField('name', 'Jo');
$I->fillField('email', 'example');
$I->fillField('password', 'pass');
$I->fillField('password_confirmation', 'pass');
$I->click('button[type=submit]');
$I->seeFormHasErrors();
$I->seeCurrentUrlEquals('/register');
$I->seeFormErrorMessages(array('email' => 'The email must be a valid email address.', 'name' => 'The name must be at least 3 characters.', 'password' => 'The password must be at least 8 characters.'));
$I->dontSeeRecord('users', ['email' => 'example']);
$I->expectTo('register a user with a mismatching password');
$I->fillField('name', 'Johndoe');
$I->fillField('email', '*****@*****.**');
$I->fillField('password', 'passee');
$I->fillField('password_confirmation', 'pass');
$I->click('button[type=submit]');
$I->seeFormHasErrors();
$I->seeCurrentUrlEquals('/register');
$I->seeFormErrorMessage('password', 'The password confirmation does not match.');
$I->dontSeeRecord('users', ['email' => '*****@*****.**']);
$I->expectTo('register a user with existing username and email');
$I->haveRecord('users', ['email' => '*****@*****.**', 'username' => 'andelabendozy', 'password' => bcrypt('password'), 'created_at' => new DateTime(), 'updated_at' => new DateTime(), 'status' => TRUE, 'profile_state' => FALSE]);
$I->fillField('name', 'andelabendozy');
$I->fillField('email', '*****@*****.**');
$I->fillField('password', 'password');
$I->fillField('password_confirmation', 'password');
$I->click('button[type=submit]');
<?php

$I = new FunctionalTester($scenario);
$I->wantTo('test form error assertions');
$I->amOnPage('/');
$I->click('Utwórz konto', '.btn-register');
$I->seeCurrentUrlEquals('/Register');
$I->click('button[type=submit]');
$I->seeFormHasErrors();
$I->seeFormErrorMessages(array('name' => 'Pole nazwa użytkownika jest wymagane.', 'email' => 'Pole email jest wymagane.', 'password' => 'Pole hasło jest wymagane.'));
$I->fillField('name', '^%&%%$^$');
$I->fillField('email', '*****@*****.**');
$I->fillField('password', 'password');
$I->fillField('password_confirmation', 'password');
$I->click('button[type=submit]');
$I->seeFormErrorMessage('name', 'Nazwa użytkownika może zawierać litery, cyfry oraz znaki ._ -');