本文整理汇总了PHP中AcceptanceTester::amGoingTo方法的典型用法代码示例。如果您正苦于以下问题:PHP AcceptanceTester::amGoingTo方法的具体用法?PHP AcceptanceTester::amGoingTo怎么用?PHP AcceptanceTester::amGoingTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AcceptanceTester
的用法示例。
在下文中一共展示了AcceptanceTester::amGoingTo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _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");
}
示例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);
}
示例3: _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');
}
示例4: administratorCreateCategoryWithoutTitleFails
public function administratorCreateCategoryWithoutTitleFails(AcceptanceTester $I)
{
$I->am('Administrator');
$I->wantToTest('Category creation in /administrator/ without title fails');
$I->doAdministratorLogin();
$I->amGoingTo('Navigate to Categories page in /administrator/');
$I->amOnPage('administrator/index.php?option=com_categories&extension=com_weblinks');
$I->waitForText('Weblinks: Categories', '60', ['css' => 'h1']);
$I->expectTo('see categories page');
$I->amGoingTo('try to save a category with empty title and it should fail');
$I->clickToolbarButton('new');
$I->waitForText('Weblinks: New Category', '60', ['css' => 'h1']);
$I->clickToolbarButton('save');
$I->expectTo('see an error when trying to save a category without title');
$I->see('Invalid field: Title', ['id' => 'system-message-container']);
}
示例5: _before
public function _before(\AcceptanceTester $I)
{
$I->am('guest user');
$I->amGoingTo('Load the homepage');
$I->amOnPage('/');
$I->seeInCurrentUrl('/');
}
示例6: seeMembers
public function seeMembers(\AcceptanceTester $I)
{
$I->am('guest user');
$I->amGoingTo('Load the members section');
$I->amOnPage('/');
$I->click('Members');
$I->seeInCurrentUrl('/members');
$I->see('Name');
$I->see('Role');
}
示例7: _before
public function _before(AcceptanceTester $I)
{
$I->wantTo('Further Configure WC');
$I->loginAsAdmin();
//Only if Run this test Seperately
//////////////////////
$I->amGoingTo('Configure the Selling Country');
$I->amOnPage('/wp-admin/admin.php?page=wc-settings');
$I->click('#select2-chosen-2');
$I->fillField('#s2id_autogen2_search', 'Αττική');
$I->click('.select2-match');
//////////////////////
$I->amGoingTo('Configure the Default Currency');
$I->click('#select2-chosen-7');
$I->fillField('#s2id_autogen7_search', 'Euro');
$I->click('.select2-result-label');
$I->click('Save changes');
//////////////////////
$I->wait(3);
}
示例8: ensureThatLoginWorks
public function ensureThatLoginWorks(AcceptanceTester $I)
{
$I->amOnPage(Url::toRoute('/user/login'));
$I->see('Login', 'h1');
$I->amGoingTo('try to login with correct credentials');
$I->fillField('input[name="LoginForm[username]"]', 'admin');
$I->fillField('input[name="LoginForm[password]"]', 'admin');
$I->click('login-button');
$I->wait(2);
// wait for button to be clicked
$I->expectTo('see user info');
$I->see('Logout');
}
示例9: register
public function register(\AcceptanceTester $I)
{
$I->amGoingTo('register');
$I->amOnPage('/auth/register');
$I->fillField('name', 'codeception');
$I->fillField('password', 'acceptance');
$I->fillField('email', 'marcel.patzwahl+cept@gmail.com');
$I->click('submit');
$I->see('Registered successfully!');
$I->seeLink('Go back to Home');
$I->click('Go back to Home');
$I->seeInCurrentUrl('/');
}
示例10: contactFormCanBeSubmitted
public function contactFormCanBeSubmitted(AcceptanceTester $I)
{
$I->amGoingTo('submit contact form with correct data');
$I->fillField('#contactform-name', 'tester');
$I->fillField('#contactform-email', 'tester@example.com');
$I->fillField('#contactform-subject', 'test subject');
$I->fillField('#contactform-body', 'test content');
$I->fillField('#contactform-verifycode', 'testme');
$I->click('contact-button');
$I->wait(2);
// wait for button to be clicked
$I->dontSeeElement('#contact-form');
$I->see('Thank you for contacting us. We will respond to you as soon as possible.');
}
示例11: administratorUnpublishCategory
public function administratorUnpublishCategory(AcceptanceTester $I)
{
$I->am('Administrator');
$I->wantToTest('Category unpublishing in /administrator/');
$I->doAdministratorLogin();
$I->amGoingTo('Navigate to Categories page in /administrator/');
$I->amOnPage('administrator/index.php?option=com_categories&extension=com_weblinks');
$I->waitForText('Weblinks: Categories', '30', ['css' => 'h1']);
$I->expectTo('see categories page');
$I->checkForPhpNoticesOrWarnings();
$I->amGoingTo('try to save a category with a filled title');
$I->click(['xpath' => "//button[@onclick=\"Joomla.submitbutton('category.add')\"]"]);
$I->waitForText('Category Manager: Add A New Weblinks Category', '30', ['css' => 'h1']);
$I->fillField(['id' => 'jform_title'], 'automated testing unpub' . rand(1, 100));
$I->click(['xpath' => "//button[@onclick=\"Joomla.submitbutton('category.save')\"]"]);
$I->expectTo('see a success message after saving the category');
$I->see('Category successfully saved', ['id' => 'system-message-container']);
$I->amGoingTo('Search for automated testing');
$I->fillField(['xpath' => "//input[@id=\"filter_search\"]"], "automated testing unpub" . "\n");
$I->waitForText('Weblinks: Categories', '30', ['css' => 'h1']);
$I->amGoingTo('Select the first weblink');
$I->click(['xpath' => "//input[@id=\"cb0\"]"]);
$I->amGoingTo('Try to publish a weblink category');
$I->click(['xpath' => "//button[@onclick=\"if (document.adminForm.boxchecked.value==0){alert('Please first make a selection from the list.');}else{ Joomla.submitbutton('categories.publish')}\"]"]);
$I->waitForText('Weblinks: Categories', '30', ['css' => 'h1']);
$I->expectTo('See a success message after publishing the category');
$I->see('1 category successfully published.', ['id' => 'system-message-container']);
// Unpublish it again
$I->waitForText('Weblinks: Categories', '30', ['css' => 'h1']);
$I->amGoingTo('Select the first weblink');
$I->click(['xpath' => "//input[@id=\"cb0\"]"]);
$I->amGoingTo('Try to unpublish a weblink category');
$I->click(['xpath' => "//button[@onclick=\"if (document.adminForm.boxchecked.value==0){alert('Please first make a selection from the list.');}else{ Joomla.submitbutton('categories.unpublish')}\"]"]);
$I->waitForText('Weblinks: Categories', '30', ['css' => 'h1']);
$I->expectTo('See a success message after unpublishing the category');
$I->see('1 category successfully unpublished', ['id' => 'system-message-container']);
}
示例12: _before
public function _before(AcceptanceTester $I)
{
$I->wantTo('Enable the ST, TM, MT Plugins');
$I->loginAsAdmin();
//Only if Run this test Seperately
$I->amGoingTo('ST, TM, Media');
$I->amOnPluginsPage();
//In order that the activatePlugin() works, the webdriver needs to be in Plugins page
$I->activatePlugin('wpml-string-translation');
$I->wait(1);
$I->activatePlugin('wpml-translation-management');
$I->wait(1);
$I->activatePlugin('wpml-media');
//to be checked because it shows error
}
示例13: initializeCmcSettings
/**
* @depends installCmc
*/
public function initializeCmcSettings(\AcceptanceTester $I)
{
$I->doAdministratorLogin();
$I->comment('Mailchimp API Key from acceptance.suite.yml (see _support/AcceptanceHelper.php)');
$key = $I->getConfiguration('api_key');
$I->amGoingTo('Navigate to CMC page in /administrator/');
$I->amOnPage('administrator/index.php?option=com_cmc&view=cpanel');
// Wait for text dashboard - wait for text not working
$I->waitForElementVisible('#ctitle');
$I->checkForPhpNoticesOrWarnings();
// Options
$I->click('Options');
$I->waitForText('Configuration', '30', ['css' => 'h1']);
$I->fillField(['id' => 'jform_api_key'], $key);
$I->click('Save & Close');
// Basck in the dashboard
$I->waitForElementVisible('#ctitle');
$I->doAdministratorLogout();
}
示例14: AcceptanceTester
<?php
/* @var $scenario Codeception\Scenario */
$I = new AcceptanceTester($scenario);
$I->wantTo('Memastikan "Employee" bekerja');
/* TESTING INDEX EMPLOYEE */
$I->amGoingTo('cek halaman daftar employee');
$I->amOnPage('employee/index');
$I->expectTo('judul halaman "Daftar Employee", dan tombol Create');
$I->see('Daftar Employee', 'h1');
$I->see('CREATE', 'a');
/* TESTING CREATE EMPLOYEE */
$I->wantTo('Memastikan "Create Employee" bekerja');
$I->amGoingTo('cek halaman create employee');
$I->amOnPage('employee/create');
$I->see('Employee', 'h1');
$I->see('SIMPAN', 'button');
$I->seeElement('input', ['name' => 'Employee[name]']);
$I->seeElement('input', ['name' => 'Employee[age]']);
$I->amGoingTo('submit form dengan data input kosong');
$I->click('button[type="submit"]');
$I->expectTo('Validasi eror muncul!');
$I->see('Name cannot be blank.');
$I->see('Age cannot be blank.');
$I->amGoingTo('submit form dengan data data');
$I->fillField('input[name="Employee[name]"]', 'Hafid');
$I->fillField('input[name="Employee[age]"]', '30');
$I->click('button[type="submit"]');
$I->expectTo('submit form berhasil');
$I->see('Data berhasil disimpan');
示例15: doCreateCustomerOrder
public function doCreateCustomerOrder(\AcceptanceTester $I)
{
$I->amGoingTo('submit an order for delivery');
$this->doRegistration($I);
$I->login('john.doe@example.com', 'pass123456');
$this->doAddMenuWithOptionToOrder($I);
$I->amOnPage('/checkout');
$I->click('#checkout .btn-group .btn:not(.active)');
$I->click('Payment');
$I->selectOption('#payment input[name=payment]', 'cod');
$I->click('Confirm', '.buttons');
$I->expectTo('see the order confirmation page');
$I->see('Thanks for shopping with us online!', 'div');
$I->see('This is a collection order.');
}