示例#1
0
 /**
  * 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);
 }
 /**
  * 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);
 }
示例#3
0
 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');
 }
示例#4
0
 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}");
 }
示例#5
0
 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)");
 }
示例#6
0
 /**
  * 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');
 }
示例#7
0
 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]);
 }
示例#8
0
 /**
  * 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.');
 }
 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);
 }
示例#10
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');
 }
示例#11
0
 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')]);
     }
 }
示例#12
0
 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']);
     }
 }
示例#13
0
<?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>");
<?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');
<?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:このカードでは取引をする事が出来ません。利用出来ない理由をご契約中のカード会社へお問い合わせるか、他のカードをご利用ください。');
<?php

$I = new AcceptanceTester($scenario);
$I->am('the administrator');
$I->wantTo('crud a custom field');
$I->amOnPage('/oc-panel/auth/login');
$I->fillField('email', '*****@*****.**');
$I->fillField('password', '1234');
$I->click('auth_redirect');
$I->see('welcome admin');
$I->amOnPage('/oc-panel/fields/new');
$I->see('New Custom Field');
$I->fillField('name', 'My Custom Field');
$I->fillField('label', 'My Custom Field');
$I->fillField('tooltip', 'Test field for testing');
$I->selectOption('form select[name="type"]', 'string');
$I->checkOption('required');
$I->checkOption('searchable');
$I->checkOption('show_listing');
$I->click('button[type="submit"]');
$I->see('Field my_custom_field 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->amOnPage('/oc-panel/Config/update/theme');
$I->fillField('#formorm_config_value','splash');
$I->click('button[type="submit"]');
$I->see('Item updated. Please to see the changes delete the cache');
$I->see('Homepage site slogan');
$I->amOnPage('/oc-panel/theme/options');
$I->fillField('#home_slogan', 'Search and place ads easily with open classifieds');
$I->click('submit');
$I->see('Theme configuration updated');
$I->amOnPage('/');
$I->see('Search and place ads easily with open classifieds');
$I->wantTo('activate Reclassifieds3 theme');
$I->amOnPage('/oc-panel/Config/update/theme');
$I->fillField('#formorm_config_value', 'reclassifieds3');
$I->click('button[type="submit"]');
$I->see('Item updated. Please to see the changes delete the cache');
$I->amOnPage('/housing');
$I->seeElement('.breadcrumb');
$I->amOnPage('/oc-panel/theme/options');
$I->selectOption('breadcrumb', '0');
$I->click('submit');
$I->see('Theme configuration updated');
$I->amOnPage('/housing');
$I->dontSeeElement('.breadcrumb');
$I->amOnPage('/oc-panel/theme/options');
$I->selectOption('breadcrumb', '1');
$I->click('submit');
$I->see('Theme configuration updated');
$I->amOnPage('/housing');
$I->seeElement('.breadcrumb');
$I->wantTo('activate Newspaper theme');
$I->amOnPage('/oc-panel/Config/update/theme');
$I->fillField('#formorm_config_value', 'newspaper');
$I->click('button[type="submit"]');
$I->see('Item updated. Please to see the changes delete the cache');
示例#18
0
<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('crud a widget');
$I->amOnPage('/oc-panel/auth/login');
$I->fillField('email', '*****@*****.**');
$I->fillField('password', '1234');
$I->click('auth_redirect');
$I->amOnPage('/oc-panel');
$I->see('Welcome admin');
// CREATE WIDGET
$I->amOnPage('/oc-panel/widget/index');
$I->click('//button[@data-target="#modal_Widget_Search"]');
$I->selectOption('placeholder', 'sidebar');
$I->fillField('#text_title', 'Search Widget');
$I->selectOption('advanced', '1');
$I->click('Save changes');
$I->seeElement('.alert.alert-success');
$I->see('Widget created in sidebar');
// READ
// On default theme
$I->amOnPage('/');
$I->seeElement('.panel.panel-sidebar.Widget_Search');
$I->see('Search Widget', 'h3');
$I->see('Product Title', 'label');
$I->see('Categories', 'label');
$I->see('Price from', 'label');
$I->see('Price to', 'label');
$I->seeElement('input', ['name' => 'title']);
$I->seeElement('select', ['name' => 'category']);
$I->seeElement('input', ['name' => 'price-min']);
$I->fillField('#feed_elements', '2');
$I->click('submit');
// Read
$I->amOnPage('/rss.xml');
$I->dontSee('another great title');
// Back to default
$I->amOnPage('/oc-panel/settings/form');
$I->fillField('#feed_elements', '20');
$I->click('submit');
$I->amOnPage('/rss.xml');
$I->see('another great title');
// Sort by in Listing
// Name (A-Z)
$I->amOnPage('/oc-panel/settings/form');
$I->fillField('#advertisements_per_page', '1');
$I->selectOption('#sort_by', 'Name (A-Z)');
$I->click('submit');
// Read
$I->amOnPage('/all');
$I->seeElement('.pagination');
//$I->see('another great title');  maybe another ad will be here from other test (publish new)
$I->dontSee('just random title here');
$I->dontSee('some nice title here');
$I->dontSee('title for the ad');
// Name (Z-A)
$I->amOnPage('/oc-panel/settings/form');
$I->selectOption('#sort_by', 'Name (Z-A)');
$I->click('submit');
// Read
$I->amOnPage('/all');
$I->seeElement('.pagination');
$I->see('Homepage site slogan');
$I->amOnPage('/oc-panel/theme/options');
$I->fillField('#home_slogan', 'Search and place ads easily with open classifieds');
$I->click('submit');
$I->see('Theme configuration updated');
$I->amOnPage('/');
$I->see('Search and place ads easily with open classifieds');
$I->wantTo('activate Reclassifieds3 theme');
$I->amOnPage('/oc-panel/Config/update/theme');
$I->fillField('#formorm_config_value', 'reclassifieds3');
$I->click('button[type="submit"]');
$I->see('Item updated. Please to see the changes delete the cache');
$I->amOnPage('/housing');
$I->seeElement('.breadcrumb');
$I->amOnPage('/oc-panel/theme/options');
$I->selectOption('breadcrumb', '0');
$I->click('submit');
$I->see('Theme configuration updated');
$I->amOnPage('/housing');
$I->dontSeeElement('.breadcrumb');
$I->amOnPage('/oc-panel/theme/options');
$I->selectOption('breadcrumb', '1');
$I->click('submit');
$I->see('Theme configuration updated');
$I->amOnPage('/housing');
$I->seeElement('.breadcrumb');
// See on responsive theme
$I->amOnPage('/oc-panel/Config/update/theme');
$I->fillField('#formorm_config_value', 'responsive3');
$I->click('button[type="submit"]');
$I->see('Item updated. Please to see the changes delete the cache');
示例#21
0
<?php

$I = new AcceptanceTester($scenario);
$I->am('Site Administrator');
$I->wantTo('Add a new Product');
$I->amLoggedAs($I->aSiteAdministrator());
$I->amOnPage('/admin/products');
$I->click('Add Product');
$I->seeCurrentUrlEquals('/admin/products/create');
$category = \App\Repositories\Category::get()->toArray();
$I->selectOption('category', $category[0]['id']);
$I->fillField('name', 'Malt Liquor');
$I->fillField('description', 'Malt Liquor for you to describe');
$I->fillField('price', '34.00');
$I->fillField('quantity', '150');
$I->selectOption('status', '1');
$I->attachFile('image', 'roundrect8537796.gif');
$I->click('Create Product');
$I->seeCurrentUrlEquals('/admin/products');
$I->see('New Product: Malt Liquor Created');
示例#22
0
 private function createPost(\AcceptanceTester $I)
 {
     codecept_debug('createPost');
     $I->amOnPage('/');
     //button click
     //$I->waitForElement('#share-look .btn', 10);
     //$I->click('#share-look .btn');
     $I->waitForElement('.glyphicon-edit', 10);
     $I->click('.glyphicon-edit');
     $I->waitForElement('form[role="share-look"]', 10);
     //$I->attachFile('input[type="file"]', 'ryankim.png');
     $I->fillfield('input[name="item-name[0]"]', 'bag');
     $I->fillfield('input[name="item-store[0]"]', 'zara');
     $I->selectOption('select[name="item-rating[0]"]', 'Excellent');
     $I->wait(1);
     $I->click('form[role="share-look"] .btn-primary');
     $I->waitForElement('.list-group', 10);
     $href = $I->grabAttributeFrom('.list-group a:first-child', 'href');
     $temp = explode('/', $href);
     $this->post_id = $temp[count($temp) - 1];
     $I->amOnPage('/post/' . $this->post_id);
     $I->waitForElement('#postgroup-link', 10);
     $href = $I->grabAttributeFrom('#postgroup-link', 'href');
     $temp = explode('/', $href);
     $this->user_slug = $temp['3'];
     $this->postgroup_slug = $temp['5'];
 }
<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('add a new address field with custom options.');
$I->login('tester', 'test');
$I->amOnPage('/wp/wp-admin/post.php?post=4&action=edit');
$I->click('+ Add Field');
$I->fillField('.field-label', 'acf address custom test field');
$I->selectOption('form select.field-type', 'address');
$I->wait(2);
$I->seeElement('.acf-address-1-row');
$I->wantTo('make changes to the default address settings.');
// has the form ${obj.id}-${widgetCount}
$I->uncheckOption('#street2-1');
$I->wait(1);
// has the form ${obj.id}-li-movable-${widgetCount}
$I->dontSeeElement('#street2-li-movable-1');
$I->click('#publish');
$I->see('Field group updated.');
$I->wantTo('make sure my changes were persisted.');
$I->dontSeeCheckboxIsChecked('#street2-1');
$I->dontSeeElement('#street2-li-movable-1');
示例#24
0
 /**
  * Create a contact page with templatefields
  *
  * @param \AcceptanceTester $I
  */
 public function checkTemplateFieldsTest(\AcceptanceTester $I)
 {
     $I->wantTo('Create a contact page with templatefields');
     // Set up the browser
     $I->setCookie($this->tokenNames['authtoken'], $this->cookies[$this->tokenNames['authtoken']]);
     $I->setCookie($this->tokenNames['session'], $this->cookies[$this->tokenNames['session']]);
     $I->amOnPage('bolt');
     $I->see('New Page');
     $I->click('New Page');
     $I->fillField('#title', 'Contact Page');
     $I->fillField('#slug', 'contact');
     $I->selectOption('#template', 'extrafields.twig');
     $I->click('Save Page', '#savecontinuebutton');
     $I->see('The new Page has been saved.');
     $I->click('CONTACT PAGE');
     // Page has been saved, fill templatefields
     $I->see('Template', 'a[data-toggle=tab]');
     $I->fillField('#templatefields-section_1', 'This is the contact text');
     $I->click('Save Page');
     $I->click('CONTACT PAGE');
     /*
      * In v2.0.13 Codeception made the awesome decision to refactor their
      * PHP Browser code — in a patch release no less — and it doesn't
      * properly handle URL queries parameters in POSTs. For now we'll just
      * pretend that seeing the data is good enough…
      */
     $I->see('This is the contact text');
     //         $I->seeInField('#templatefields-section_1', 'This is the contact text');
 }
