public function it_validates_required_fields(AcceptanceTester $I)
 {
     $I->amOnRoute(LoginPage::$ROUTE);
     $I->submitForm(LoginPage::$formId, [], 'Login');
     $I->see('The username field is required.');
     $I->see('The password field is required.');
 }
 public function write(AcceptanceTester $I)
 {
     $I->wantTo('write a message');
     $I->amOnPage('/Mikroblogi');
     $I->submitForm('.microblog-submit', ['text' => 'Testowy wpis na mikroblogu']);
     $I->wait(1);
     $I->canSee('Testowy wpis na mikroblogu');
 }
 public function authentication_パスワード認証(\AcceptanceTester $I)
 {
     $I->wantTo('EA0201-UC01-T01 パスワード認証');
     // _before()で正常系はテスト済み
     // 異常系のテスト
     $I->logoutAsAdmin();
     $I->submitForm('#form1', ['login_id' => "invalid", 'password' => "invalidpassword"]);
     $I->see('ログインできませんでした。', '.login-box #form1 .text-danger');
 }
Beispiel #4
0
 /**
  * @param \AcceptanceTester $I
  */
 public function submitASession(AcceptanceTester $I)
 {
     $I->am('an attendee');
     $I->wantTo('submit a session');
     $I->expect('to be able a submit a new session');
     // Login user.
     $I->amOnPage('/user/login');
     $I->submitForm('#user-login-form', ['name' => 'user1', 'pass' => '123456']);
     $I->seeElement('body.user-logged-in');
     // Fill session submission.
     $I->amOnPage('/node/add/session');
     $node_title = $this->faker->text(30);
     $I->fillField('title[0][value]', $node_title);
     $I->fillCkEditorByName('body[0][value]', $this->faker->text(100));
     $I->fillField('field_author[0][target_id]', 'user1 (2)');
     $I->selectOption('field_exp_level', 0);
     $I->selectOption('field_session_track', 'development');
     $I->makeScreenshot('session_form');
     $I->submitForm('#node-session-form', [], 'op');
     $I->makeScreenshot('session_view');
     $I->see($node_title, '.l-content');
 }
 /**
  * Tests add product to cart
  *
  * @group checkout
  *
  * @param $I \AcceptanceTester
  *
  */
 public function testAddProductToCart(AT $I)
 {
     $I->am('Visitor');
     $I->wantTo('Add product to cart');
     $I->amGoingTo('open category page');
     $I->amOnPage(Page\Catalog::$CATEGORY_URL);
     $I->expectTo('see category page');
     $I->amGoingTo('open product page');
     $I->click(Page\Catalog::$categoryFirstProduct);
     $I->expectTo('see product page');
     $I->seeElement(Page\Catalog::$productBody);
     $I->amGoingTo('submit the form');
     $I->submitForm(Page\Catalog::$addToCartForm, array());
     $I->expectTo('see the cart page');
     $I->seeCurrentUrlEquals(Page\Checkout::$CART_URL);
     $I->expectTo('see a success message');
     $I->seeElement(Page\Catalog::$successMessage);
 }
