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


PHP AcceptanceTester::selectOption方法代码示例

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


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

示例1: CreatePayment

 /**
  * Create payment method with specified parameters
  * 
  * @param AcceptanceTester $I   Controller
  * @param string $name          Fill field "Name"
  * @param string $currency      Select "Currency Name"
  * @param string $active        Set Checkbox "Active" on|off
  * @param string $description   Fill field "Description"
  * @param string $paymentsystem Select "Payment system"
  */
 protected function CreatePayment(AcceptanceTester $I, $name, $currency = null, $active = null, $description = null, $paymentsystem = null)
 {
     if (isset($name)) {
         $I->amOnPage(PaymentCreatePage::$URL);
         $I->fillField(PaymentCreatePage::$FieldName, $name);
     }
     if (isset($currency)) {
         $I->selectOption(PaymentCreatePage::$SelectPaymentSystem, $currency);
     }
     if (isset($active)) {
         $Class = $I->grabAttributeFrom('//form/div[1]/div[3]/div[2]/span', 'class');
         switch ($active) {
             case 'on':
                 if ($Class == 'frame_label') {
                     $I->click(PaymentCreatePage::$CheckboxActive);
                     $I->comment('Checkbox Active on');
                 }
                 break;
             case 'off':
                 if ($Class == 'frame_label active') {
                     $I->click(PaymentCreatePage::$CheckboxActive);
                     $I->comment('Checkbox Active off');
                 }
                 break;
         }
     }
     if (isset($description)) {
         $I->fillField(PaymentCreatePage::$FieldDescription, $description);
     }
     if (isset($paymentsystem)) {
         $I->selectOption(PaymentCreatePage::$SelectPaymentSystem, $paymentsystem);
     }
     $I->click(PaymentCreatePage::$ButtonCreate);
 }
开发者ID:NaszvadiG,项目名称:ImageCMS,代码行数:44,代码来源:PaymentHelper.php

示例2: testOnePageCheckout

 /**
  * Tests One Page Checkout
  *
  * @group checkout
  *
  * @param $I \AcceptanceTester
  *
  * @depends testAddProductToCart
  */
 public function testOnePageCheckout(AT $I)
 {
     $I->am('Guest Customer');
     $I->wantTo('use One Page Checkout');
     $I->lookForwardTo('experience flawless checkout');
     $I->amGoingTo('place an order as a guest');
     $I->amOnPage(Page\Checkout::$URL);
     $I->amGoingTo('select the checkout type');
     $I->selectOption(Page\Checkout::$radioTypeGuest, 'guest');
     $I->click(Page\Checkout::$continueButton);
     $I->amGoingTo('fill my address');
     $I->fillField(Page\Checkout::$billingFirstname, $this->getConfig('firstname'));
     $I->fillField(Page\Checkout::$billingLastname, $this->getConfig('lastname'));
     $I->fillField(Page\Checkout::$billingEmail, $this->getConfig('email'));
     $I->selectOption(Page\Checkout::$billingCountryId, $this->getConfig('country_id'));
     $I->fillField(Page\Checkout::$billingStreet1, $this->getConfig('street'));
     $I->fillField(Page\Checkout::$billingPostcode, $this->getConfig('postcode'));
     $I->fillField(Page\Checkout::$billingCity, $this->getConfig('city'));
     $I->fillField(Page\Checkout::$billingTelephone, $this->getConfig('phone'));
     $I->click('button', Page\Checkout::$billingAddressContainer);
     $I->amGoingTo('select shipping method');
     $I->waitForElementVisible(Page\Checkout::$shippingButtonsContainer);
     $I->selectOption(Page\Checkout::$shippingMethodInput, Page\Checkout::$shippingMethod);
     $I->click('button', Page\Checkout::$shippingButtonsContainer);
     $I->waitForElementVisible(Page\Checkout::$paymentButtonsContainer);
     // $I->amGoingTo('select payment method');
     // $I->click(Page\Checkout::$paymentMethod);
     $I->click('button', Page\Checkout::$paymentButtonsContainer);
     $I->waitForElementVisible(Page\Checkout::$checkoutReviewContainer);
     $I->amGoingTo('review and finish my order');
     $I->click('button', Page\Checkout::$checkoutReviewContainer);
     $I->wait(7);
 }
开发者ID:rogyar,项目名称:Magento-Codeception,代码行数:42,代码来源:CheckoutCest.php

