本文整理汇总了PHP中AcceptanceTester::checkOption方法的典型用法代码示例。如果您正苦于以下问题:PHP AcceptanceTester::checkOption方法的具体用法?PHP AcceptanceTester::checkOption怎么用?PHP AcceptanceTester::checkOption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AcceptanceTester
的用法示例。
在下文中一共展示了AcceptanceTester::checkOption方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _before
public function _before(AcceptanceTester $I)
{
$I->wantTo('Install WPML');
$I->loginAsAdmin();
$I->amGoingTo('Activate WPML Plugins');
$I->amOnPluginsPage();
//In order that the activatePlugin() works, the webdriver needs to be in Plugins page
$I->activatePlugin('wpml-multilingual-cms');
$I->amGoingTo('Configure WPML');
$I->click('No thanks, I will configure myself');
$I->click('Next');
//Let's English as Default language
$I->checkOption('Greek');
$I->wait(1);
$I->click('Next');
$I->wait(5);
$I->checkOption('form input[name=icl_lang_sel_footer]');
$I->waitForElement(".button-primary", 15);
$I->wait(1);
$I->click('Next');
$I->wait(3);
$I->waitForElement(".button-primary", 15);
$I->click('Remind me later');
$I->wait(5);
$I->click('Finish');
}
示例2: _before
public function _before(AcceptanceTester $I)
{
$I->wantTo('Install and Configure WC');
$I->loginAsAdmin();
//Only if Run this test Seperately
$I->amGoingTo('Activate Woocommerce Plugin');
$I->amOnPluginsPage();
//In order that the activatePlugin() works, the webdriver needs to be in Plugins page
$I->activatePlugin('woocommerce');
$I->amGoingTo('Run Woocommerce Setup');
$I->waitForElement(".button-primary", 20);
$I->click("Let's Go!");
$I->waitForElement(".button-primary", 15);
$I->click("Continue");
$I->wait(1);
$I->click("Continue");
$I->wait(1);
$I->click("Continue");
$I->wait(1);
$I->checkOption('#woocommerce_enable_cod');
$I->click("Continue");
$I->waitForElement(".button-secondary", 15);
$I->click("No thanks");
$I->wait(1);
$I->click("Return to the WordPress Dashboard");
}
示例3: 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}");
}
示例4: deleteNewsTickConfirmation
/**
* @depends deleteNewsNoTickConfirmation
*/
public function deleteNewsTickConfirmation(AcceptanceTester $I)
{
$I->logInAsAnAdmin();
$I->amOnListNews();
$I->click('Edit');
$I->waitForText('Edit news item');
$I->seeInCurrentUrl('/edit_news');
$I->checkOption('#delete_confirmation');
$I->click('Delete news item');
$I->seeInCurrentUrl('/list_news');
$I->dontSee('Edit');
}
示例5: signUpAndGoPro
public function signUpAndGoPro(AcceptanceTester $I)
{
$userEmail = $this->faker->safeEmail;
$userPassword = $this->faker->password;
$I->wantTo('test purchasing a pro plan');
$I->amOnPage('/invoice_now');
$I->click('Sign Up');
$I->wait(1);
$I->checkOption('#terms_checkbox');
$I->fillField(['name' => 'new_first_name'], $this->faker->firstName);
$I->fillField(['name' => 'new_last_name'], $this->faker->lastName);
$I->fillField(['name' => 'new_email'], $userEmail);
$I->fillField(['name' => 'new_password'], $userPassword);
$I->click('Save');
$I->wait(1);
$I->amOnPage('/dashboard');
$I->click('Upgrade');
$I->wait(1);
$I->click('#changePlanButton');
$I->wait(1);
$I->click('Pay Now');
$I->wait(1);
$I->fillField(['name' => 'address1'], $this->faker->streetAddress);
$I->fillField(['name' => 'address2'], $this->faker->streetAddress);
$I->fillField(['name' => 'city'], $this->faker->city);
$I->fillField(['name' => 'state'], $this->faker->state);
$I->fillField(['name' => 'postal_code'], $this->faker->postcode);
$I->selectDropdown($I, 'United States', '.country-select .dropdown-toggle');
$I->fillField(['name' => 'card_number'], '4242424242424242');
$I->fillField(['name' => 'cvv'], '1234');
$I->selectOption('#expiration_month', 12);
$I->selectOption('#expiration_year', date('Y'));
$I->click('.btn-success');
$I->wait(1);
$I->see('Successfully applied payment');
$I->amOnPage('/dashboard');
$I->dontSee('Go Pro');
}
示例6: AcceptanceTester
<?php
$I = new AcceptanceTester($scenario);
$I->wantTo('Create user roles for emarking and reserva de salas');
$I->login('admin', 'pepito.P0', 'Admin User');
// Rol Biblioteca
$I->amOnPage('admin/roles/define.php?action=add&lang=en');
$I->click('submitbutton');
$I->fillField('shortname', 'biblioteca');
$I->fillField('name', 'Biblioteca');
$I->checkOption('#cl10');
$I->checkOption('(//input[@name="local/reservasalas:advancesearch"])[2]');
$I->checkOption('(//input[@name="local/reservasalas:blocking"])[2]');
$I->checkOption('(//input[@name="local/reservasalas:bockinginfo"])[2]');
$I->checkOption('(//input[@name="local/reservasalas:libreryrules"])[2]');
$I->checkOption('(//input[@name="local/reservasalas:overwrite"])[2]');
$I->click('savechanges');
示例7:
*/
$I->click('Tilføj ny plante');
/*
* He now gets redirected to the creation page "create-new-plant".
*/
$I->seeInCurrentUrl('add-new-plant');
/*
* Here he fills out the form.
* Its a very special plant so he fills out all the information about the plant,
* he even checks all the checkboxes.
*/
$I->fillField('#name', 'Test plant');
$I->fillField('#name_latin', 'Test plant latin');
$I->fillField('#description', 'Test description of a test plant');
$I->fillField('#history', 'Test history of a test plant');
$I->checkOption('spring');
$I->checkOption('summer');
$I->checkOption('autumn');
$I->checkOption('winter');
$I->checkOption('10');
// does not get tested
$I->checkOption('10-25');
$I->checkOption('25-40');
$I->checkOption('40-50');
$I->checkOption('50-75');
$I->checkOption('75-100');
$I->checkOption('100');
// does not get testec
$I->checkOption('red');
$I->checkOption('yellow');
$I->checkOption('blue');
示例8: deleteCategoryTickConfirmation
/**
* @depends deleteCategoryNoTickConfirmation
*/
public function deleteCategoryTickConfirmation(AcceptanceTester $I)
{
$I->logInAsAnAdmin();
$I->makeCategoryAvailable(CI_EDITABLE_CATEGORY_ID);
$I->amOnEditCategory(CI_EDITABLE_CATEGORY_ID);
$title = $I->grabValueFrom('title');
$I->amOnAdminHome();
$I->see($title);
$I->amOnPage('/challenges');
$I->see($title);
$I->amOnPage('/scores');
$I->see($title);
$I->amOnEditCategory(CI_EDITABLE_CATEGORY_ID);
$I->checkOption('#delete_confirmation');
$I->click('Delete category');
$I->amOnAdminHome();
$I->dontSee($title);
$I->amOnPage('/challenges');
$I->dontSee($title);
$I->amOnPage('/scores');
$I->dontSee($title);
$I->amOnEditCategory(CI_EDITABLE_CATEGORY_ID);
$I->see('Error');
$I->see('No category found with this ID');
}
示例9: createDeveloperTest
/**
* Create a 'developer' user with the 'developer' role
*
* @param \AcceptanceTester $I
*/
public function createDeveloperTest(\AcceptanceTester $I)
{
$I->wantTo("Create a 'developer' user");
// Set up the browser
$I->setCookie('bolt_authtoken', $this->cookies['bolt_authtoken']);
$I->setCookie('bolt_session', $this->cookies['bolt_session']);
$I->amOnPage('/bolt/users');
$I->click('Add a new user', Locator::href('/bolt/users/edit/'));
$I->see('Create a new user account');
// Fill in form
$I->fillField('form[username]', $this->user['developer']['username']);
$I->fillField('form[password]', $this->user['developer']['password']);
$I->fillField('form[password_confirmation]', $this->user['developer']['password']);
$I->fillField('form[email]', $this->user['developer']['email']);
$I->fillField('form[displayname]', $this->user['developer']['displayname']);
// Add the "developer" role
$I->checkOption('#form_roles_3');
// Submit
$I->click('input[type=submit]');
// Save is successful?
$I->see("User {$this->user['developer']['displayname']} has been saved");
}
示例10: AcceptanceTester
<?php
$I = new AcceptanceTester($scenario);
$I->wantTo('crud a page');
$I->login_admin();
// CREATE PAGE
$I->amOnPage('/oc-panel/content/create?type=page');
$I->see('Create Page', 'h1');
$I->fillField('#title', 'About');
$I->fillField('#description', 'All about us!!');
$I->fillField('#seotitle', 'about');
$I->checkOption('status');
$I->click('submit');
$I->seeElement('.alert.alert-success');
$I->see('Success');
// READ PAGE
$I->amOnPage('/about.html');
$I->see('About', 'h1');
$I->see('All about us!!');
// UPDATE PAGE
$I->amOnPage('/oc-panel/content/edit/13');
$I->see('Edit Page', 'h1');
$I->fillField('#title', 'About Us');
$I->fillField('#description', 'All you need to know about us!!');
$I->fillField('#seotitle', 'about-us');
$I->click('submit');
$I->seeElement('.alert.alert-success');
$I->see('page is edited');
// read updated page
$I->amOnPage('/about-us.html');
$I->see('About Us', 'h1');
示例11:
$I->see('Category created');
// Read 1
$I->amOnPage('/delete-category-one');
$I->dontSee('Page not found');
$I->see('Category to delete one', 'h1');
// Create 2
$I->amOnPage('/oc-panel/category/create');
$I->see('New Category');
$I->fillField('#formorm_name', 'Category to delete two');
$I->fillField('#formorm_seoname', 'delete-category-two');
$I->fillField('#formorm_description', 'Category to delete two');
$I->click('button[type="submit"]');
$I->see('Category created');
// Read 2
$I->amOnPage('/delete-category-two');
$I->dontSee('Page not found');
$I->see('Category to delete two', 'h1');
$I->amOnPage('/oc-panel/Category');
$I->checkOption('input[value="27"]');
$I->checkOption('input[value="28"]');
$I->click('delete');
$I->seeElement('.alert.alert-success');
$I->see('Category Category to delete one deleted');
$I->see('Category Category to delete two deleted');
// Read 1
$I->amOnPage('/delete-category-one');
$I->dontSee('Category to delete one', 'h1');
// Read 2
$I->amOnPage('/delete-category-two');
$I->dontSee('Category to delete two', 'h1');
$I->click('Logout');
示例12: CreateDelivery
/**
* Create Delivery with specified parrameters
*
* (array) $pay -string only if you transmit one payment method))
* if you wont to skip some field type null
* if you want to select several Payment methods transmit array
*
* @param string $name Delivery name type off to skip
* @param sting $active Active Checkbox on - enabled| off - disabled
* @param string $description Method description type off to skip
* @param string $descriptionprice Method price description type off to skip
* @param int|float|string $price Delivery price type off to skip
* @param int|float|string $freefrom Delivery free from type off to skip
* @param string $message Delivery sum specified message type off to skip
* @param string|array $pay Pass array or srting - Payment methods "_" - delimiter for few methods
* @return void
*/
protected function CreateDelivery(AcceptanceTester $I, $name = null, $active = null, $description = null, $descriptionprice = null, $price = null, $freefrom = null, $message = null, $pay = null)
{
$I->amOnPage('/admin/components/run/shop/deliverymethods/create');
if (isset($name)) {
$I->fillField(DeliveryCreatePage::$FieldName, $name);
}
if (isset($active)) {
$I->checkOption(DeliveryCreatePage::$CheckboxActive);
}
if (isset($description)) {
$I->fillField(DeliveryCreatePage::$FieldDescription, $description);
}
if (isset($descriptionprice)) {
$I->fillField(DeliveryCreatePage::$FieldDescriptionPrice, $descriptionprice);
}
if (isset($price)) {
$I->fillField(DeliveryCreatePage::$FieldPrice, $price);
}
if (isset($freefrom)) {
$I->fillField(DeliveryCreatePage::$FieldFreeFrom, $freefrom);
}
if (isset($message)) {
$I->checkOption(DeliveryCreatePage::$CheckboxPriceSpecified);
$I->fillField(DeliveryCreatePage::$FieldPriceSpecified, $message);
}
if (isset($pay)) {
foreach ((array) $pay as $value) {
$I->click($value);
}
}
$I->click(DeliveryCreatePage::$ButtonCreate);
$I->wait("3");
}
示例13: AcceptanceTester
<?php
$I = new AcceptanceTester($scenario);
$I->wantTo('Config SMS');
$I->login('admin', 'pepito.P0', 'Admin User');
$I->amOnPage('/admin/settings.php?section=modsettingemarking');
// Basic Config
$I->fillField('s__emarking_printsuccessinstructions', 'Mensaje de prueba');
$I->selectOption('#id_s__emarking_minimumdaysbeforeprinting', '2');
// Advanced Config
$I->fillField('s__emarking_parallelregex', '[0-9]+-[SV]-([0-9A-Z]+)-.*');
// Config SMS
$I->fillField('s__emarking_smsurl', 'http://api2.infobip.com/api/sendsms/xml');
$I->fillField('s__emarking_smsuser', 'UAI');
$I->fillField('s__emarking_smspassword', 'pepito.P0');
// Config Experimental
$I->checkOption('#id_s__emarking_enablejustice');
$I->checkOption('#id_s__emarking_justiceexperiment');
$I->checkOption('#id_s__emarking_enableprinting');
$I->fillField('s__emarking_printername', 'Mensaje de prueba');
$I->click('Save changes');
示例14: AcceptanceTester
<?php
$I = new AcceptanceTester($scenario);
$I->am('the administrator');
$I->wantTo('crud a user custom field');
$I->login_admin();
$I->amOnPage('/oc-panel/userfields/new');
$I->see('New Custom Field', 'h1');
$I->fillField('name', 'telephone');
$I->fillField('label', 'telephone');
$I->fillField('tooltip', 'telephone');
$I->selectOption('form select[name="type"]', 'integer');
$I->checkOption('required');
$I->checkOption('searchable');
$I->checkOption('show_register');
$I->checkOption('show_profile');
$I->click('button[type="submit"]');
$I->see('Field telephone created');
$I->seeElement('.drag-item');
// delete all cache
$I->amOnPage('/oc-panel/tools/cache?force=1');
$I->see('All cache deleted');
// activate a premium theme to see the custom field!
$I->activate_theme('splash');
// delete all cache
$I->amOnPage('/oc-panel/tools/cache?force=1');
$I->see('All cache deleted');
// Not able to see my custom field from the test
// but it's displayed on http://reoc.lo/publish-new.html (Maybe an issue with PhpBrowser)
$I->amOnPage('/');
$I->click('Logout');
示例15:
public function systeminfo_セキュリティ管理SSL(\AcceptanceTester $I)
{
$I->wantTo('EA0804-UC01-T04 セキュリティ管理 - SSL強制');
$testConfig = Fixtures::get('test_config');
$I->amOnUrl('http://' . $testConfig['hostname'] . '/');
$I->assertRegExp('/^http:\\/\\//', $I->executeJS('return location.href'), 'httpsにリダイレクトされない');
$config = Fixtures::get('config');
$I->amOnUrl('https://' . $testConfig['hostname'] . '/' . $config['admin_route'] . '/setting/system/security');
$I->checkOption(['id' => 'admin_security_force_ssl']);
$I->click('#aside_column div div div div div button');
// httpでアクセスしたらhttpsにリダイレクトされる
$I->amOnUrl('http://' . $testConfig['hostname'] . '/');
$I->assertRegExp('/^https:\\/\\//', $I->executeJS('return location.href'), 'httpsにリダイレクトされる');
// 後続テストのために戻しておく
$I->amOnUrl('https://' . $testConfig['hostname'] . '/' . $config['admin_route'] . '/setting/system/security');
$I->uncheckOption(['id' => 'admin_security_force_ssl']);
$I->click('#aside_column div div div div div button');
}