/** * 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); }
public function seeHomepage(\AcceptanceTester $I) { $I->wantTo('See the homepage'); $I->lookForwardTo('See the homepage correctly'); $I->see('Welcome to Eternal Deztiny'); $I->see('About us'); $I->see('Recruiting Criteria'); $I->see('Clan Dynamics'); $I->see('What are you waiting for? Apply!'); }
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 doFindTable(\AcceptanceTester $I) { $I->amGoingTo('find a table in the selected restaurant'); $I->lookForwardTo('reserve a reservation time slot'); $I->amOnPage('/reservation'); $I->seeElement('.panel-find-table'); $I->selectOption('location', 'Lewisham'); $I->selectOption('guest_num', '4'); $I->fillField('reserve_date', date('d-m-Y', strtotime('+ 1 month', time()))); $I->fillField('reserve_time', '2:45 PM'); $I->click('Find Table', '#find-table-form'); $I->expect('success with available reservation times slot displayed'); $I->seeElement('.panel-time-slots'); $I->seeNumberOfElements('#time-slots .btn-group > .btn', 5); // 5 elements $I->click('#time-slots .btn-group > .btn:nth-child(4)'); $I->click('Select Time', '#find-table-form'); $I->expectTo('see the reservation summary'); $I->seeElement('.panel-summary'); }
<?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');
<?php $I = new AcceptanceTester($scenario); $I->am('a visitor'); $I->amGoingTo('visit and view a single ad'); $I->lookForwardTo('some details'); $I->amOnPage('/'); $I->click("//a[@href='http://reoc.lo/all']"); $I->click("//a[@class='pull-left']"); $I->see('send message'); $I->dontsee('listings');
<?php $I = new AcceptanceTester($scenario); $I->am('a visitor'); $I->amGoingTo('register as a user that already exists'); $I->lookForwardTo('see the error message after trying to register'); $I->amOnPage('/oc-panel/auth/register'); $I->fillField('name', 'user'); $I->fillField(".register input[name='email']", '*****@*****.**'); $I->fillField('password1', 'user'); $I->fillField('password2', 'user'); $I->click(".register button[type=submit]"); $I->expectTo('see success message'); $I->see('welcome'); $I->amOnPage('/'); $I->click('Logout'); $I->amGoingTo('register as a user that already exists'); $I->lookForwardTo('see the error message after trying to register'); $I->amOnPage('/oc-panel/auth/register'); $I->fillField('name', 'Jermain Doe'); $I->fillField(".register input[name='email']", '*****@*****.**'); $I->fillField('password1', '1234'); $I->fillField('password2', '1234'); $I->click(".register button[type=submit]"); $I->expectTo('see error message'); $I->see('User already exists'); $I->amGoingTo('register without filling Name field'); $I->fillField('name', ''); $I->fillField(".register input[name='email']", '*****@*****.**'); $I->fillField('password1', '123456'); $I->fillField('password2', '123456');
<?php //Before that test it's important import the example file "import_ads_example.csv" $I = new AcceptanceTester($scenario); $I->am('a visitor'); $I->wantTo('search from the search page'); // Search for non existing Ad $I->lookForwardTo('see the message "Your search did not match any advertisement."'); $I->amOnPage('/search.html'); $I->see('Advanced Search'); $I->fillField('title', 'not exists'); $I->click("submit"); $I->see('Your search did not match any advertisement.'); // Browse by category $I->lookForwardTo('see the ad with title "another great title"'); $I->amOnPage('/search.html'); $I->see('Advanced Search'); $I->selectOption('form select[name=category]', 'House'); $I->click("submit"); $I->see('another great title'); $I->dontSee('nice'); // included in the title of another ad which must not be displayed $I->dontSee('just'); // included in the title of another ad which must not be displayed // Browse by location $I->lookForwardTo('see the ad with title "another great title"'); $I->amOnPage('/search.html'); $I->see('Advanced Search'); $I->selectOption('form select[name=location]', 'London'); $I->click("submit"); $I->see('another great title');
<?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'); //edit profile on dropdown menu $I->wantTo('1) see the profile edit page, 2) change my name, my email and add a description, 3) change my passwd, 4) upload a profile pic, 5) See those changes on public profile'); // 1) $I->wantTo('1) see the profile edit page'); $I->lookForwardTo('see "Edit Profile" header'); $I->click("a[href='http://reoc.lo/oc-panel/profile/edit']"); $I->see('edit profile', 'h3'); $I->dontSee('homepage'); $I->dontSee('my advertisements', 'h1'); $I->seeInCurrentUrl('/profile/edit'); // 2) $I->wantTo('2) change my name, my email and add a description'); $I->lookForwardTo('see a successful message'); $I->fillField('#name', 'user'); $I->fillField("#email", '*****@*****.**'); $I->fillField("#description", 'Hello!!!'); $I->click("button[type=submit]"); $I->see('You have successfully changed your data'); //repeat 2) $I->wantTo('2) change my name, my email and remove description'); $I->lookForwardTo('see a successful message'); $I->fillField('#name', 'Gary Doe'); $I->fillField("#email", '*****@*****.**');
<?php $I = new AcceptanceTester($scenario); $I->am("a visitor"); $I->wantTo('visit pages on the top menu'); $I->wantTo('visit homepage'); $I->lookForwardTo('see the keyword "homepage"'); $I->amOnPage('/'); $I->see('Listing'); $I->see('Categories'); $I->see('Login'); $I->see('Publish New'); $I->wantTo('visit listings page'); $I->lookForwardTo('see the title "Listings"'); $I->click("//a[@href='http://reoc.lo/all']"); $I->see("Listings", "h1"); $I->click("//a[@href='http://reoc.lo/']"); $I->wantTo('visit search page'); $I->lookForwardTo('see the keyword "search"'); $I->click("//a[@href='http://reoc.lo/search.html']"); $I->see("Search"); $I->click("//a[@href='http://reoc.lo/']"); $I->wantTo('visit contact page'); $I->lookForwardTo('see the keyword "contact"'); $I->click("//a[@href='http://reoc.lo/contact.html']"); $I->see("Contact Us"); $I->click("//a[@href='http://reoc.lo/']"); $I->wantTo('visit subcategory page from the dropdown menu'); $I->lookForwardTo('see the keywords "Apartments, flats, monthly rentals, ...."'); $I->click("//a[@class='dropdown-toggle']"); $I->click("//a[@href='http://reoc.lo/apartment']");
<?php $I = new AcceptanceTester($scenario); $I->am('administrator'); $I->wantTo('Test CSV import'); $I->activate_tec(); $I->lookForwardTo('Seeing them events, organizers, and venues in the database'); // Upload Organizer $I->upload_csv('organizers', 'csv-test-organizers.csv'); // Go to the organizers page $I->amOnPage('/wp-admin/edit.php?post_type=tribe_organizer'); // make sure page loaded successfully $I->cantSee('Cheatin'); $I->click('George-Michael Bluth'); $I->seeInField('post_title', 'George-Michael Bluth'); $I->seeInField('#OrganizerPhone', '+1-987-555-1238'); $I->seeInField('#OrganizerWebsite', 'http://fakeblock.com'); $I->seeInField('#OrganizerEmail', '*****@*****.**'); // Upload Venues $I->upload_csv('venues', 'csv-test-venues.csv'); $I->amOnPage('/wp-admin/edit.php?post_type=tribe_venue'); // make sure page loaded successfully $I->cantSee('Cheatin'); $I->click('Soup Kitchen International'); $I->seeInField('post_title', 'Soup Kitchen International'); $I->seeInField('venue[Address]', '259-A West 55th Street'); $I->seeInField('venue[City]', 'New York'); //$I->seeOptionIsSelected( 'venue[Country]', 'United States' ); //hidden using Chosen - build helper //$I->seeOptionIsSelected( 'venue[State]', 'New York' ); //hidden using Chosen - build helper $I->seeInField('venue[Zip]', '10019'); $I->seeInField('venue[Phone]', '+1 (800) 555-8234');
<?php /** * ownCloud - galleryplus * * 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\Acceptance\Login; use Page\Gallery as GalleryPage; $I = new AcceptanceTester($scenario); $I->am('a standard user'); $I->wantTo('load the Gallery+ app'); $I->lookForwardTo('seeing my holiday pictures'); $loginPage = new Login($I); $loginPage->login('admin', 'admin'); $loginPage->confirmLogin(); $I->click('.menutoggle'); $I->click('Gallery+', '#navigation'); $I->seeCurrentUrlEquals(GalleryPage::$URL); $I->seeElement(GalleryPage::$contentDiv);
<?php use Codeception\Util\Locator; $I = new AcceptanceTester($scenario); $I->am('Any user'); $I->wantTo('do a login on the web application'); $I->lookForwardTo('access all features that my access level grant'); $I->amOnPage('/'); $I->fillField(Locator::combine('//*[@data-qa="auth-login"]', '//input[@data-qa="auth-login"]'), '*****@*****.**'); $I->fillField(['xpath' => '//*[@data-qa="auth-pass"]'], 'socialbase'); $I->click(['xpath' => '//button[@data-qa="auth-button"]']); $I->see('SB Suporte', ['xpath' => '//div[@data-qa="profile-my-name"]']); $I->see('CARGO', ['xpath' => '//div[@data-qa="profile-my-job"]']);
<?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"');
<?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); // 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');