当前位置: 首页>>代码示例>>PHP>>正文


PHP AcceptanceTester::submitForm方法代码示例

本文整理汇总了PHP中AcceptanceTester::submitForm方法的典型用法代码示例。如果您正苦于以下问题:PHP AcceptanceTester::submitForm方法的具体用法?PHP AcceptanceTester::submitForm怎么用?PHP AcceptanceTester::submitForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AcceptanceTester的用法示例。


在下文中一共展示了AcceptanceTester::submitForm方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: it_validates_required_fields

 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.');
 }
开发者ID:v-radev,项目名称:laravel-auth-pack,代码行数:7,代码来源:LoginAcceptanceCest.php

示例2: write

 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');
 }
开发者ID:furious-programming,项目名称:coyote,代码行数:8,代码来源:MicroblogCest.php

示例3:

 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');
 }
开发者ID:EC-CUBE,项目名称:eccube-codeception,代码行数:9,代码来源:EA02AuthenticationCest.php

示例4: submitASession

 /**
  * @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');
 }
开发者ID:itamair,项目名称:ddd-website,代码行数:25,代码来源:SessionCest.php

示例5: testAddProductToCart

 /**
  * 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);
 }
开发者ID:rogyar,项目名称:Magento-Codeception,代码行数:26,代码来源:CheckoutCest.php

示例6: AcceptanceTester

<?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' => 'tester@example.com', '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' => 'tester@example.com', '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');
开发者ID:leloulight,项目名称:Sprint,代码行数:26,代码来源:JoinCept.php

示例7: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('login a valid user');
// Test user
$I->haveInDatabase('users', ['id' => 1, 'email' => 'tester@example.com', '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' => 'tester@example.com', 'password' => 'badstuff'], '#submit');
$I->seeElement('.alert-danger');
$I->expect('login attempt was logged');
$I->seeInDatabase('auth_login_attempts', ['email' => 'tester@example.com']);
//--------------------------------------------------------------------
// Error without bad email
//--------------------------------------------------------------------
$I->expect('error returned due to bad email');
$I->seeElement('#submit');
$I->submitForm('#login_form', ['email' => 'testy@examples.com', 'password' => 'mylittlepony'], '#submit');
开发者ID:leloulight,项目名称:Sprint,代码行数:31,代码来源:LoginCept.php

示例8: it_validates_name_regex

 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);
 }
开发者ID:v-radev,项目名称:laravel-auth-pack,代码行数:21,代码来源:RegisterAcceptanceCest.php

示例9: login

 /**
  * 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]);
 }
开发者ID:rhamlet1,项目名称:Hazid,代码行数:10,代码来源:LoginPage.php

示例10: AcceptanceTester

<?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' => 'richnwan@gmail.com', 'message' => 'This is a test']);
$I->see('Message Sent!');
开发者ID:RichNwankwo,项目名称:richnwan,代码行数:21,代码来源:HomeCept.php

示例11: microtime

 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');
 }
开发者ID:EC-CUBE,项目名称:eccube-codeception,代码行数:63,代码来源:EF03OrderCest.php

示例12: it_validates_required_password_reset_form_email_field

 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.');
 }
开发者ID:v-radev,项目名称:laravel-auth-pack,代码行数:6,代码来源:ResetFunctionalCest.php

示例13: signup

 /**
  * 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']]);
 }
开发者ID:rhamlet1,项目名称:Hazid,代码行数:9,代码来源:SignupPage.php

示例14: AcceptanceTester

<?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' => 'ivani@mail.ru']);
开发者ID:errogaht,项目名称:pabtest2,代码行数:9,代码来源:EmulateCept.php

示例15: setNewPassword

 /**
  * 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]);
 }
开发者ID:rhamlet1,项目名称:Hazid,代码行数:9,代码来源:ResetPasswordPage.php


注:本文中的AcceptanceTester::submitForm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。