示例3: editPost

 private function editPost(\AcceptanceTester $I)
 {
     $I->amOnPage('/post/183/edit');
     $I->waitForElement('.btn-primary', 10);
     $I->seeOptionIsSelected('.form select[name="gid"]', 'group-1 for user 100');
     $I->fillField('input[name="item-rating[2]"]', '');
     $I->click('.form[role="edit-look"] .btn-primary');
     $I->see("Item 3's store rating is required");
     $I->click('//*[@id="items"]/div[2]/span');
     $I->click('.form[role="edit-look"] .btn-primary');
     $I->seeInField('//*[@id="items"]/div[2]/input[1]', 'post-183 item-370 rating-4 store-16');
     $I->amOnPage('/post/183/edit');
     $I->waitForElement('.btn-primary', 10);
     $I->fillField('input[name="item-rating[2]"]', '5');
     $I->selectOption('.form select[name="gid"]', 'Uncategorized');
     $I->click('.form[role="edit-look"] .btn-primary');
     $I->waitForElement('.alert-success', 10);
     $I->amOnPage('/post/183/edit');
     $I->waitForElement('input[name="item-rating[2]"]', 10);
     $I->seeInField('input[name="item-rating[2]"]', '5');
     $I->seeOptionIsSelected('.form select[name="gid"]', 'Uncategorized');
     $I->fillField('input[name="item-rating[2]"]', '4');
     $I->selectOption('.form select[name="gid"]', 'group-1 for user 100');
     $I->click('.form[role="edit-look"] .btn-primary');
     $I->waitForElement('.alert-success', 10);
     $I->amOnPage('/post/183/edit');
     $I->waitForElement('input[name="item-rating[2]"]', 10);
     $I->seeInField('input[name="item-rating[2]"]', '4');
     $I->seeOptionIsSelected('.form select[name="gid"]', 'group-1 for user 100');
 }
开发者ID:bbig979,项目名称:shoppyst,代码行数:30,代码来源:TKPostCest.php

示例4: taxRates

 public function taxRates(AcceptanceTester $I)
 {
     $I->wantTo('test tax rates');
     $clientEmail = $this->faker->safeEmail;
     $productKey = $this->faker->text(10);
     $itemTaxRate = $this->faker->randomFloat(2, 5, 15);
     $itemTaxName = $this->faker->word();
     $invoiceTaxRate = $this->faker->randomFloat(2, 5, 15);
     $invoiceTaxName = $this->faker->word();
     $itemCost = $this->faker->numberBetween(1, 20);
     $total = $itemCost;
     $total += round($itemCost * $itemTaxRate / 100, 2);
     $total += round($itemCost * $invoiceTaxRate / 100, 2);
     // create tax rates
     $I->amOnPage('/tax_rates/create');
     $I->fillField(['name' => 'name'], $itemTaxName);
     $I->fillField(['name' => 'rate'], $itemTaxRate);
     $I->click('Save');
     $I->see($itemTaxName);
     $I->amOnPage('/tax_rates/create');
     $I->fillField(['name' => 'name'], $invoiceTaxName);
     $I->fillField(['name' => 'rate'], $invoiceTaxRate);
     $I->click('Save');
     $I->see($invoiceTaxName);
     // enable line item taxes
     $I->amOnPage('/settings/tax_rates');
     $I->checkOption('#invoice_item_taxes');
     $I->click('Save');
     // create product
     $I->amOnPage('/products/create');
     $I->fillField(['name' => 'product_key'], $productKey);
     $I->fillField(['name' => 'notes'], $this->faker->text(80));
     $I->fillField(['name' => 'cost'], $itemCost);
     $I->selectOption('select[name=default_tax_rate_id]', $itemTaxName . ' ' . $itemTaxRate . '%');
     $I->click('Save');
     $I->wait(1);
     $I->see($productKey);
     // create client
     $I->amOnPage('/clients/create');
     $I->fillField(['name' => 'contacts[0][email]'], $clientEmail);
     $I->click('Save');
     $I->see($clientEmail);
     // create invoice
     $I->amOnPage('/invoices/create');
     $I->selectDropdown($I, $clientEmail, '.client_select .dropdown-toggle');
     $I->fillField('table.invoice-table tbody tr:nth-child(1) #product_key', $productKey);
     $I->selectOption('#taxRateSelect', $invoiceTaxName . ' ' . $invoiceTaxRate . '%');
     $I->wait(2);
     // check total is right before saving
     $I->see("\${$total}");
     $I->click('Save');
     $I->wait(1);
     $I->see($clientEmail);
     // check total is right after saving
     $I->see("\${$total}");
     $I->amOnPage('/invoices');
     // check total is right in list view
     $I->see("\${$total}");
 }
