/** * @depends openDocfiles */ public function addnewDocfiles(AcceptanceTester $I) { // excel $I->attachFile('UploadDocFile[docFile]', 'files/excel.xlsx'); $I->wait(2); $I->click('//a[contains(@title, "Загрузить выбранные файлы")]'); $I->wait(2); $I->seeElement('//td/a[contains(text(),"excel.xlsx")]/preceding::td/span/i[@class="fa fa-file-excel-o"]/preceding::td/button[@title="Удалить"]'); $I->dontSeeElement('//span[@style="text-decoration: line-through" and text() = "excel.xlsx"]'); // word $I->attachFile('UploadDocFile[docFile]', 'files/word.docx'); $I->wait(2); $I->click('//a[contains(@title, "Загрузить выбранные файлы")]'); $I->wait(2); $I->seeElement('//td/a[contains(text(),"word.docx")]/preceding::td/span/i[@class="fa fa-file-word-o"]/preceding::td/button[@title="Удалить"]'); $I->dontSeeElement('//span[@style="text-decoration: line-through" and text() = "word.docx"]'); // jpg $I->attachFile('UploadDocFile[docFile]', 'files/jpg.jpg'); $I->wait(2); $I->click('//a[contains(@title, "Загрузить выбранные файлы")]'); $I->wait(2); $I->seeElement('//td/a[contains(text(),"jpg.jpg")]/preceding::td/span/i[@class="fa fa-file-image-o"]/preceding::td/button[@title="Удалить"]'); $I->dontSeeElement('//span[@style="text-decoration: line-through" and text() = "jpg.jpg"]'); // png $I->attachFile('UploadDocFile[docFile]', 'files/png.png'); $I->wait(2); $I->click('//a[contains(@title, "Загрузить выбранные файлы")]'); $I->wait(2); $I->seeElement('//td/a[contains(text(),"png.png")]/preceding::td/span/i[@class="fa fa-file-image-o"]/preceding::td/button[@title="Удалить"]'); $I->dontSeeElement('//span[@style="text-decoration: line-through" and text() = "png.png"]'); //txt $I->attachFile('UploadDocFile[docFile]', 'files/text.txt'); $I->wait(2); $I->click('//a[contains(@title, "Загрузить выбранные файлы")]'); $I->wait(2); $I->seeElement('//td/a[contains(text(),"text.txt")]/preceding::td/span/i[@class="fa fa-file-text-o"]/preceding::td/button[@title="Удалить"]'); $I->dontSeeElement('//span[@style="text-decoration: line-through" and text() = "text.txt"]'); //unknown $I->attachFile('UploadDocFile[docFile]', 'files/unknown.unk'); $I->wait(2); $I->see('Разрешена загрузка файлов только со следующими расширениями: png, jpg, jpeg, tiff, pdf, xls, xlsx, doc, docx, txt.'); $I->click('//a[contains(@title, "Загрузить выбранные файлы")]'); $I->wait(2); }
public function submitCorrect(AcceptanceTester $I) { $I->logInAsANormalUser(); $I->amOnPage('/challenges?category=' . to_permalink(CI_DEFAULT_CATEGORY_TITLE)); $I->see(CI_DEFAULT_CHALLENGE_TITLE); $I->see(CI_DEFAULT_CHALLENGE_DESCRIPTION); $flag_field = '#flag-input-' . CI_DEFAULT_CHALLENGE_ID; $I->fillField($flag_field, CI_DEFAULT_CHALLENGE_FLAG); $I->click('#flag-submit-' . CI_DEFAULT_CHALLENGE_ID); $I->seeInCurrentUrl('status=correct'); $I->dontSeeElement($flag_field); }
public function contactFormCanBeSubmitted(AcceptanceTester $I) { $I->amGoingTo('submit contact form with correct data'); $I->fillField('#contactform-name', 'tester'); $I->fillField('#contactform-email', '*****@*****.**'); $I->fillField('#contactform-subject', 'test subject'); $I->fillField('#contactform-body', 'test content'); $I->fillField('#contactform-verifycode', 'testme'); $I->click('contact-button'); $I->wait(2); // wait for button to be clicked $I->dontSeeElement('#contact-form'); $I->see('Thank you for contacting us. We will respond to you as soon as possible.'); }
$I->see('Item updated. Please to see the changes delete the cache'); // See captcha on contact page $I->amOnPage('/contact.html'); $I->see('Captcha*:'); $I->seeElement('img', ['id' => 'captcha_img_contact']); $I->seeElement('input', ['id' => 'captcha']); // Disable captcha $I->amOnPage('/oc-panel/Config/update/captcha'); $I->fillField('#formorm_config_value', '0'); $I->click('formorm[submit]'); $I->seeElement('.alert.alert-success'); $I->see('Item updated. Please to see the changes delete the cache'); // Don't see captcha on contact page $I->amOnPage('/contact.html'); $I->dontSee('Captcha*:'); $I->dontSeeElement('img', ['id' => 'captcha_img_contact']); $I->dontSeeElement('input', ['id' => 'captcha']); // Enable captcha $I->amOnPage('/oc-panel/Config/update/captcha'); $I->fillField('#formorm_config_value', '1'); $I->click('formorm[submit]'); $I->seeElement('.alert.alert-success'); $I->see('Item updated. Please to see the changes delete the cache'); // Enable reCaptcha $I->amOnPage('/oc-panel/Config/update/recaptcha_active'); $I->fillField('#formorm_config_value', '1'); $I->click('formorm[submit]'); $I->seeElement('.alert.alert-success'); $I->see('Item updated. Please to see the changes delete the cache'); // Fill site key $I->amOnPage('/oc-panel/Config/update/recaptcha_secretkey');
// Delete BLOG $I->amOnPage('/oc-panel/Blog/'); $I->see('Blog Post Title'); $I->click('.btn.btn-danger.index-delete'); sleep(1); $I->amOnPage('/oc-panel/Blog/'); $I->dontSee('Blog Post Title'); $I->amOnPage('/blog'); $I->dontSee('Blog Post Title'); $I->amOnPage('/oc-panel/Config/update/blog'); $I->fillField("#formorm_config_value", '0'); $I->click("//button[@type='submit']"); //click save $I->see('Item updated. Please to see the changes delete the cache'); $I->amOnPage('/'); $I->dontSeeElement('a', ['href' => 'http://reoc.lo/blog']); $I->amOnPage('/oc-panel/Config/update/blog_disqus'); $I->fillField('#formorm_config_value', ''); $I->click('button[type="submit"]'); $I->see('Item updated. Please to see the changes delete the cache'); // Disqus for FAQ $I->amOnPage('/oc-panel/Config/update/faq_disqus'); $I->fillField('#formorm_config_value', 'testoc'); $I->click('button[type="submit"]'); $I->see('Item updated. Please to see the changes delete the cache'); $I->wantTo('activate faq'); $I->amOnPage('/oc-panel/Config/update/faq'); $I->fillField("#formorm_config_value", '1'); $I->click("//button[@type='submit']"); //click save $I->see('Item updated. Please to see the changes delete the cache');
$I->seeElement('.alert.alert-success'); $I->see('Category created'); // READ $I->amOnPage('/'); $I->see('themes', 'a'); $I->amOnPage('/themes'); $I->see('Themes', 'h1'); $I->see('Premium themes and templates for Open Classifieds.', 'p'); // UPDATE $I->amOnPage('/oc-panel/Category'); $I->click('.btn.btn-xs.btn-primary.pull-right'); $I->see('Update Category', 'h1'); $I->fillField('#formorm_name', 'Themes-updated'); $I->fillField('#formorm_seoname', 'themes-updated'); $I->fillField('#formorm_description', 'Premium themes and templates for Open Classifieds. Themes, themes and themes!'); $I->click('formorm[submit]'); $I->seeElement('.alert.alert-success'); $I->see('Item updated'); $I->amOnPage('/'); $I->see('themes-updated', 'a'); $I->amOnPage('/themes-updated'); $I->see('Themes-updated', 'h1'); $I->see('Premium themes and templates for Open Classifieds. Themes, themes and themes!', 'p'); // DELETE $I->amOnPage('/oc-panel/Category'); $I->click('.btn.btn-xs.btn-danger.pull-right.index-delete.index-delete-inline'); $I->amOnPage('/oc-panel/Category'); $I->dontSeeElement('.btn.btn-xs.btn-danger.pull-right.index-delete.index-delete-inline'); $I->dontSeeElement('.btn.btn-xs.btn-primary.pull-right'); $I->amOnPage('/oc-panel/auth/logout'); $I->see('Login', 'a');
<?php $I = new AcceptanceTester($scenario); $I->wantTo('add a new address field with custom options.'); $I->login('tester', 'test'); $I->amOnPage('/wp/wp-admin/post.php?post=4&action=edit'); $I->click('+ Add Field'); $I->fillField('.field-label', 'acf address custom test field'); $I->selectOption('form select.field-type', 'address'); $I->wait(2); $I->seeElement('.acf-address-1-row'); $I->wantTo('make changes to the default address settings.'); // has the form ${obj.id}-${widgetCount} $I->uncheckOption('#street2-1'); $I->wait(1); // has the form ${obj.id}-li-movable-${widgetCount} $I->dontSeeElement('#street2-li-movable-1'); $I->click('#publish'); $I->see('Field group updated.'); $I->wantTo('make sure my changes were persisted.'); $I->dontSeeCheckboxIsChecked('#street2-1'); $I->dontSeeElement('#street2-li-movable-1');
$I->see('Item updated. Please to see the changes delete the cache'); $I->amOnPage('/oc-panel/Config/update/to_top'); $I->fillField('#formorm_config_value', '1'); $I->click('button[type="submit"]'); $I->see('Item updated. Please to see the changes delete the cache'); // Read $I->amOnPage('/oc-panel/myads'); $I->seeElement('.glyphicon.glyphicon-circle-arrow-up'); $I->see('Featured', 'a'); $I->amOnPage('/jobs/some-nice-title-here.html'); $I->see('Your Advertisement can go on top again! For only', 'p'); $I->see('Go Top!', 'a'); $I->see('Your Advertisement can go to featured! For only', 'p'); $I->see('Go Featured!', 'a'); // Back to default $I->amOnPage('/oc-panel/Config/update/to_featured'); $I->fillField('#formorm_config_value', '0'); $I->click('button[type="submit"]'); $I->see('Item updated. Please to see the changes delete the cache'); $I->amOnPage('/oc-panel/Config/update/to_top'); $I->fillField('#formorm_config_value', '0'); $I->click('button[type="submit"]'); $I->see('Item updated. Please to see the changes delete the cache'); $I->amOnPage('/oc-panel/myads'); $I->dontSeeElement('.glyphicon.glyphicon-circle-arrow-up'); $I->dontSee('Featured', 'a'); $I->amOnPage('/jobs/some-nice-title-here.html'); $I->dontSee('Your Advertisement can go on top again! For only', 'p'); $I->dontSee('Go Top!', 'a'); $I->dontSee('Your Advertisement can go to featured! For only', 'p'); $I->dontSee('Go Featured!', 'a');
<?php // @group mandatory use tests\codeception\_pages\LoginPage; $I = new AcceptanceTester($scenario); $I->wantTo('ensure backend access works'); $I->amOnPage('/backend'); $I->dontSeeElement('.small-box'); $I->amOnPage('/prototype/html'); $I->dontSee('Htmls', 'h1'); $I->amOnPage('/prototype/less'); $I->dontSee('Lesses', 'h1'); $I->amOnPage('/settings'); $I->dontSee('Settings', 'h1'); $loginPage = LoginPage::openBy($I); $loginPage->login('admin', 'admin'); $I->amOnPage('/backend'); $I->seeElement('.small-box'); $I->amOnPage('/prototype/html'); $I->see('Htmls', 'h1'); $I->amOnPage('/prototype/less'); $I->see('Lesses', 'h1'); $I->amOnPage('/settings'); $I->see('Settings', 'h1');
$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'); $I->click('button[type="submit"]'); $I->see('Item updated. Please to see the changes delete the cache'); //Read $I->amOnPage('/publish-new.html');
$I->amOnPage('/oc-panel/auth/login'); $I->fillField('email', '*****@*****.**'); $I->fillField('password', '1234'); $I->click('auth_redirect'); $I->amOnPage('/publish-new.html'); $I->seeElement('.alert.alert-info'); $I->see('Please, choose a plan first'); $I->dontSee('Free plan', 'h3'); // Login as admin - disable Memberships $I->amOnPage('/'); $I->click('Logout'); $I->login_admin(); $I->amOnPage('/oc-panel/Config/update/subscriptions'); $I->fillField('#formorm_config_value', '0'); $I->click('formorm[submit]'); $I->see('Item updated. Please to see the changes delete the cache'); // Check as a user if memberships are disabled. $I->amOnPage('/'); $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->dontSeeElement('.alert.alert-info'); $I->dontSee('Please, choose a plan first'); // Login as admin - switch to default theme $I->amOnPage('/'); $I->click('Logout'); $I->login_admin(); $I->{$I}->activate_theme('default');
$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'); $I->dontSeeElement('.glyphicon.glyphicon-trash'); $I->{$I}->activate_theme('default');
$I->amOnPage('/oc-panel/'); $I->see('welcome admin'); $I->amOnPage('/oc-panel/Config/update/recaptcha_active'); $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('/oc-panel/Config/update/recaptcha_secretkey'); $I->fillField('#formorm_config_value', '6LcN3AATAAAAAAJM-ef2dL1zBMyUZpATTIr0ubln'); $I->click('button[type="submit"]'); $I->see('Item updated. Please to see the changes delete the cache'); $I->amOnPage('/oc-panel/Config/update/recaptcha_sitekey'); $I->fillField('#formorm_config_value', '6LcN3AATAAAAAPpqImSRX56OBFEzYKnxdzQzLN6L'); $I->click('button[type="submit"]'); $I->see('Item updated. Please to see the changes delete the cache'); $I->amOnPage('/publish-new.html'); $I->seeElement('#recaptcha1'); $I->amOnPage('/oc-panel/Config/update/recaptcha_active'); $I->fillField('#formorm_config_value', '0'); $I->click('button[type="submit"]'); $I->see('Item updated. Please to see the changes delete the cache'); $I->amOnPage('/oc-panel/Config/update/recaptcha_secretkey'); $I->fillField('#formorm_config_value', ''); $I->click('button[type="submit"]'); $I->see('Item updated. Please to see the changes delete the cache'); $I->amOnPage('/oc-panel/Config/update/recaptcha_sitekey'); $I->fillField('#formorm_config_value', ''); $I->click('button[type="submit"]'); $I->see('Item updated. Please to see the changes delete the cache'); $I->amOnPage('/publish-new.html'); $I->dontSeeElement('#recaptcha1');
public function systeminfo_ログ表示(\AcceptanceTester $I) { $I->wantTo('EA0806-UC01-T01 ログ表示'); // 表示 $config = Fixtures::get('config'); $I->amOnPage('/' . $config['admin_route'] . '/setting/system/log'); $I->see('システム設定EC-CUBE ログ表示', '#main .page-header'); $log = $I->grabValueFrom(['id' => 'admin_system_log_files']); $expect = "site_" . date('Y-m-d') . ".log"; $I->assertEquals($expect, $log); $I->fillField(['id' => 'line-max'], '1'); $I->click(['css' => '#form1 button']); $I->dontSeeElement(['css' => '#main .container-fluid .box table tbody tr:nth-child(2)']); }
<?php $I = new AcceptanceTester($scenario); $I->wantTo('Add a new Image'); $I->amOnPage('/login'); $I->fillField('email', '*****@*****.**'); $I->fillField("password", "123456"); $I->click(['class' => 'btn-raised']); $I->seeLink('Logout', '/logout'); $I->click('Images'); $I->seeInCurrentUrl('/images'); $I->click(['class' => 'btn-primary']); $I->see('Upload new images'); $I->selectOption('image_category', '2'); $I->attachFile('input[type="file"]', 'banner.jpg'); $I->click('Start upload'); $I->dontSeeElement(['class' => 'btn-danger delete']); /* $I->click('Images'); $I->seeInCurrentUrl('/images'); $I->click('Logout'); $I->see('Login'); */
<?php $I = new AcceptanceTester($scenario); $I->wantTo('perform actions and see result'); $I->amOnPage('/incasso'); $I->see('Uw gegevens'); $I->dontSeeElement('.has-error'); $I->see('Verificatie Code'); $I->click('Aanmelden'); $I->see('Naam mag niet leeg zijn.'); $I->seeElement('.has-error');
/** * @depends updateEmployee */ public function deleteOneEmployee(AcceptanceTester $I) { $I->click('//td[text()="ПОЛИКЛИНИКА 1"]/preceding-sibling::td[text()="ОБЩЕПОЛИКЛИНИЧЕСКОЕ"]/preceding-sibling::td[text()="КАРДИОЛОГ"]/preceding-sibling::td/button[@title="Удалить"]'); $I->wait(2); $I->see('Вы уверены, что хотите удалить запись?'); $I->click('button[data-bb-handler="confirm"]'); $I->wait(2); $I->dontSeeElement('//td[text()="ПОЛИКЛИНИКА 1"]/preceding-sibling::td[text()="ОБЩЕПОЛИКЛИНИЧЕСКОЕ"]/preceding-sibling::td[text()="КАРДИОЛОГ"]/preceding-sibling::td/button[@title="Удалить"]/preceding-sibling::a[@title="Обновить"]'); $I->seeElement('//td[text()="ПОЛИКЛИНИКА 3"]/preceding-sibling::td[text()="ОБЩЕПОЛИКЛИНИЧЕСКОЕ"]/preceding-sibling::td[text()="КАРДИОЛОГ"]/preceding-sibling::td/button[@title="Удалить"]/preceding-sibling::a[@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'); $I->am("a user"); $I->wantTo('mark an ad as favorite and see this ad on my favorites'); $I->amOnPage('/oc-panel/profile/favorites'); $I->seeElement('th'); $I->dontSeeElement('.btn.btn-danger.index-delete.index-delete-inline'); $I->amOnPage('/all'); $I->seeElement('.glyphicon-heart-empty'); $I->click("//a[@title='Add to Favorites']"); $I->dontseeElement('.glyphicon-heart-empty'); $I->amOnPage('/oc-panel/profile/favorites'); $I->seeElement('.btn.btn-danger.index-delete.index-delete-inline'); $I->click("//a[@class='btn btn-danger index-delete index-delete-inline']"); $I->amOnPage('/'); $I->click('Logout');
/** * @depends addCreateMaterialFromSelect2 */ public function addCreateMaterialFromGrids(AcceptanceTester $I) { $I->seeLink('Составить акт прихода материальнной ценности'); $I->click(['link' => 'Составить акт прихода материальнной ценности']); $I->wait(2); $I->seeElement(['class' => 'material-form']); $I->chooseValueFromSelect2('Material[material_tip]', 'Материал'); $I->chooseValueFromGrid('Material[id_matvid]', 'СТОЛ', 'matvidgrid_gw'); $I->fillField('Material[material_name]', 'Кухонный стол'); $I->fillField('Material[material_inv]', '1000002'); $I->dontSeeElement('//input[@name="Material[material_number]" and @disabled]'); $I->seeElement('//input[@name="Material[material_number]"]'); $I->fillField('Material[material_number]', '5.000'); $I->chooseValueFromGrid('Material[id_izmer]', 'шт', 'izmergrid_gw'); $I->fillField('Material[material_price]', '15000'); // $I->executeJS('window.scrollTo(0,200);'); $I->chooseValueFromGrid('Material[id_schetuchet]', '101.34, НОВЫЙ СЧЕТ', 'schetuchetgrid_gw', '//td[text()="НОВЫЙ СЧЕТ"]' . '/preceding-sibling::td[text()="101.34"]' . '/preceding-sibling::td/button[@title="Выбрать"]'); $I->uncheckOption('Запись изменяема при импортировании из 1С'); $I->chooseValueFromGrid('Mattraffic[id_mol]', 'ИВАНОВ ИВАН ИВАНОВИЧ, ТЕРАПЕВТ, ТЕРАПЕВТИЧЕСКОЕ, ПОЛИКЛИНИКА 1', 'employeegrid_gw', '//td[text()="ПОЛИКЛИНИКА 1"]' . '/preceding-sibling::td[text()="ТЕРАПЕВТИЧЕСКОЕ"]' . '/preceding-sibling::td[text()="ТЕРАПЕВТ"]' . '/preceding-sibling::td[text()="ИВАНОВ ИВАН ИВАНОВИЧ"]' . '/preceding-sibling::td[text()="1175"]' . '/preceding-sibling::td/button[@title="Выбрать"]'); $I->see('Создать'); $I->click('//button[contains(text(), "Создать")]'); $I->wait(2); $I->seeElement('//td[text()="ПОЛИКЛИНИКА 1"]' . '/preceding-sibling::td[text()="ТЕРАПЕВТ"]' . '/preceding-sibling::td[text()="ИВАНОВ ИВАН ИВАНОВИЧ"]' . '/preceding-sibling::td[text()="5.000"]' . '/preceding-sibling::td[text()="Приход"]' . '/preceding-sibling::td/button[@title="Удалить"]'); $I->see('Движение материальной ценности'); $I->seeElement(['id' => 'mattraffic_karta_grid_gw']); $I->see('Обновить'); $I->click('//button[contains(text(), "Обновить")]'); $I->wait(2); $I->seeElement(['id' => 'materialgrid_gw']); $I->seeElement('//td[text()="Нет"]' . '/preceding-sibling::td[text()="15000.00"]' . '/preceding-sibling::td[text()="шт"]' . '/preceding-sibling::td[text()="5.000"]' . '/preceding-sibling::td[text()="1000002"]' . '/preceding-sibling::td[text()="Кухонный стол"]' . '/preceding-sibling::td[text()="СТОЛ"]' . '/preceding-sibling::td[text()="Материал"]' . '/preceding-sibling::td/a[@title="Карта материальной ценности"]'); }
$I->amOnPage('/oc-panel/tools/cache?force=1'); $I->see('All cache deleted'); /* // activate a premium theme to see the custom field! $I->amOnPage('/oc-panel/Config/update/theme'); $I->fillField('#formorm_config_value','splash'); $I->click('button[type="submit"]'); $I->see('Item updated. Please to see the changes delete the cache'); // delete all cache $I->amOnPage('/oc-panel/tools/cache?force=1'); $I->see('All cache deleted'); $I->amOnPage('/publish-new.html'); $I->see('My Custom Field'); // 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('/oc-panel/theme'); $I->click('a[href="http://reoc.lo/oc-panel/theme/index/default"]'); */ $I->amOnPage('/oc-panel/fields'); $I->see('Custom Fields'); $I->see('my_custom_field'); $I->click('a[href="http://reoc.lo/oc-panel/fields/delete/my_custom_field"]'); //$I->click('.confirm'); $I->amOnPage('/oc-panel/fields'); $I->dontSeeElement('.drag-item'); $I->click('Logout');
$I->fillField('#formorm_config_value', '1'); $I->click('formorm[submit]'); $I->see('Item updated. Please to see the changes delete the cache'); // Check 2 step authentication on profile edit $I->wantTo('check 2 step authentication on profile edit'); $I->amOnPage('/oc-panel/profile/edit'); $I->see('2 Step Authentication', 'h3'); $I->seeElement('.btn.btn-primary'); $I->seeElement('.fa.fa-android'); $I->seeElement('.fa.fa-apple'); // Enable 2 step authentication and see the code $I->click('a[href="http://reoc.lo/oc-panel/profile/2step/enable"]'); $I->see('2 Step Authentication Enabled'); $I->seeElement('.alert.alert-success'); $I->see('Google Authenticator Code'); $I->seeElement('.btn.btn-warning'); // Disable 2 step authentication and see the code $I->click('a[href="http://reoc.lo/oc-panel/profile/2step/disable"]'); $I->seeElement('.alert.alert-info'); $I->see('2 Step Authentication Disabled'); $I->dontSee('Google Authenticator Code'); // Disable google_authenticator $I->wantTo('disable google_authenticator'); $I->amOnPage('/oc-panel/Config/update/google_authenticator'); $I->fillField('#formorm_config_value', '0'); $I->click('formorm[submit]'); $I->see('Item updated. Please to see the changes delete the cache'); $I->amOnPage('/oc-panel/profile/edit'); $I->dontSee('2 Step Authentication', 'h3'); $I->dontSeeElement('.fa.fa-android'); $I->dontSeeElement('.fa.fa-apple');
$I->see('sort', 'li'); $I->see('hvid', 'li'); $I->see('lilla', 'li'); $I->see('orange', 'li'); $I->see('Forår', 'li'); $I->see('Sommer', 'li'); $I->see('Efterår', 'li'); $I->see('Vinter', 'li'); //$I->see('10 cm', 'li'); $I->see('10-25 cm', 'li'); $I->see('25-40 cm', 'li'); $I->see('40-50 cm', 'li'); $I->see('50-75 cm', 'li'); $I->see('75-100 cm', 'li'); //$I->see('100 cm', 'li'); $I->see('Agerland', 'li'); $I->see('Vådområde', 'li'); $I->see('Skov og hegn', 'li'); $I->see('Hede', 'li'); $I->see('Kyst', 'li'); $I->seeElement('.photo'); $I->dontSeeElement('.default'); /* * After he have check that all the data is correct he clicks on the link to the front page. */ $I->click('Forside'); /* * Here he sees the plant is on the list and therefor has been successful created. */ $I->see('Test plant', 'tr td'); $I->see('Test plant latin', 'tr td');
$wait = 1; // secondes $I->checkAccessFiltersAndLog($pageUrl, '*****@*****.**', 'ew0oVQQkaCvCGwmIxK7a', 'Liste des textes'); $I->expect('le lien de création fonctionne'); $I->seeLink('Ajouter un texte'); $I->click('Ajouter un texte'); $I->see('Ajouter un texte', 'h1'); $I->expect('le lien de mise à jour fonctionne'); $I->amOnPage(Url::to(['/cms/web-texts/index'])); $url = Url::to(['/cms/web-texts/update', 'id' => 2], true); $I->seeElement(['css' => 'a[href="' . $url . '"]']); $I->click(['css' => 'a[href="' . $url . '"]']); $I->wait($wait); $I->see('Modifier un texte', 'h1'); $I->expect('le lien vers la fiche fonctionne'); $I->amOnPage(Url::to(['/cms/web-texts/index'])); $url = Url::to(['/cms/web-texts/view', 'id' => 2], true); $I->seeElement(['css' => 'a[href="' . $url . '"]']); $I->click(['css' => 'a[href="' . $url . '"]']); $I->wait($wait); $I->see('Fiche d\'un texte', 'h1'); $I->expect('la suppression fonctionne'); $I->amOnPage(Url::to(['/cms/web-texts/index'])); $url = Url::to(['/cms/web-texts/delete', 'id' => 2], true); $I->seeElement(['css' => 'a[href="' . $url . '"]']); $I->click(['css' => 'a[href="' . $url . '"]']); $I->acceptPopup(); $I->wait($wait); $I->see('Suppression réussie'); $I->dontSeeElement(['css' => 'a[href="' . $url . '"]']);
// Delete //$I->amOnPage('/oc-panel/topic'); //$I->click(".btn.btn-danger.index-delete"); //Delete Reply $I->amOnPage('/oc-panel/forum/index'); $I->click(".drag-action.index-delete"); //Delete Forum $I->amOnPage('/forum'); $I->dontsee('My Forum'); $I->amOnPage('/oc-panel/Config/update/forums'); $I->fillField("#formorm_config_value", '0'); // Deactivates forums $I->click("//button[@type='submit']"); //click save $I->see('Item updated. Please to see the changes delete the cache'); $I->amOnPage('/'); $I->dontSeeElement('.glyphicon.glyphicon-tag'); ///////////////////////////////////////////////////////////////// // activate faq from settings -> general -> all configurations $I->wantTo('activate faq'); $I->amOnPage('/oc-panel/Config/update/faq'); $I->fillField("#formorm_config_value", '1'); $I->click("//button[@type='submit']"); //click save $I->see('Item updated. Please to see the changes delete the cache'); $I->amOnPage('/'); $I->seeElement('a', ['href' => 'http://reoc.lo/faq']); // Create $I->amOnPage('/oc-panel/content/create?type=help'); $I->fillField('#title', 'My faq name'); $I->fillField('#description', 'Description for My faq'); $I->checkOption('#status');
$I->see('Theme configuration updated'); $I->amOnPage('/'); $I->see('Search and place ads easily with open classifieds'); $I->wantTo('activate Reclassifieds3 theme'); $I->amOnPage('/oc-panel/Config/update/theme'); $I->fillField('#formorm_config_value', 'reclassifieds3'); $I->click('button[type="submit"]'); $I->see('Item updated. Please to see the changes delete the cache'); $I->amOnPage('/housing'); $I->seeElement('.breadcrumb'); $I->amOnPage('/oc-panel/theme/options'); $I->selectOption('breadcrumb', '0'); $I->click('submit'); $I->see('Theme configuration updated'); $I->amOnPage('/housing'); $I->dontSeeElement('.breadcrumb'); $I->amOnPage('/oc-panel/theme/options'); $I->selectOption('breadcrumb', '1'); $I->click('submit'); $I->see('Theme configuration updated'); $I->amOnPage('/housing'); $I->seeElement('.breadcrumb'); $I->wantTo('activate Newspaper theme'); $I->amOnPage('/oc-panel/Config/update/theme'); $I->fillField('#formorm_config_value', 'newspaper'); $I->click('button[type="submit"]'); $I->see('Item updated. Please to see the changes delete the cache'); $I->amOnPage('/housing'); $I->seeElement('.breadcrumb'); $I->amOnPage('/oc-panel/theme/options'); $I->selectOption('breadcrumb', '0');
$I->wantTo('change configurations and see changes on frontend'); $I->login_admin(); // Advertisements per page $I->amOnPage('/oc-panel/settings/form'); $I->fillField('#advertisements_per_page', '2'); $I->click('submit'); // Read $I->amOnPage('/all'); $I->seeElement('.pagination'); $I->dontSee('another great title'); // Back to default $I->amOnPage('/oc-panel/settings/form'); $I->fillField('#advertisements_per_page', '10'); $I->click('submit'); $I->amOnPage('/all'); $I->dontSeeElement('.pagination'); $I->see('another great title'); // Advertisements in RSS $I->amOnPage('/oc-panel/settings/form'); $I->fillField('#feed_elements', '2'); $I->click('submit'); // Read $I->amOnPage('/rss.xml'); $I->dontSee('another great title'); // Back to default $I->amOnPage('/oc-panel/settings/form'); $I->fillField('#feed_elements', '20'); $I->click('submit'); $I->amOnPage('/rss.xml'); $I->see('another great title'); // Sort by in Listing
$I->seeElement('.alert.alert-success'); $I->see('Item updated. Please to see the changes delete the cache'); $I->amOnPage('/'); //$I->seeElement('.fixed.bottom'); //$I->see('We use cookies to track usage and preferences'); //$I->seeElement('.cb-enable'); //$I->see('I Understand','a'); // Cookies consent appears, but phpBrowser can't read it. If I uncomment the above 4 lines, // test fails but on _output/admin.09-SettingsGeneralCept.fail.html cookie consent appears. $I->amOnPage('/oc-panel/Config/update/cookie_consent'); $I->fillField('#formorm_config_value', '0'); $I->click('formorm[submit]'); $I->seeElement('.alert.alert-success'); $I->see('Item updated. Please to see the changes delete the cache'); $I->dontSee('We use cookies to track usage and preferences'); $I->dontSeeElement('.cb-enable'); $I->dontSee('I Understand', 'a'); /************************* LANDING PAGE **************************/ $I->amOnPage('/oc-panel/Config/update/landing_page'); $I->fillField('formorm[config_value]', '{"controller":"product","action":"listing"}'); $I->click('formorm[submit]'); $I->seeElement('.alert.alert-success'); $I->see('Item updated. Please to see the changes delete the cache'); $I->amOnPage('/'); $I->see('Listing', 'h1'); $I->amOnPage('/oc-panel/Config/update/landing_page'); $I->fillField('formorm[config_value]', '{"controller":"home","action":"index"}'); $I->click('formorm[submit]'); $I->amOnPage('/');
$I->see('welcome admin'); // Description BBCode $I->amOnPage('/oc-panel/Config/update/description_bbcode'); $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->seeElement('.form-control.disable-bbcode'); // Back to default $I->amOnPage('/oc-panel/Config/update/description_bbcode'); $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->dontSeeElement('.form-control.disable-bbcode'); // Captcha $I->amOnPage('/oc-panel/Config/update/captcha'); $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('captcha', 'label'); $I->dontSeeElement('input', ['name' => 'captcha']); // Back to default $I->amOnPage('/oc-panel/Config/update/captcha'); $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->submitForm('form', [], '#submit'); $I->seeElement('.alert-danger'); //-------------------------------------------------------------------- // Error without bad password //-------------------------------------------------------------------- $I->expect('error returned due to bad password'); $I->seeElement('#submit'); $I->submitForm('#login_form', ['email' => '*****@*****.**', 'password' => 'badstuff'], '#submit'); $I->seeElement('.alert-danger'); $I->expect('login attempt was logged'); $I->seeInDatabase('auth_login_attempts', ['email' => '*****@*****.**']); //-------------------------------------------------------------------- // Error without bad email //-------------------------------------------------------------------- $I->expect('error returned due to bad email'); $I->seeElement('#submit'); $I->submitForm('#login_form', ['email' => '*****@*****.**', 'password' => 'mylittlepony'], '#submit'); $I->seeElement('.alert-danger'); $I->expect('login attempt was logged'); $I->seeInDatabase('auth_login_attempts', ['email' => '*****@*****.**']); //-------------------------------------------------------------------- // Successfully login //-------------------------------------------------------------------- $I->expect('am logged in'); $I->seeElement('#submit'); $I->submitForm('#login_form', ['email' => '*****@*****.**', 'password' => 'mylittlepony'], '#submit'); $I->dontSeeElement('.alert-danger'); $I->expect('login action was logged'); $I->seeInDatabase('auth_logins', ['user_id' => 1]); $I->expect('login attempts were cleared'); $I->dontSeeInDatabase('auth_login_attempts', ['email' => '*****@*****.**']);
$I->unCheckOption('profile|confirm'); $I->unCheckOption('profile|stats'); $I->click('submit'); $I->see('Item updated'); $I->amOnPage('/'); $I->click('Logout'); //login as a user $I->amOnPage('/oc-panel/auth/login'); $I->fillField('email', '*****@*****.**'); $I->fillField('password', '1234'); $I->click('auth_redirect'); // Read // Subscribe - Unsubscribe $I->amOnPage('/'); $I->click('a[href="http://reoc.lo/oc-panel/profile/subscriptions"]'); $I->dontSeeElement('.alert.alert-danger'); $I->dontSee('You do not have permissions to access Profile subscriptions'); $I->seeElement('.alert.alert-info'); $I->see('No Subscriptions'); // Image $I->amOnPage('/oc-panel/profile/edit'); $I->attachFile('input[type="file"]', 'photo.jpg'); $I->click("//form[contains(@action,'http://reoc.lo/oc-panel/profile/image')]/div/div/button[@type='submit']"); $I->dontSeeElement('.alert.alert-danger'); $I->dontSee('You do not have permissions to access Profile image'); $I->seeElement('.alert.alert-success'); $I->see('photo.jpg Image is uploaded.'); $I->click('photo_delete'); $I->seeElement('.alert.alert-success'); $I->see('Photo deleted.'); // Favorites