Beispiel #6
0
<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('create a new user account');
$I->amOnPage('/join');
//--------------------------------------------------------------------
// Error without info
//--------------------------------------------------------------------
$I->expect('the form is not submitted');
$I->seeElement('#submit');
$I->submitForm('form', [], '#submit');
$I->seeElement('.alert-danger');
//--------------------------------------------------------------------
// Error with weak password
//--------------------------------------------------------------------
$fields = ['first_name' => 'Test', 'last_name' => 'User', 'email' => '*****@*****.**', 'username' => 'tester', 'password' => '123456', 'pass_confirm' => '123456'];
$I->expect('the form is not submitted');
$I->submitForm('#join_form', $fields, '#submit');
$I->seeElement('.alert-danger');
//--------------------------------------------------------------------
// Can create user
//--------------------------------------------------------------------
$fields = ['first_name' => 'Test', 'last_name' => 'User', 'email' => '*****@*****.**', 'username' => 'tester', 'password' => 'mylittlepony', 'pass_confirm' => 'mylittlepony'];
$I->expect('the form is submitted and a user is created');
$I->submitForm('#join_form', $fields, '#submit');
$I->dontSeeElement('.alert-danger');
Beispiel #7
0
<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('login a valid user');
// Test user
$I->haveInDatabase('users', ['id' => 1, 'email' => '*****@*****.**', 'username' => 'tester', 'password_hash' => '$2y$10$wEzfeu4AdmR4mQSit3TCH.je1THv/Z8XqzDI4AOCov4lssqeA/gwS', 'created_on' => date('Y-m-d H:i:s', strtotime('-1 month')), 'active' => 1, 'deleted' => 0, 'force_pass_reset' => 0]);
// First - ensure that we are logged out
$I->amOnPage('/logout');
$I->amOnPage('/login');
//--------------------------------------------------------------------
// Error without info
//--------------------------------------------------------------------
$I->expect('the form is not submitted');
$I->seeElement('#submit');
$I->submitForm('form', [], '#submit');
$I->seeElement('.alert-danger');
//--------------------------------------------------------------------
// Error without bad password
//--------------------------------------------------------------------
$I->expect('error returned due to bad password');
$I->seeElement('#submit');
$I->submitForm('#login_form', ['email' => '*****@*****.**', 'password' => 'badstuff'], '#submit');
$I->seeElement('.alert-danger');
$I->expect('login attempt was logged');
$I->seeInDatabase('auth_login_attempts', ['email' => '*****@*****.**']);
//--------------------------------------------------------------------
// Error without bad email
//--------------------------------------------------------------------
$I->expect('error returned due to bad email');
$I->seeElement('#submit');
$I->submitForm('#login_form', ['email' => '*****@*****.**', 'password' => 'mylittlepony'], '#submit');
 public function it_validates_name_regex(AcceptanceTester $I)
 {
     //^[A-Za-z]'?[-\. a-zA-Z]+$
     $field = 'name';
     $error = 'The name format is invalid.';
     //Starts with letter
     $I->amOnRoute(RegisterPage::$ROUTE);
     $I->fillField($field, '1');
     $I->submitForm(RegisterPage::$formId, [], 'Register');
     $I->see($error);
     //Can have space
     $I->amOnRoute(RegisterPage::$ROUTE);
     $I->fillField($field, 'aa aa');
     $I->submitForm(RegisterPage::$formId, [], 'Register');
     $I->dontSee($error);
     //Can have symbols
     $I->amOnRoute(RegisterPage::$ROUTE);
     $I->fillField($field, 'aa-.');
     $I->submitForm(RegisterPage::$formId, [], 'Register');
     $I->dontSee($error);
 }
Beispiel #9
0
 /**
  * Login with the given details.
  * @param \AcceptanceTester|\FunctionalTester $I
  * @param string                              $email
  * @param string                              $password
  */
 public static function login($I, $email, $password)
 {
     $I->submitForm('#login-form', ['LoginForm[email]' => $email, 'LoginForm[password]' => $password]);
 }
Beispiel #10
0
<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('perform actions and see result');
$I->amOnPage('/');
$I->see('Richard Nwankwo');
$I->see('Software Engineer');
$I->see('Philadelphia, PA');
$I->seeLink('Home', '/');
$I->seeLink('About', '/about');
$I->seeLink('Contact', '/contact');
$I->seeLink('Projects', '/projects');
$I->click('About');
$I->see('About Me');
$I->see('Technologies/Frameworks I love using');
$I->click('Projects');
$I->see('Projects');
$I->click('Contact');
$I->see('Contact Me');
$I->submitForm('#contactForm', ['name' => 'Richard Nwankwo', 'email' => '*****@*****.**', 'message' => 'This is a test']);
$I->see('Message Sent!');
 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 it_validates_required_password_reset_form_email_field(AcceptanceTester $I)
 {
     $I->amOnRoute(PasswordResetPage::$ROUTE);
     $I->submitForm(PasswordResetPage::$formId, [], PasswordResetPage::$submit);
     $I->see('The email field is required.');
 }
