本文整理汇总了PHP中AcceptanceTester::am方法的典型用法代码示例。如果您正苦于以下问题:PHP AcceptanceTester::am方法的具体用法?PHP AcceptanceTester::am怎么用?PHP AcceptanceTester::am使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AcceptanceTester
的用法示例。
在下文中一共展示了AcceptanceTester::am方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: installJoomla
public function installJoomla(\AcceptanceTester $I)
{
$I->am('Administrator');
$I->installJoomlaRemovingInstallationFolder();
$I->doAdministratorLogin();
$I->setErrorReportingToDevelopment();
}
示例2: testIfICantCreateAnEventWithoutBeingAuthenticated
public function testIfICantCreateAnEventWithoutBeingAuthenticated(AcceptanceTester $I)
{
$I->am('guest');
$I->wantTo('see that i can\'t create an event');
$I->amOnPage('event/create');
$I->canSee('have to be logged in', '.alert-danger');
}
示例3: 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);
}
示例4: _before
public function _before(\AcceptanceTester $I)
{
$I->am('guest user');
$I->amGoingTo('Load the homepage');
$I->amOnPage('/');
$I->seeInCurrentUrl('/');
}
示例5: 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');
}
示例6: installNeno
public function installNeno(AcceptanceTester $I)
{
$I->maximizeWindow();
$I->am('Administrator');
$I->installJoomla();
$I->doAdministratorLogin();
$I->setErrorReportingToDevelopment();
$I->amOnPage("/administrator/");
$I->click("Extensions");
$I->click("Extension Manager");
$I->click("Upload Package File");
$path = $I->getConfiguration('repo_folder');
// Installing library
$I->installExtensionFromDirectory($path . 'lib_neno');
// Installing Plugin
$I->installExtensionFromDirectory($path . 'plg_system_neno');
// Installing Component
$I->installExtensionFromDirectory($path . 'com_neno');
// Enabling plugin
$I->enablePlugin('Neno plugin');
// Going to Neno
$I->click("Components");
$I->wait(1);
$I->click("Neno Translate");
$I->wait(1);
// Get started Screen
$I->click('Get Started');
$I->waitForJS('return jQuery.active == 0', 5);
$I->wait(1);
// First step - Source language
$I->see('Next');
$I->click(['xpath' => "//button[@type=\"button\"]"]);
$I->wait(1);
// Second step - Translation methods
$I->click('Next');
$I->waitForJS('return jQuery.active == 0', 5);
// Third step- Install language(s)
$I->wait(1);
$I->click("//*[@id=\"add-languages-button\"]");
$I->waitForJS("return jQuery.active == 0", 5);
$I->waitForElementVisible(['class' => 'ar-AA'], 5);
$I->wait(1);
$I->click(['class' => 'ar-AA']);
$I->see('Close', ['class' => 'close-button']);
$I->click(['class' => 'close-button'], ['xpath' => "//*[@id=\"languages-modal\"]"]);
$I->click(['xpath' => "(//button[@type=\"button\"])[4]"]);
// Fourth step- Installing Neno
$I->wait(1);
$I->click("#backup-created-checkbox");
$I->click("#proceed-button");
// Fifth step- Installing Neno has been accomplish successfully
//$I->waitForJS('return jQuery.installation == 1', 1000);
$I->waitForElement(".icon-thumbs-up", 300);
$I->doAdministratorLogout();
}
示例7: 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);
}
示例8: logsInUserWithProperCredentials
public function logsInUserWithProperCredentials(AcceptanceTester $I)
{
$I->am('Site Owner');
$I->wantTo('login to a password-protected area');
$I->lookForwardTo('perform administrative tasks');
$I->amOnPage('/admin');
$I->seeCurrentUrlEquals('/login');
$I->fillField('email', 'jeffrey@envato.com');
$I->fillField('password', '1234');
$I->click('Login');
$I->seeCurrentUrlEquals('/admin');
$I->see('Admin Area', 'h1');
}
示例9: 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']);
}
示例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');
}
示例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: AcceptanceTester
<?php
/**
* ownCloud - gallery
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Olivier Paroz <owncloud@interfasys.ch>
*
* @copyright Olivier Paroz 2015
*/
use Page\Login as LoginPage;
$I = new AcceptanceTester($scenario);
$I->am('A standard user');
$I->wantTo('ensure that I can see the login page');
$I->amOnPage(LoginPage::$URL);
$I->seeElement(LoginPage::$loginButton);
示例13: AcceptanceTester
<?php
$I = new AcceptanceTester($scenario);
//login as a user
$I->amOnPage('/oc-panel/auth/login');
$I->fillField('email', 'gazzasdasd@reoc.lo');
$I->fillField('password', '1234');
$I->click('auth_redirect');
$I->am("a user");
$I->wantTo('visit pages on the user dropdown menu');
$I->wantTo('see the panel');
//green profile button
$I->lookForwardTo('see the title "my advertisements" and url contains "/myads"');
$I->click("a[href='http://reoc.lo/oc-panel']");
$I->see('my advertisements', 'h1');
$I->dontSee('homepage');
$I->seeInCurrentUrl('/myads');
$I->amOnPage('/');
//back on homepage
$I->wantTo('see the my ads');
//my advertisements on dropdown menu
$I->lookForwardTo('see the title "my advertisements" and url contains "/myads"');
$I->click("a[href='http://reoc.lo/oc-panel/myads']");
$I->see('my advertisements', 'h1');
$I->dontSee('homepage');
$I->seeInCurrentUrl('/myads');
$I->amOnPage('/');
//back on homepage
$I->wantTo('see the my favorites');
//my favorites on dropdown menu
$I->lookForwardTo('see the title "my favorites" and url contains "/profile/favorites"');
示例14: installNeno
public function installNeno(AcceptanceTester $I)
{
$I->am('Administrator');
$I->installJoomla();
$I->doAdministratorLogin();
$I->setErrorReportingToDevelopment();
$I->amOnPage("/administrator/");
$I->click("Extensions");
$I->click("Extension Manager");
$I->click("Upload Package File");
$path = $I->getConfiguration('repo_folder');
// Installing library
$I->installExtensionFromDirectory($path . 'lib_neno');
// Installing Plugin
$I->installExtensionFromDirectory($path . 'plg_system_neno');
// Installing Component
$I->installExtensionFromDirectory($path . 'com_neno');
/*
// Enabling plugin
$I->enablePlugin('Neno plugin');
// Going to Neno
$I->click("Components");
$I->click("Neno");
$I->wait(5);
// Get started Screen
$I->click('Get Started');
$I->waitForJS('return jQuery.active == 0', 20);
$I->wait(5);
// First step - Source language
$I->see('Next', 'button');
$I->click(['xpath' => "//button[@type='button']"]);
$I->waitForJS('return jQuery.active == 0', 20);
$I->wait(5);
// Second step - Translation methods
$I->see('Next');
$I->click(['xpath' => "//button[@type='button']"]);
$I->waitForJS('return jQuery.active == 0', 20);
$I->wait(5);
// Third step- Install language(s)
$I->click(['css' => "#add-languages-button"]);
$I->waitForJS('return jQuery.active == 0', 20);
$I->wait(5);
$I->waitForElementVisible(['css' => '#languages-modal']);
$I->click(['css' => "[data-language='de-DE']"]);
$I->click(['css' => "[data-language='es-ES']"]);
$I->wait(10);
$I->seeElement(['css' => ".loading-iso-de-DE"]);
$I->seeElement(['css' => ".loading-iso-es-ES"]);
$I->click("Close");
$I->click(['xpath' => "(//button[@type='button'])[4]"]);
// Fourth step- Installing Neno
$I->wait(5);
$I->click(['css' => "#backup-created-checkbox"]);
$I->click(['css' => "label.checkbox"]);
$I->click(['css' => "#proceed-button"]);
// Fifth step- Installing Neno has been accomplish successfully
$I->waitForElement("#submenu > li > a");
$I->doAdministratorLogout();*/
}
示例15: AcceptanceTester
<?php
/**
* Acceptance test for the Readorium Quiz Bowl screen.
*
* @author Andrew Lee
*/
$I = new AcceptanceTester($scenario);
// Set up
$I->loadSessionSnapshot('login');
$I->am('student');
$I->wantTo('make sure the quiz bowl screen displays correctly');
// Navigate to page and confirm things look right
$I->amOnPage('/student/quiz_bowl');
$I->seeInTitle('Rising Reader Quiz Bowl');
$I->seeElement("//input[@value = 'Earth Science']");
$I->makeScreenshot('smQuiz_bowl');
// Open page 1 and make it looks right
$I->click(['xpath' => "//input[@value = 'Earth Science']"]);
$I->makeScreenshot('snQb_page1');
// Back to Categories and check page 2
$I->click(['xpath' => "//input[@value = 'Back to Categories']"]);
// $I->makeScreenshot('oQb_page2');
// Press the back button to return to the village
$I->click(['xpath' => "//input[@value = 'Back']"]);
$I->seeInCurrentURL('/student/village');