开发者ID:joshuadwire,项目名称:invoiceninja,代码行数:59,代码来源:TaxRatesCest.php

示例5: doAddMenuOptionValue

 public function doAddMenuOptionValue(\AcceptanceTester $I, $num, $name, $price, $quantity)
 {
     $I->click('#tfoot .action .btn-primary');
     $I->selectOption("#option-value{$num} select", $name);
     $I->fillField("menu_options[1][option_values][{$num}][price]", $price);
     $I->fillField("menu_options[1][option_values][{$num}][quantity]", $quantity);
     $I->click("#option-value{$num} label.btn:not(.active)");
 }
开发者ID:allrested,项目名称:TastyIgniter,代码行数:8,代码来源:Acceptance.php

示例6: submit

 /**
  * Submit the project create/update form.
  * @param \AcceptanceTester|\FunctionalTester $I
  * @param array                               $fields
  */
 public static function submit($I, $fields)
 {
     if ($fields['image']) {
         $I->attachFile('#uploadform-newimage', $fields['image']);
     }
     $I->fillField(['name' => 'Project[name]'], $fields['name']);
     $I->selectOption(['name' => 'Project[coordinator]'], $fields['coordinator']);
     $I->fillField(['name' => 'Project[status]'], $fields['status']);
     $I->fillField(['name' => 'UploadForm[newImageDescription][]'], $fields['imageDescription']);
     $I->click('#project-form button');
 }
开发者ID:rhamlet1,项目名称:Hazid,代码行数:16,代码来源:FormPageFragment.php

示例7: createManualTask

 public function createManualTask(AcceptanceTester $I)
 {
     $description = $this->faker->text(100);
     $I->wantTo('create a manual task');
     $I->amOnPage('/tasks/create');
     $I->seeCurrentUrlEquals('/tasks/create');
     $I->selectOption('#task_type3', 'Manual');
     $I->fillField('#description', $description);
     $I->click('Save');
     $I->seeInDatabase('tasks', ['description' => $description]);
 }
开发者ID:hannenijhuis,项目名称:invoiceninja,代码行数:11,代码来源:TaskCest.php

示例8: publishContactPageTest

 /**
  * Publish the 'Contact' page.
  *
  * @param \AcceptanceTester $I
  */
 public function publishContactPageTest(\AcceptanceTester $I)
 {
     $I->wantTo("Publish the 'Contact' page with 'templatefields' as 'manager' user");
     // Set up the browser
     $I->setCookie('bolt_authtoken', $this->cookies['bolt_authtoken']);
     $I->setCookie('bolt_session', $this->cookies['bolt_session']);
     $I->amOnPage('/bolt/editcontent/pages/3');
     $I->see('This is the contact text');
     $I->selectOption('#statusselect', 'published');
     $I->click('Save', '#savecontinuebutton');
     $I->see('The changes to this Page have been saved.');
 }
开发者ID:aaleksu,项目名称:bolt_cm,代码行数:17,代码来源:BackendManagerCest.php

示例9: tryToTransferFundsBetweenMembers

 public function tryToTransferFundsBetweenMembers(AcceptanceTester $I)
 {
     $I->am('ewallet member');
     $I->wantTo('pay a debt');
     $I->lookForwardTo('transfer funds to my friend');
     $I->amOnPage(TransferFundsPage::$formPage);
     $I->selectOption(TransferFundsPage::$toMember, 'Luis Montealegre');
     $I->fillField(TransferFundsPage::$amount, 5);
     $I->click(TransferFundsPage::$transfer);
     $I->seeCurrentUrlMatches('/' . TransferFundsPage::$transferPage . '/');
     $I->seeElement(TransferFundsPage::$successMessage);
 }
开发者ID:zoek1,项目名称:php-testing-tools,代码行数:12,代码来源:TransferFundsCest.php

示例10: 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

示例11: editInvoice

 public function editInvoice(AcceptanceTester $I)
 {
     $I->wantTo('edit an invoice');
     // Check all language files
     $count = $I->grabNumRecords('date_formats');
     for ($i = 1; $i <= $count; $i++) {
         $format = $I->grabFromDatabase('date_formats', 'format', ['id' => $i]);
         $date = mktime(0, 0, 0, 12, 31, date('Y'));
         $value = date($format, $date);
         $I->amOnPage('/settings/localization');
         $I->selectOption('date_format_id', $value);
         $I->click('Save');
         //change po_number with random number
         $I->amOnPage('/invoices/1/edit');
         $po_number = rand(100, 300);
         $I->fillField('#po_number', $po_number);
         //save
         $I->executeJS('submitAction()');
         $I->wait(1);
         //check if po_number was updated
         $I->seeInDatabase('invoices', ['po_number' => $po_number, 'invoice_date' => date('Y-m-d')]);
     }
 }
