示例#1
0
 public function installJoomla(\AcceptanceTester $I)
 {
     $I->am('Administrator');
     $I->installJoomlaRemovingInstallationFolder();
     $I->doAdministratorLogin();
     $I->setErrorReportingToDevelopment();
 }
示例#2
0
 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');
 }
 /**
  * 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
0
 public function _before(\AcceptanceTester $I)
 {
     $I->am('guest user');
     $I->amGoingTo('Load the homepage');
     $I->amOnPage('/');
     $I->seeInCurrentUrl('/');
 }
示例#5
0
 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
0
 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();
 }
 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);
 }
 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', '*****@*****.**');
     $I->fillField('password', '1234');
     $I->click('Login');
     $I->seeCurrentUrlEquals('/admin');
     $I->see('Admin Area', 'h1');
 }
 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
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');
 }
 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
0
<?php

/**
 * ownCloud - gallery
 *
 * This file is licensed under the Affero General Public License version 3 or
 * later. See the COPYING file.
 *
 * @author Olivier Paroz <*****@*****.**>
 *
 * @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
0
<?php

$I = new AcceptanceTester($scenario);
//login as a user
$I->amOnPage('/oc-panel/auth/login');
$I->fillField('email', '*****@*****.**');
$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
0
 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
0
<?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');
<?php

$I = new AcceptanceTester($scenario);
$I->am('Registered User');
$I->wantTo('View my Orders');
$I->amLoggedAs($I->siteUser());
$I->amOnPage('/user/dashboard');
$I->click('View Orders');
$I->seeCurrentUrlEquals('/user/orders');
$I->see('User Orders');
$I->see('Address');
<?php

$I = new AcceptanceTester($scenario);
$I->am("the admin");
$I->wantTo('change configurations and see changes on frontend');
$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');
// Address
$I->amOnPage('/oc-panel/Config/update/address');
$I->fillField('#formorm_config_value', '0');
$I->click('button[type="submit"]');
$I->see('Item updated. Please to see the changes delete the cache');
//Read
$I->amOnPage('/publish-new.html');
$I->dontSee('Address', 'label');
$I->dontSeeElement('input', ['name' => 'address']);
// Back to default
$I->amOnPage('/oc-panel/Config/update/address');
$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('/publish-new.html');
$I->see('Address', 'label');
$I->seeElement('input', ['name' => 'address']);
// Phone
$I->amOnPage('/oc-panel/Config/update/phone');
$I->fillField('#formorm_config_value', '0');
<?php

$I = new AcceptanceTester($scenario);
$I->am('Registered Site User');
$I->wantTo('Add an Address to my Profile');
$I->amLoggedAs($I->siteUser());
$I->amOnPage('/user/addresses');
$I->click('Add Address');
$I->seeCurrentUrlEquals('/user/addresses/add');
$I->fillField('street_number', '36');
$I->fillField('street_name', 'McGhie Avenue');
$I->fillField('suburb', 'Rhodene');
$I->fillField('city', 'Masvingo');
$I->fillField('province', 'Masvingo');
$I->fillField('postal_code', '9999');
$I->click('Add Address');
$I->seeCurrentUrlEquals('/user/addresses');
$I->see('New Address Saved');
<?php

// @group: settings
$I = new AcceptanceTester($scenario);
$I->am('administrator');
$I->wantTo('verify that TEC Single Event Slug Setting');
$I->activate_tec();
$I->set_pretty_permalinks();
// Create new Event
$I->createEvent(array('title' => 'Sample Event'));
// Navigate to new Event
// Verify Event is at default URL
$I->amOnPage('/event/sample-event');
$I->see('Sample Event');
// Change Event URL
$I->amOnPage('/wp-admin/edit.php?post_type=tribe_events&page=tribe-common');
$I->fillField('singleEventSlug', 'box');
$I->click('Save Changes');
// Verify Event is at new URL.
$I->amOnPage('/box/sample-event');
$I->see('Sample Event');
// Change the slug back
$I->amOnPage('/wp-admin/edit.php?post_type=tribe_events&page=tribe-common');
$I->fillField('singleEventSlug', 'event');
$I->click('Save Changes');
<?php

$I = new AcceptanceTester($scenario);
$I->am('Site Administrator');
$I->wantTo('View all products');
$I->amLoggedAs($I->aSiteAdministrator());
$I->amOnPage('/admin/dashboard');
$I->click('Products');
$I->seeCurrentUrlEquals('/admin/products');
$I->see('Products Administration');
示例#21
0
<?php

$I = new AcceptanceTester($scenario);
$I->am('Website Visitor');
$I->wantTo('ensure that frontpage loads without errors');
$I->amGoingTo('go to the homepage');
$I->lookForwardTo('logging in');
$I->amOnPage('/');
$I->seeElement('input[type=username]');
$I->seeElement('input[type=password]');
<?php

$I = new AcceptanceTester($scenario);
$I->am('Unregistered User');
$I->wantTo('Register as a Site Administrator');
$I->amOnPage('/admin/register');
$I->see('Register');
$I->fillField('name', 'Bradshaw Matikinye');
$I->fillField('email', '*****@*****.**');
$I->fillField('password', 'bradshaw');
$I->fillField('password_confirmation', 'bradshaw');
$I->click('register_admin');
$I->seeCurrentUrlEquals('/admin/dashboard');
$I->see('Admin Dashboard');
<?php

$I = new AcceptanceTester($scenario);
$I->am('Google Bot');
$I->wantTo('Test XML Sitemaps');
$I->expectTo('see the sitemap in robots.txt');
$I->sendGET('/robots.txt');
$I->seeResponseContains('Sitemap:');
$I->seeResponseContains('/sitemap.xml');
$I->seeResponseContains('/sitemapindex.xml');
$I->expectTo('see an XML sitemap index');
$I->sendGET('/sitemapindex.xml');
$I->seeResponseCodeIs(200);
$I->haveHttpHeader('Content-Type', 'application/xml; charset=utf-8');
$I->seeResponseIsXml();
$I->dontSee('<b>Notice</b>');
$I->dontSee('error');
$I->expectTo('see a brief XML sitemap');
$I->sendGET('/sitemap.xml');
$I->seeResponseCodeIs(200);
$I->seeResponseIsXml();
$I->haveHttpHeader('Content-Type', 'application/xml; charset=utf-8');
$I->seeResponseContains('<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"');
$I->dontSee('<b>Notice</b>');
// error sometimes thrown if Wordpress timezone not set
$I->dontSee('error');
$I->expectTo('see a paginated XML sitemap');
$I->sendGET('/sitemap.xml?page=1');
$I->seeResponseCodeIs(200);
$I->seeResponseIsXml();
$I->haveHttpHeader('Content-Type', 'application/xml; charset=utf-8');
 public function administratorCreateWeblinkWithoutTitleFails(AcceptanceTester $I)
 {
     $I->am('Administrator');
     $I->wantToTest('Weblink creation without title fails in /administrator/');
     $I->doAdministratorLogin();
     $I->amGoingTo('Navigate to Weblinks page in /administrator/');
     $I->amOnPage('administrator/index.php?option=com_weblinks');
     $I->waitForText('Web Links', '30', ['css' => 'h1']);
     $I->expectTo('see weblinks page');
     $I->checkForPhpNoticesOrWarnings();
     $I->amGoingTo('try to save a weblink with empty title and it should fail');
     $I->click(['xpath' => "//button[@onclick=\"Joomla.submitbutton('weblink.add')\"]"]);
     $I->waitForText('Web Link: New', '30', ['css' => 'h1']);
     $I->click(['xpath' => "//button[@onclick=\"Joomla.submitbutton('weblink.apply')\"]"]);
     $I->expectTo('see an error when trying to save a weblink without title and without URL');
     $I->see('Invalid field:  Title', ['id' => 'system-message-container']);
     $I->see('Invalid field:  URL', ['id' => 'system-message-container']);
 }
<?php

$I = new AcceptanceTester($scenario);
$I->am('a visitor');
$I->wantTo('publish a new ad');
$I->amOnPage('publish-new.html');
$I->see('Publish new advertisement', 'h1');
$I->fillField('#title', 'New ad');
$I->click('.select-category');
$I->fillField('category', '18');
$I->fillField('location', '4');
$I->fillField('#description', 'This is a new ad');
$I->attachFile('input[type="file"]', 'photo.jpg');
$I->fillField('#phone', '99885522');
$I->fillField('#address', 'barcelona');
$I->fillField('#price', '25');
$I->fillField('#website', 'https://www.google.com');
$I->fillField('#name', 'David');
$I->fillField('#email', '*****@*****.**');
$I->click('submit_btn');
$I->see('Advertisement is posted. Congratulations!');
$I->amOnPage('/apartment/new-ad.html');
$I->see('New ad', 'h1');
$I->see('25.00', 'span');
$I->see('Phone: 99885522', 'a');
$I->see('This is a new ad');
$I->see('Barcelona');
$I->seeElement('a', ['href' => 'http://reoc.lo/user/david']);
$I->seeElement('a', ['href' => 'https://www.google.com']);
// Check if user has created
$I->amOnPage('/user/david');
<?php

$I = new AcceptanceTester($scenario);
$I->am('Guest Site User');
$I->wantTo('View a Product\'s Details Page');
$I->amOnPage('/');
$I->click('View');
$I->seeInCurrentUrl('/product/details/');
$I->see('Product Description');
$I->see('Checkout');
$I->see('Add To Cart');
<?php

$I = new AcceptanceTester($scenario);
$I->am('a user');
$I->wantTo('publish a new ad');
$I->login_admin();
$I->activate_theme('newspaper');
$I->click('Logout');
$I->amOnPage('/oc-panel/auth/login');
$I->fillField('email', '*****@*****.**');
$I->fillField('password', '1234');
$I->click('auth_redirect');
$I->amOnPage('/publish-new.html');
$I->see('Publish new advertisement');
$I->fillField('#title', "User ad on newspaper");
$I->click('.select-category');
$I->fillField('category', '18');
$I->fillField('location', '4');
$I->fillField('#description', 'This is a new user ad on newspaper theme');
$I->attachFile('input[type="file"]', 'photo.jpg');
$I->fillField('#phone', '99885522');
$I->fillField('#address', 'barcelona');
$I->fillField('#price', '25');
$I->fillField('#website', 'https://www.user.com');
$I->click('submit_btn');
$I->see('Advertisement is posted. Congratulations!');
$I->amOnPage('/apartment/user-ad-on-newspaper.html');
$I->see('User ad on newspaper');
$I->see('This is a new user ad on newspaper theme');
$I->see('Barcelona');
$I->click('Logout');
<?php

$I = new AcceptanceTester($scenario);
// Login successfully as the administrator
$I->am('the Administrator');
$I->wantTo('log in with valid account');
$I->lookForwardTo('see the welcome message in the Panel');
$I->login_admin();
$I->wantTo('change the landing page to LISTING');
$I->amOnPage('/oc-panel/Config/update/landing_page');
$I->fillField('#formorm_config_value', '{"controller":"ad","action":"listing"}');
$I->click("button[type='submit']");
//click save
$I->amOnPage('/');
$I->see('Listings', 'h1');
$I->amOnPage('/oc-panel/Config/update/landing_page');
$I->fillField('#formorm_config_value', '{"controller":"home","action":"index"}');
$I->click("button[type='submit']");
//click save
$I->amOnPage('/');
$I->see('Categories', 'h3');
$I->dontSee('Listings', 'h1');
$I->amOnPage('/');
$I->click('Logout');
<?php

$I = new AcceptanceTester($scenario);
$I->am('the administrator');
$I->wantTo('publish a new ad');
$I->login_admin();
$I->activate_theme('basecamp');
$I->amOnPage('/publish-new.html');
$I->see('Publish new advertisement', 'h3');
$I->fillField('#title', "Admin ad basecamp theme");
$I->click('.select-category');
$I->fillField('category', '18');
$I->fillField('location', '57');
$I->fillField('#description', 'This is a new admin ad on basecamp theme');
$I->attachFile('input[id="fileInput0"]', 'photo.jpg');
$I->fillField('#phone', '99885522');
$I->fillField('#address', 'barcelona');
$I->fillField('#price', '25');
$I->fillField('#website', 'https://www.admin.com');
$I->click('submit_btn');
$I->see('Advertisement is posted. Congratulations!');
$I->amOnPage('/apartment/admin-ad-basecamp-theme.html');
$I->see('Admin ad basecamp theme');
$I->see('This is a new admin ad on basecamp theme');
$I->see('Barcelona');
$I->activate_theme('default');
$I->click('Logout');
示例#30
0
<?php

$I = new AcceptanceTester($scenario);
// Login successfully as the administrator
$I->am('the Administrator');
$I->wantTo('log in with valid account');
$I->lookForwardTo('see the welcome message in the Panel');
$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');
//Logout before trying to login again, also test if logout button works
$I->wantTo('log out and try to login again');
$I->click('Logout');
// Login successfully as a normal user
$I->am('a user');
$I->wantTo('log in with valid account');
$I->lookForwardTo('see anything else but the login button');
$I->amOnPage('/oc-panel/auth/login');
$I->fillField('email', '*****@*****.**');
$I->fillField('password', '1234');
$I->click('auth_redirect');
$I->see('my profile');
$I->See('My Advertisements');
$I->wantTo('log out and try to login again');
$I->click('Logout');
//Logout before trying to login again
// Try to login using invalid passwd
$I->wantTo('try to log in with invalid password');