<?php use Step\Acceptance\SiteUser; $I = new SiteUser($scenario); $I->am('Site User'); $I->wantTo('Check my shopping cart as an unauthenticated Site User'); $I->amOnPage('/'); $I->click('.add-to-cart'); $I->amOnPage('/checkout/index'); $I->seeCurrentUrlEquals('/checkout/index'); $I->click('Proceed to Checkout'); $I->seeCurrentUrlEquals('/checkout/register'); $I->click('Log Me In'); $I->seeCurrentUrlEquals('/checkout/login'); $I->amOnPage('/checkout/register'); $I->fillInRegistrationForm(); $I->proceedToPayment(); //$I->fillInLoginForm(); //$I->seeCurrentUrlEquals('/checkout/login');
<?php use Step\Acceptance\SiteUser; $I = new SiteUser($scenario); $I->am('Site User'); $I->wantTo('Check out my shopping cart as an authenticated Site User'); $I->amLoggedAs($I->siteUser()); $I->amOnPage('/'); $I->click('.add-to-cart'); $I->amOnPage('/checkout/index'); $I->seeCurrentUrlEquals('/checkout/index'); $I->click('Proceed to Checkout'); $I->proceedToPayment();
<?php use Step\Acceptance\SiteUser; $I = new SiteUser($scenario); $I->am('Unregistered User'); $I->wantTo('Register as a Site User'); $I->amOnPage('/'); $I->click('Register'); $I->seeCurrentUrlEquals('/register/user'); $I->fillInRegistrationForm(); $I->seeCurrentUrlEquals('/user/dashboard'); $I->see('Lindsay Matikinye'); $I->see('Log Out');
<?php use Step\Acceptance\SiteUser; $I = new SiteUser($scenario); $I->am('Site Administrator'); $I->wantTo('Edit an Existing Product'); $I->amLoggedAs($I->aSiteAdministrator()); $I->amOnPage('/admin/products'); $products = $I->products()->toArray(); $productName = $products[5]['name']; $productId = $products[5]['id']; $I->click($productName); $I->seeCurrentUrlEquals('/admin/products/' . $productId . '/edit'); $category = \App\Repositories\Category::get()->toArray(); $I->selectOption('category', $category[1]['id']); $I->fillField('name', 'Malt Liquors'); $I->fillField('description', 'Malt Liquors for you to describe'); $I->fillField('price', '39.00'); $I->fillField('quantity', '150'); $I->selectOption('status', '1'); $I->attachFile('image', 'roundrect8537796.gif'); $I->click('Update Product'); $I->seeCurrentUrlEquals('/admin/products'); $I->see('Product Updated');
<?php use Step\Acceptance\SiteUser; $I = new SiteUser($scenario); $I->am('Guest User'); $I->wantTo('Check out my shopping cart as a Guest user'); $I->amOnPage('/'); $I->click('.add-to-cart'); $I->amOnPage('/checkout/index'); $I->seeCurrentUrlEquals('/checkout/index'); $I->click('Proceed to Checkout'); $I->seeCurrentUrlEquals('/checkout/register'); $I->fillInRegistrationForm(); $I->proceedToPayment();