<?php

$I = new AcceptanceTester($scenario);
$I->am('the administrator');
$I->wantTo('publish a new ad');
$I->login_admin();
$I->activate_theme('moderndeluxe');
$I->amOnPage('/publish-new.html');
$I->see('Publish new advertisement');
$I->fillField('#title', "Admin ad moderndeluxe theme");
$I->click('.select-category');
$I->fillField('category', '18');
$I->fillField('location', '57');
$I->fillField('#description', 'This is a new admin ad on moderndeluxe 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-moderndeluxe-theme.html');
$I->see('Admin ad moderndeluxe theme');
$I->see('This is a new admin ad on moderndeluxe theme');
$I->see('Barcelona');
$I->activate_theme('default');
$I->click('Logout');
$I = new AcceptanceTester($scenario);
$I->am('the administrator');
$I->wantTo('CRUD widgets');
$I->login_admin();
// Categories
$I->wantTo('create a widget');
$I->amOnPage('/oc-panel/widget');
$I->click('Create');
$I->selectOption('placeholder', 'sidebar');
$I->click('Save changes');
// See on default theme
$I->amOnPage('/');
$I->seeElement('.col-md-3.col-sm-12.col-xs-12');
// See on splash theme
$I->activate_theme('splash');
$I->amOnPage('/');
$I->seeElement('.col-md-3.col-sm-12.col-xs-12');
// See on moderndeluxe3 theme
$I->activate_theme('moderndeluxe');
$I->amOnPage('/');
$I->seeElement('.col-md-3.col-sm-12.col-xs-12');
// See on olson theme
$I->activate_theme('olson');
$I->amOnPage('/all');
$I->seeElement('.col-md-3.col-sm-12.col-xs-12');
// See on reclassifieds3 theme
$I->activate_theme('reclassifieds');
$I->amOnPage('/');
$I->seeElement('.col-md-3.col-sm-12.col-xs-12');
// See on kamaleon theme
<?php

$I = new AcceptanceTester($scenario);
$I->am('a user');
$I->wantTo('publish a new ad');
$I->login_admin();
$I->activate_theme('reclassifieds');
$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 reclassifieds");
$I->click('.select-category');
$I->fillField('category', '18');
$I->fillField('location', '4');
$I->fillField('#description', 'This is a new user ad on reclassifieds 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-reclassifieds.html');
$I->see('User ad on reclassifieds');
$I->see('This is a new user ad on reclassifieds theme');
$I->see('Barcelona');
$I->click('Logout');
示例#4
0
<?php

$I = new AcceptanceTester($scenario);
$I->am('the administrator');
$I->wantTo('crud a custom field');
$I->login_admin();
// enable reviews
$I->amOnPage('/oc-panel/Config/update/reviews');
$I->fillField('#formorm_config_value', '1');
$I->click('button[type="submit"]');
$I->see('Item updated. Please to see the changes delete the cache');
// check all themes theme to premium
$I->activate_theme('splash');
$I->amOnPage('/jobs/just-random-title-here.html');
$I->see('leave a review', 'a');
$I->activate_theme('reclassifieds');
$I->amOnPage('/jobs/just-random-title-here.html');
$I->see('leave a review', 'a');
$I->activate_theme('reclassifieds');
$I->amOnPage('/jobs/just-random-title-here.html');
$I->see('leave a review', 'a');
$I->activate_theme('newspaper');
$I->amOnPage('/jobs/just-random-title-here.html');
$I->see('leave a review', 'a');
$I->activate_theme('czsale');
$I->amOnPage('/jobs/just-random-title-here.html');
$I->see('leave a review', 'a');
$I->activate_theme('ocean');
$I->amOnPage('/jobs/just-random-title-here.html');
$I->see('leave a review', 'a');
$I->activate_theme('moderndeluxe');
<?php

$I = new AcceptanceTester($scenario);
$I->am('the administrator');
$I->wantTo('publish a new ad');
$I->login_admin();
$I->activate_theme('ocean');
$I->amOnPage('/publish-new.html');
$I->see('Publish new advertisement');
$I->fillField('#title', "Admin ad ocean theme");
$I->click('.select-category');
$I->fillField('category', '18');
$I->fillField('location', '57');
$I->fillField('#description', 'This is a new admin ad on ocean 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-ocean-theme.html');
$I->see('Admin ad ocean theme');
$I->see('This is a new admin ad on ocean theme');
$I->see('Barcelona');
$I->activate_theme('default');
$I->click('Logout');
<?php