示例#25
0
$admin->does(function (AcceptanceTester $I) {
    $steps = new AcceptanceTester\AdminSteps($I);
    $steps->registerWebPayModule();
});
$I->amOnPage('/products/list.php');
$I->click('おなべ');
$I->click('カゴに入れる');
$I->click('購入手続きへ');
$I->click('購入手続きへ');
$I->fillField('order_name01', 'テスト');
$I->fillField('order_name02', 'テスト');
$I->fillField('order_kana01', 'テスト');
$I->fillField('order_kana02', 'テスト');
$I->fillField('order_zip01', '100');
$I->fillField('order_zip02', '0001');
$I->selectOption('select[name=order_pref]', '北海道');
$I->fillField('order_addr01', '札幌市');
$I->fillField('order_addr02', '123');
$I->fillField('order_tel01', '00');
$I->fillField('order_tel02', '0000');
$I->fillField('order_tel03', '0000');
$I->fillField('order_email', '*****@*****.**');
$I->fillField('order_email02', '*****@*****.**');
$I->click('input[name="order_sex"][value="1"]');
$I->click('上記のお届け先のみに送る');
$I->click('input[name="payment_id"][value="5"]');
$I->click('次へ');
$I->click('次へ');
$I->waitForElement('#WP_checkoutBox', 5);
$I->executeJS('WebPay.testMode = true');
$I->see('クレジットカード決済');
示例#26
0
// Edit admin name and add description
$I->amOnPage('/oc-panel/profile/edit');
$I->fillField('#name', 'administrator');
$I->fillField('#description', 'administrator description');
$I->click("//form[contains(@action,'http://eshop.lo/oc-panel/profile/edit')]/div/div/button[@type='submit']");
$I->seeElement('.alert.alert-success');
$I->see('You have successfuly changed your data');
$I->amOnPage('/oc-panel/profile/edit');
$I->fillField('#name', 'admin');
$I->fillField('#description', '');
$I->click("//form[contains(@action,'http://eshop.lo/oc-panel/profile/edit')]/div/div/button[@type='submit']");
$I->seeElement('.alert.alert-success');
$I->see('You have successfuly changed your data');
// Edit Billing Info
$I->amOnPage('/oc-panel/profile/edit');
$I->selectOption('country', 'CK');
$I->fillField('city', 'kitchen');
$I->click("//form[contains(@action,'http://eshop.lo/oc-panel/profile/billing')]/div/div/button[@type='submit']");
$I->see('Billing information changed');
$I->seeElement('.alert.alert-success');
$I->amOnPage('/oc-panel/profile/edit');
$I->fillField('city', '');
$I->click("//form[contains(@action,'http://eshop.lo/oc-panel/profile/billing')]/div/div/button[@type='submit']");
$I->see('Billing information changed');
$I->seeElement('.alert.alert-success');
// Change password
$I->amOnPage('/oc-panel/profile/edit');
$I->fillField('password1', '4321');
$I->fillField('password2', '4321');
$I->click("//form[contains(@action,'http://eshop.lo/oc-panel/profile/changepass')]/div/div/button[@type='submit']");
$I->seeElement('.alert.alert-success');
$I->am('the administrator');
$I->wantTo('enable search_multi_catloc');
$I->amOnPage('/oc-panel/auth/login');
$I->fillField('email', '*****@*****.**');
$I->fillField('password', '1234');
$I->click('auth_redirect');
$I->amOnPage('/oc-panel/');
$I->see('welcome admin');
// search_multi_catloc
$I->amOnPage('/oc-panel/Config/update/search_multi_catloc');
$I->fillField('#formorm_config_value', '1');
$I->click('button[type="submit"]');
$I->see('Item updated. Please to see the changes delete the cache');
$I->amOnPage('/search.html');
$I->see('Search', 'h1');
$I->selectOption('form select[id=category]', array('Jobs', 'House'));
$I->click("submit");
$I->see('title for the ad', 'a');
$I->see('just random title here', 'a');
$I->see('another great title', 'a');
$I->see('some nice title here', 'a');
$I->amOnPage('/search.html');
$I->see('Search', 'h1');
$I->selectOption('form select[id=location]', array('London', 'Madrid'));
$I->click("submit");
$I->dontSee('title for the ad', 'a');
$I->dontSee('just random title here', 'a');
$I->see('another great title', 'a');
$I->see('some nice title here', 'a');
$I->amOnPage('/oc-panel/Config/update/search_multi_catloc');
$I->fillField('#formorm_config_value', '0');
$I->amOnPage('/');
$I->click('Logout');
// TRANSLATOR
$I->amOnPage('/oc-panel/auth/login');
$I->fillField('email', '*****@*****.**');
$I->fillField('password', '1234');
$I->click('auth_redirect');
$I->amOnPage('/oc-panel/');
$I->see('welcome admin');
$I->amOnPage('/oc-panel/Role/update/5');
$I->unCheckOption('translations|*');
$I->unCheckOption('content|*');
$I->click('submit');
$I->see('Item updated');
$I->amOnPage('/oc-panel/User/update/4');
$I->selectOption('formorm[id_role]', '5');
$I->click('formorm[submit]');
$I->see('Item updated. Please to see the changes delete the cache');
$I->amOnPage('/');
$I->click('Logout');
//login as translator
$I->amOnPage('/oc-panel/auth/login');
$I->fillField('email', '*****@*****.**');
$I->fillField('password', '1234');
$I->click('auth_redirect');
$I->amOnPage('/oc-panel/translations');
$I->seeElement('.alert.alert-danger');
$I->see('You do not have permissions to access Translations index');
$I->dontSee('Translations', 'h1');
$I->dontSee('Translations files available in the system.', 'p');
$I->amOnPage('/oc-panel/content/email');
$I->amOnPage('/oc-panel/Config/update/map_pub_new');
$I->fillField('#formorm_config_value', '0');
$I->click('button[type="submit"]');
$I->see('Item updated. Please to see the changes delete the cache');
$I->amOnPage('/publish-new.html');
$I->dontSeeElement('.popin-map-container');
// Terms of Service
// Create new page first
$I->amOnPage('/oc-panel/content/create?type=page');
$I->fillField('#title', 'Terms of Service');
$I->fillField('#description', 'Terms of Service');
$I->checkOption('status');
$I->click('submit');
$I->see('page is created. Please to see the changes delete the cache');
$I->amOnPage('/oc-panel/settings/form');
$I->selectOption('#tos', 'Terms of Service');
$I->click('submit');
// Read
$I->amOnPage('/publish-new.html');
$I->see('Terms of Service', 'a');
$I->seeElement('input', ['name' => 'tos']);
// Back to default
$I->amOnPage('/oc-panel/settings/form');
$I->selectOption('#tos', '');
$I->click('submit');
$I->amOnPage('/oc-panel/content/page');
$I->click('.btn.btn-danger.index-delete');
$I->amOnPage('/oc-panel/tools/cache?force=1');
// Delete cache ALL
$I->amOnPage('/publish-new.html');
$I->dontSee('Terms of Service', 'a');
 public function onlinePayment(AcceptanceTester $I)
 {
     $I->wantTo('test an online payment');
     $clientEmail = $this->faker->safeEmail;
     $productKey = $this->faker->text(10);
     // set gateway info
     $I->wantTo('create a gateway');
     $I->amOnPage('/settings/online_payments');
     if (strpos($I->grabFromCurrentUrl(), 'create') !== false) {
         $I->fillField(['name' => '23_apiKey'], env('stripe_secret_key') ?: Fixtures::get('stripe_secret_key'));
         // Fails to load StripeJS causing "ReferenceError: Can't find variable: Stripe"
         //$I->fillField(['name' =>'stripe_publishable_key'], env('stripe_secret_key') ?: Fixtures::get('stripe_publishable_key'));
         $I->selectOption('#token_billing_type_id', 4);
         $I->click('Save');
         $I->see('Successfully created gateway');
     }
     // create client
     $I->amOnPage('/clients/create');
     $I->fillField(['name' => 'contacts[0][email]'], $clientEmail);
     $I->click('Save');
     $I->see($clientEmail);
     // create product
     $I->amOnPage('/products/create');
     $I->fillField(['name' => 'product_key'], $productKey);
     $I->fillField(['name' => 'notes'], $this->faker->text(80));
     $I->fillField(['name' => 'cost'], $this->faker->numberBetween(1, 20));
     $I->click('Save');
     $I->wait(1);
     $I->see($productKey);
     // 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->click('table.invoice-table tbody tr:nth-child(1) .tt-selectable');
     $I->click('Save');
     $I->see($clientEmail);
     // enter payment
     $clientId = $I->grabFromDatabase('contacts', 'client_id', ['email' => $clientEmail]);
     $invoiceId = $I->grabFromDatabase('invoices', 'id', ['client_id' => $clientId]);
     $invitationKey = $I->grabFromDatabase('invitations', 'invitation_key', ['invoice_id' => $invoiceId]);
     $clientSession = $I->haveFriend('client');
     $clientSession->does(function (AcceptanceTester $I) use($invitationKey) {
         $I->amOnPage('/view/' . $invitationKey);
         $I->click('Pay Now');
         /*
         $I->fillField(['name' => 'first_name'], $this->faker->firstName);
         $I->fillField(['name' => 'last_name'], $this->faker->lastName);
         $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('#card_number', '4242424242424242');
         $I->fillField('#cvv', '1234');
         $I->selectOption('#expiration_month', 12);
         $I->selectOption('#expiration_year', date('Y'));
         $I->click('.btn-success');
         $I->wait(3);
         $I->see('Successfully applied payment');
     });
     $I->wait(1);
     // create recurring invoice and auto-bill
     $I->amOnPage('/recurring_invoices/create');
     $I->selectDropdown($I, $clientEmail, '.client_select .dropdown-toggle');
     $I->fillField('table.invoice-table tbody tr:nth-child(1) #product_key', $productKey);
     $I->click('table.invoice-table tbody tr:nth-child(1) .tt-selectable');
     $I->checkOption('#auto_bill');
     $I->executeJS('preparePdfData(\'email\')');
     $I->wait(3);
     $I->see("\$0.00");
 }