Beispiel #13
0
 /**
  * Sign up for a new user account with the given details.
  * @param \AcceptanceTester|\FunctionalTester $I
  * @param string                              $fields
  */
 public static function signup($I, $fields)
 {
     $I->submitForm('#signup-form', ['SignupForm[email]' => $fields['email'], 'SignupForm[password]' => $fields['password'], 'SignupForm[forename]' => $fields['forename'], 'SignupForm[surname]' => $fields['surname']]);
 }
Beispiel #14
0
<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('Fill form');
$I->amOnPage('/reg.php');
$I->seeElement('input', ['name' => 'sbmt', 'id' => 'rg_sbmt1']);
$I->click('input#rg_sbmt1');
$I->seeElement('form', ['name' => 'MMform']);
$I->submitForm('*[name=MMform]', ['fio' => 'Иванов Иван Иванович', 'phone' => '71111111111', 'email' => '*****@*****.**']);
Beispiel #15
0
 /**
  * Set the user's password to the given password.
  * @param \AcceptanceTester|\FunctionalTester $I
  * @param string                              $password
  */
 public static function setNewPassword($I, $password)
 {
     $I->submitForm('#reset-password-form', ['ResetPasswordForm[password]' => $password]);
 }
 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, 'お問い合わせ内容の送信');
     }
 }
<?php

$I = new AcceptanceTester($scenario);
$I->am('admin');
$I->amOnPage('/');
$I->fillField('username', '*****@*****.**');
$I->fillField('password', 'admin');
$I->click('Вход');
$I->click('Каталог');
$I->submitForm('#search', ['query' => 'ASDR']);
$I->see('Результаты поиска', 'h1');
<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('log in');
$I->amOnPage('/benachrichtigungen');
$I->fillField('email', '*****@*****.**');
$I->fillField('password', '1234');
$I->submitForm('#login', [], $I->grabAttributeFrom('#login', 'name'));
$I->see('Benachrichtigungen an user@example.com:');
 public function customer_会員登録戻る(\AcceptanceTester $I)
 {
     $I->wantTo('EF0401-UC01-T05 会員登録 戻るボタン');
     $I->amOnPage('/entry');
     $faker = Fixtures::get('faker');
     $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->click('#main_middle form .btn_group p:nth-child(2) button');
     $I->see('新規会員登録', '#main_middle h1');
 }
Beispiel #20
0
<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('Get the internationalization start page');
$I->amOnPage('/learn-zf2-i18n');
$I->see('I18n example with Zend Framework 2');
$I->see('Messages in current language (en_US)');
$I->amOnPage('/learn-zf2-i18n?lang=id_ID');
$I->see('Messages in current language (id_ID)');
$I->amOnPage('/learn-zf2-i18n?lang=es_ES');
$I->see('Messages in current language (es_ES)');
$I->amOnPage('/learn-zf2-i18n');
$I->submitForm('#changeLanguageForm', ['lang' => 'id_ID']);
$I->see('Messages in current language (id_ID)');
<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('add a new user and see it in database');
$I->amOnPage('/oauth/login');
$I->see('Sign In');
$I->submitForm('#login-form', ['email' => '*****@*****.**', 'password' => '123456', 'remember' => true], 'Sign In');
$I->amOnPage('/oauth/register/signup');
$I->fillField('firstname', 'Phanbook');
$I->fillField('email', '*****@*****.**');
$I->fillField('username', 'admin');
$I->click('Sign in');
$I->seeInDatabase('users', ['email' => '*****@*****.**', 'username' => 'admin']);
 public function mypage_お届け先編集削除(\AcceptanceTester $I)
 {
     $I->wantTo('EF0503-UC01-T01 Mypage お届け先編集削除');
     $createCustomer = Fixtures::get('createCustomer');
     $customer = $createCustomer();
     $I->loginAsMember($customer->getEmail(), 'password');
     // TOPページ>マイページ>お届け先編集
     $I->amOnPage('/mypage');
     $I->click('#main_middle .local_nav ul li:nth-child(4) a');
     // 追加フォーム お届け先1つの登録だと削除できないので2個目を追加
     $I->click('#main_middle #deliveradd_select div p a');
     // 入力 & submit
     $I->submitForm("#main_middle form", ['customer_address[name][name01]' => '姓0501', 'customer_address[name][name02]' => '名0501', 'customer_address[kana][kana01]' => 'セイ', 'customer_address[kana][kana02]' => 'メイ', 'customer_address[zip][zip01]' => '530', 'customer_address[zip][zip02]' => '0001', 'customer_address[address][pref]' => 27, 'customer_address[address][addr01]' => '大阪市西区', 'customer_address[address][addr02]' => '梅田2-4-9 ブリーゼタワー13F', 'customer_address[tel][tel01]' => '111', 'customer_address[tel][tel02]' => '111', 'customer_address[tel][tel03]' => '111']);
     $I->see('大阪市西区', '#main_middle #deliveradd_select .address_table .addr_box');
     // ×マークをクリック
     $I->click('#main_middle #deliveradd_select .address_table:nth-child(2) .addr_box .icon_edit a');
     $I->acceptPopup();
     // 確認
     $I->see('大阪市西区', '#main_middle #deliveradd_select .address_table .addr_box');
     $I->dontSee($customer->getAddr01(), '#main_middle #deliveradd_select .address_table .addr_box');
 }