$I = new AcceptanceTester($scenario);
$I->am('the administrator');
$I->wantTo('publish a new ad');
$I->login_admin();
$I->activate_theme('mobile');
$I->amOnPage('/publish-new.html');
$I->see('Publish new advertisement');
$I->fillField('#title', "Admin ad mobile theme");
$I->selectOption('category', '18');
$I->selectOption('location', '4');
$I->fillField('#description', 'This is a new admin ad on mobile theme');
$I->fillField('#phone', '99885522');
$I->fillField('#address', 'barcelona');
$I->fillField('#price', '25');
$I->fillField('#website', 'https://www.admin.com');
$I->click('submit');
$I->see('Advertisement is posted. Congratulations!');
$I->amOnPage('/apartment/admin-ad-mobile-theme.html');
$I->see('Admin ad mobile theme');
$I->see('This is a new admin ad on mobile theme');
$I->see('Barcelona');
$I->activate_theme('default');
$I->click('Logout');
<?php

$I = new AcceptanceTester($scenario);
$I->am('a user');
$I->wantTo('publish a new ad');
$I->login_admin();
$I->activate_theme('responsive');
$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 responsive");
$I->click('.select-category');
$I->fillField('category', '18');
$I->fillField('location', '4');
$I->fillField('#description', 'This is a new user ad on responsive 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-responsive.html');
$I->see('User ad on responsive');
$I->see('This is a new user ad on responsive theme');
$I->see('Barcelona');
$I->click('Logout');
<?php

$I = new AcceptanceTester($scenario);
$I->am('the administrator');
$I->wantTo('publish a new ad');
$I->login_admin();
$I->activate_theme('olson');
$I->amOnPage('/publish-new.html');
$I->see('Publish new advertisement');
$I->fillField('#title', "Admin ad olson theme");
$I->click('.select-category');
$I->fillField('category', '18');
$I->fillField('location', '57');
$I->fillField('#description', 'This is a new admin ad on olson 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-olson-theme.html');
$I->see('Admin ad olson theme');
$I->see('This is a new admin ad on olson theme');
$I->see('Barcelona');
$I->activate_theme('default');
$I->click('Logout');
<?php

$I = new AcceptanceTester($scenario);
$I->am('the administrator');
$I->wantTo('publish a new ad');
$I->login_admin();
$I->activate_theme('splash');
$I->amOnPage('/publish-new.html');
$I->see('Publish new advertisement');
$I->fillField('#title', "Admin ad splash theme");
$I->click('.select-category');
$I->fillField('category', '18');
$I->fillField('location', '57');
$I->fillField('#description', 'This is a new admin ad on splash 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-splash-theme.html');
$I->see('Admin ad splash theme');
$I->see('This is a new admin ad on splash theme');
$I->see('Barcelona');
$I->activate_theme('default');
$I->click('Logout');
<?php

$I = new AcceptanceTester($scenario);
$I->am('a visitor');
$I->wantTo('publish a new ad');
$I->login_admin();
$I->activate_theme('kamaleon');
$I->click('Logout');
$I->amOnPage('/publish-new.html');
$I->see('Publish new advertisement');
$I->fillField('#title', 'New ad unregister kamaleon');
$I->click('.select-category');
$I->fillField('category', '18');
$I->fillField('location', '4');
$I->fillField('#description', 'This is a new ad from unregister user on the kamaleon 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.google.com');
$I->fillField('#name', 'David');
$I->fillField('#email', '*****@*****.**');
$I->click('submit_btn');
$I->see('Advertisement is posted. Congratulations!');
$I->amOnPage('/apartment/new-ad-unregister-kamaleon.html');
$I->see('New ad unregister kamaleon');
$I->see('This is a new ad from unregister user on the kamaleon theme');
$I->see('Barcelona');
// Check if user has created
$I->amOnPage('/user/david');
$I->dontSee('Page not found');
<?php