开发者ID:rafaelsisweb,项目名称:invoice-ninja,代码行数:23,代码来源:InvoiceCest.php

示例12: stepSettings

 protected function stepSettings(AcceptanceTester $I, $settings = [])
 {
     $I->seeInCurrentUrl('/wp-admin/?page=wpem&step=settings');
     $I->canSeeSetting('wpem_started', 1);
     $I->canSeeSetting('wpem_last_viewed', 'settings');
     $I->canSee('Settings');
     Debug::debug('Filling out settings ...');
     foreach ($settings as $setting) {
         switch ($setting['type']) {
             case 'select':
                 $I->selectOption('#' . $setting['key'], $setting['value']);
                 break;
             case 'input':
                 $I->fillField('#' . $setting['key'], $setting['value']);
                 break;
         }
     }
     $I->click(self::PRIMARY_BUTTON);
     Debug::debug('Installing plugins ...');
     $I->waitForElementNotVisible('.wpem-step-2 form', 90);
     foreach ($settings as $setting) {
         $I->canSeeSetting($setting['key'], $setting['value']);
     }
 }
开发者ID:fritzdenim,项目名称:pangMoves,代码行数:24,代码来源:UserTestCest.php

示例13: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('get log sample page');
$I->amOnPage('/learn-zf2-log');
$I->see('Zend\\Log sample usage');
$I->fillField("logmessage", "xyzxyzxyz");
$I->selectOption('logformat', 'xml');
$I->selectOption('logpriority', 0);
$I->click(".btn-primary");
$I->see("<priority>0</priority><priorityName>EMERG</priorityName><message>xyzxyzxyz</message>");
开发者ID:jkhaled,项目名称:LearnZF2,代码行数:11,代码来源:IndexCept.php

示例14: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->am('the administrator');
$I->wantTo('CRUD widgets');
$I->login_admin();
// Categories
$I->wantTo('create a widget');
$I->amOnPage('/oc-panel/widget');
$I->click('Create');
$I->selectOption('placeholder', 'sidebar');
$I->click('Save changes');
// See on default theme
$I->amOnPage('/');
$I->seeElement('.col-md-3.col-sm-12.col-xs-12');
// See on splash theme
$I->activate_theme('splash');
$I->amOnPage('/');
$I->seeElement('.col-md-3.col-sm-12.col-xs-12');
// See on moderndeluxe3 theme
$I->activate_theme('moderndeluxe');
$I->amOnPage('/');
$I->seeElement('.col-md-3.col-sm-12.col-xs-12');
// See on olson theme
$I->activate_theme('olson');
$I->amOnPage('/all');
$I->seeElement('.col-md-3.col-sm-12.col-xs-12');
// See on reclassifieds3 theme
$I->activate_theme('reclassifieds');
$I->amOnPage('/');
$I->seeElement('.col-md-3.col-sm-12.col-xs-12');
开发者ID:kotsios5,项目名称:openclassifieds2,代码行数:31,代码来源:CRUDWidgetCept.php

示例15: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('see descriptive error if my card is declined');
$I->amOnPage('/');
$I->fillField('amount', '800');
$I->waitForElement('#WP_checkoutBox', 5);
$I->executeJS('WebPay.testMode = true');
$I->click('カードで支払う');
$I->fillField('#WP_cardNumber', '4242 4242 4242 4242');
$I->selectOption('#WP_expMonth', '12');
$I->selectOption('#WP_expYear', '19');
$I->fillField('#WP_name', 'TEST TEST');
$I->fillField('#WP_cvc', '123');
// エラーレスポンスを返す
$I->pushMockResponse(402, ['error' => ['message' => 'このカードでは取引をする事が出来ません。利用出来ない理由をご契約中のカード会社へお問い合わせるか、他のカードをご利用ください。', 'caused_by' => 'buyer', 'type' => 'card_error', 'code' => 'card_declined']]);
$I->click('#WP_sendButton');
$I->see('Status is:402');
$I->see('Type is:card_error');
$I->see('Code is:card_declined');
$I->see('Message is:このカードでは取引をする事が出来ません。利用出来ない理由をご契約中のカード会社へお問い合わせるか、他のカードをご利用ください。');
开发者ID:webpay,项目名称:codeception-and-webpay,代码行数:21,代码来源:ChargeFailedCept.php


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