Beispiel #23
0
 /**
  * Submit the project create/update form directly, without filling in
  * fields. New images cannot be submitted via this method, but it bypasses
  * certain field constraints.
  * @param \AcceptanceTester|\FunctionalTester $I
  * @param array                               $data
  */
 public static function submitData($I, $data)
 {
     $I->submitForm('#project-form', ['Project[name]' => $data['name'], 'Project[coordinator]' => $data['coordinator'], 'Project[status]' => $data['status']]);
 }
Beispiel #24
0
<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('test login');
$I->amOnPage('/');
$I->submitForm('#login', ['username' => 'testguy', 'password' => 'testtest']);
$I->see('Howdy');
Beispiel #25
0
 /**
  *Submit the volunteer form
  * @param \AcceptanceTester|\FunctionalTester $I
  * @param string                              $fields
  */
 public static function submit($I, $fields)
 {
     $I->submitForm('#volunteer-form', ['VolunteerForm[interests]' => $fields['interests'], 'VolunteerForm[experience]' => $fields['experience'], 'VolunteerForm[availability]' => $fields['availability'], 'VolunteerForm[daysAvailable]' => $fields['daysAvailable'], 'VolunteerForm[skills]' => $fields['skills'], 'VolunteerForm[mobile]' => $fields['mobile']]);
 }
Beispiel #26
0
<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('add a new user and see it in database');
$I->amOnPage('/oauth/login');
$I->see('Sign Up With Google');
$I->click('.google-button');
$I->see('Sign Up With Github');
$I->click('.gitbub-button');
$I->see('Sign Up With Facebook');
$I->see('Login');
$I->submitForm('#login-form', ['email' => 'Davert', 'password' => '123456', 'remember' => true], 'Login');
$I->click('Sign Up With Email');
$I->fillField('firstname', 'Phanbook');
$I->fillField('email', '*****@*****.**');
$I->fillField('username', 'admin');
$I->click('Sign in');
$I->seeInDatabase('users', ['email' => '*****@*****.**', 'username' => 'admin']);
 /**
  * Submit the password reset request for the given email.
  * @param \AcceptanceTester|\FunctionalTester $I
  * @param string                              $email
  */
 public static function submitEmail($I, $email)
 {
     $I->submitForm('#request-password-reset-form', ['PasswordResetRequestForm[email]' => $email]);
 }
Beispiel #28
0
 /**
  * Submit the project create/update form.
  * @param \AcceptanceTester|\FunctionalTester $I
  * @param array                               $fields
  */
 public static function submit($I, $fields)
 {
     $I->submitForm('#activity-form', ['ProjectActivity[projectID]' => $fields['project'], 'ProjectActivity[name]' => $fields['name'], 'ProjectActivity[date]' => $fields['date'], 'ProjectActivity[description]' => $fields['description']]);
 }