$I = new AcceptanceTester($scenario);
$I->am('a user');
$I->wantTo('publish a new ad');
$I->login_admin();
$I->activate_theme('jobdrop');
$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 jobdrop");
$I->click('.select-category');
$I->fillField('category', '18');
$I->fillField('location', '4');
$I->fillField('#description', 'This is a new user ad on jobdrop 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-jobdrop.html');
$I->see('User ad on jobdrop');
$I->see('This is a new user ad on jobdrop theme');
$I->see('Barcelona');
$I->click('Logout');
$I->see('Item updated. Please to see the changes delete the cache');
// Create plan
$I->wantTo('activate Ocean Premium theme');
$I->amOnPage('/oc-panel/Plan/create');
$I->fillField('#formorm_name', 'Free plan');
$I->fillField('#formorm_seoname', 'free-plan');
$I->fillField('#formorm_description', 'This is the free plan, one free ad for each seven days');
$I->fillField('#formorm_price', '0');
$I->fillField('#formorm_days', '7');
$I->fillField('#formorm_amount_ads', '1');
$I->checkOption('formorm[status]');
$I->click('formorm[submit]');
$I->see('Item created. Please to see the changes delete the cache');
// Change to Ocean Premium (premium feature)
$I->wantTo('activate Ocean Premium theme');
$I->activate_theme('ocean');
// See plan
$I->wantTo('go to the publish page and see the plan.');
$I->amOnPage('/publish-new.html');
$I->seeElement('.alert.alert-info');
$I->see('Please, choose a plan first');
$I->see('Free plan', 'h3');
$I->see('This is the free plan, one free ad for each seven days', 'p');
$I->see('7 days', 'p');
$I->see('1 Ads', 'p');
$I->see('Sign Up');
$I->see('$0.00');
$I->seeElement('.btn.btn-success.btn-block');
// Buy plan
$I->wantTo('purchase the plan.');
$I->click("//a[@class='btn btn-success btn-block']");
<?php

$I = new AcceptanceTester($scenario);
$I->am('a user');
$I->wantTo('publish a new ad');
$I->login_admin();
$I->activate_theme('pinclass');
$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 pinclass");
$I->fillField('#category-selected', '18');
$I->fillField('#location-selected', '4');
$I->fillField('#description', 'This is a new user ad on pinclass 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-pinclass.html');
$I->see('User ad on pinclass');
$I->see('This is a new user ad on pinclass theme');
$I->see('Barcelona');
$I->click('Logout');
$I->login_admin();
$I->fillField('name', 'telephone');
$I->fillField('label', 'telephone');
$I->fillField('tooltip', 'telephone');
$I->selectOption('form select[name="type"]', 'integer');
$I->checkOption('required');
$I->checkOption('searchable');
$I->checkOption('show_register');
$I->checkOption('show_profile');
$I->click('button[type="submit"]');
$I->see('Field telephone created');
$I->seeElement('.drag-item');
// delete all cache
$I->amOnPage('/oc-panel/tools/cache?force=1');
$I->see('All cache deleted');
// activate a premium theme to see the custom field!
$I->activate_theme('splash');
// delete all cache
$I->amOnPage('/oc-panel/tools/cache?force=1');
$I->see('All cache deleted');
// Not able to see my custom field from the test
// but it's displayed on http://reoc.lo/publish-new.html (Maybe an issue with PhpBrowser)
$I->amOnPage('/');
$I->click('Logout');
$I->amOnPage('/oc-panel/auth/register');
$I->seeElement('input', ['id' => 'cf_telephone']);
$I->login_admin();
$I->amOnPage('oc-panel/userfields');
$I->seeElement('.drag-item');
$I->amOnPage('http://reoc.lo/oc-panel/userfields/delete/telephone');
$I->amOnPage('oc-panel/userfields');
$I->dontSeeElement('.drag-item');
<?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);
$I->am('a visitor');
$I->wantTo('publish a new ad');
$I->login_admin();
$I->activate_theme('czsale');
$I->click('Logout');
$I->amOnPage('/publish-new.html');
$I->see('Publish new advertisement');
$I->fillField('#title', 'New ad unregister czsale');
$I->click('.select-category');
$I->fillField('category', '18');
$I->fillField('location', '4');
$I->fillField('#description', 'This is a new ad from unregister user on the czsale 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.google.com');
$I->fillField('#name', 'David');
$I->fillField('#email', '*****@*****.**');
$I->click('submit_btn');
$I->see('Advertisement is posted. Congratulations!');
$I->amOnPage('/apartment/new-ad-unregister-czsale.html');
$I->see('New ad unregister czsale');
$I->see('This is a new ad from unregister user on the czsale theme');
$I->see('Barcelona');
// Check if user has created
$I->amOnPage('/user/david');
$I->dontSee('Page not found');
<?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');
<?php

$I = new AcceptanceTester($scenario);
$I->am('a user');
$I->wantTo('publish a new ad');
$I->login_admin();
$I->activate_theme('yummo');
$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 yummo");
$I->fillField('#category-selected', '18');
$I->fillField('#location-selected', '4');
$I->fillField('#description', 'This is a new user ad on yummo 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-yummo.html');
$I->see('User ad on yummo');
$I->see('This is a new user ad on yummo theme');
$I->see('Barcelona');
$I->click('Logout');
$I->login_admin();