public function _before(AcceptanceTester $I)
 {
     $I->wantTo('Install and Configure WC');
     $I->loginAsAdmin();
     //Only if Run this test Seperately
     $I->amGoingTo('Activate Woocommerce Plugin');
     $I->amOnPluginsPage();
     //In order that the activatePlugin() works, the webdriver needs to be in Plugins page
     $I->activatePlugin('woocommerce');
     $I->amGoingTo('Run Woocommerce Setup');
     $I->waitForElement(".button-primary", 20);
     $I->click("Let's Go!");
     $I->waitForElement(".button-primary", 15);
     $I->click("Continue");
     $I->wait(1);
     $I->click("Continue");
     $I->wait(1);
     $I->click("Continue");
     $I->wait(1);
     $I->checkOption('#woocommerce_enable_cod');
     $I->click("Continue");
     $I->waitForElement(".button-secondary", 15);
     $I->click("No thanks");
     $I->wait(1);
     $I->click("Return to the WordPress Dashboard");
 }
Ejemplo n.º 2
0
 /**
  * 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 _before(AcceptanceTester $I)
 {
     $I->wantTo('Install WPML');
     $I->loginAsAdmin();
     $I->amGoingTo('Activate WPML Plugins');
     $I->amOnPluginsPage();
     //In order that the activatePlugin() works, the webdriver needs to be in Plugins page
     $I->activatePlugin('wpml-multilingual-cms');
     $I->amGoingTo('Configure WPML');
     $I->click('No thanks, I will configure myself');
     $I->click('Next');
     //Let's English as Default language
     $I->checkOption('Greek');
     $I->wait(1);
     $I->click('Next');
     $I->wait(5);
     $I->checkOption('form input[name=icl_lang_sel_footer]');
     $I->waitForElement(".button-primary", 15);
     $I->wait(1);
     $I->click('Next');
     $I->wait(3);
     $I->waitForElement(".button-primary", 15);
     $I->click('Remind me later');
     $I->wait(5);
     $I->click('Finish');
 }
Ejemplo n.º 4
0
 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']);
 }
Ejemplo n.º 5
0
 public function _before(\AcceptanceTester $I)
 {
     $I->am('guest user');
     $I->amGoingTo('Load the homepage');
     $I->amOnPage('/');
     $I->seeInCurrentUrl('/');
 }
Ejemplo n.º 6
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');
 }
 public function _before(AcceptanceTester $I)
 {
     $I->wantTo('Further Configure WC');
     $I->loginAsAdmin();
     //Only if Run this test Seperately
     //////////////////////
     $I->amGoingTo('Configure the Selling Country');
     $I->amOnPage('/wp-admin/admin.php?page=wc-settings');
     $I->click('#select2-chosen-2');
     $I->fillField('#s2id_autogen2_search', 'Αττική');
     $I->click('.select2-match');
     //////////////////////
     $I->amGoingTo('Configure the Default Currency');
     $I->click('#select2-chosen-7');
     $I->fillField('#s2id_autogen7_search', 'Euro');
     $I->click('.select2-result-label');
     $I->click('Save changes');
     //////////////////////
     $I->wait(3);
 }
Ejemplo n.º 8
0
 public function ensureThatLoginWorks(AcceptanceTester $I)
 {
     $I->amOnPage(Url::toRoute('/user/login'));
     $I->see('Login', 'h1');
     $I->amGoingTo('try to login with correct credentials');
     $I->fillField('input[name="LoginForm[username]"]', 'admin');
     $I->fillField('input[name="LoginForm[password]"]', 'admin');
     $I->click('login-button');
     $I->wait(2);
     // wait for button to be clicked
     $I->expectTo('see user info');
     $I->see('Logout');
 }
Ejemplo n.º 9
0
 public function register(\AcceptanceTester $I)
 {
     $I->amGoingTo('register');
     $I->amOnPage('/auth/register');
     $I->fillField('name', 'codeception');
     $I->fillField('password', 'acceptance');
     $I->fillField('email', '*****@*****.**');
     $I->click('submit');
     $I->see('Registered successfully!');
     $I->seeLink('Go back to Home');
     $I->click('Go back to Home');
     $I->seeInCurrentUrl('/');
 }
Ejemplo n.º 10
0
 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.');
 }
 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']);
 }
 public function _before(AcceptanceTester $I)
 {
     $I->wantTo('Enable the ST, TM, MT Plugins');
     $I->loginAsAdmin();
     //Only if Run this test Seperately
     $I->amGoingTo('ST, TM, Media');
     $I->amOnPluginsPage();
     //In order that the activatePlugin() works, the webdriver needs to be in Plugins page
     $I->activatePlugin('wpml-string-translation');
     $I->wait(1);
     $I->activatePlugin('wpml-translation-management');
     $I->wait(1);
     $I->activatePlugin('wpml-media');
     //to be checked because it shows error
 }
Ejemplo n.º 13
0
 /**
  * @depends installCmc
  */
 public function initializeCmcSettings(\AcceptanceTester $I)
 {
     $I->doAdministratorLogin();
     $I->comment('Mailchimp API Key from acceptance.suite.yml (see _support/AcceptanceHelper.php)');
     $key = $I->getConfiguration('api_key');
     $I->amGoingTo('Navigate to CMC page in /administrator/');
     $I->amOnPage('administrator/index.php?option=com_cmc&view=cpanel');
     // Wait for text dashboard - wait for text not working
     $I->waitForElementVisible('#ctitle');
     $I->checkForPhpNoticesOrWarnings();
     // Options
     $I->click('Options');
     $I->waitForText('Configuration', '30', ['css' => 'h1']);
     $I->fillField(['id' => 'jform_api_key'], $key);
     $I->click('Save & Close');
     // Basck in the dashboard
     $I->waitForElementVisible('#ctitle');
     $I->doAdministratorLogout();
 }
Ejemplo n.º 14
0
<?php

/* @var $scenario Codeception\Scenario */
$I = new AcceptanceTester($scenario);
$I->wantTo('Memastikan "Employee" bekerja');
/* TESTING INDEX EMPLOYEE */
$I->amGoingTo('cek halaman daftar employee');
$I->amOnPage('employee/index');
$I->expectTo('judul halaman "Daftar Employee", dan tombol Create');
$I->see('Daftar Employee', 'h1');
$I->see('CREATE', 'a');
/* TESTING CREATE EMPLOYEE */
$I->wantTo('Memastikan "Create Employee" bekerja');
$I->amGoingTo('cek halaman create employee');
$I->amOnPage('employee/create');
$I->see('Employee', 'h1');
$I->see('SIMPAN', 'button');
$I->seeElement('input', ['name' => 'Employee[name]']);
$I->seeElement('input', ['name' => 'Employee[age]']);
$I->amGoingTo('submit form dengan data input kosong');
$I->click('button[type="submit"]');
$I->expectTo('Validasi eror muncul!');
$I->see('Name cannot be blank.');
$I->see('Age cannot be blank.');
$I->amGoingTo('submit form dengan data data');
$I->fillField('input[name="Employee[name]"]', 'Hafid');
$I->fillField('input[name="Employee[age]"]', '30');
$I->click('button[type="submit"]');
$I->expectTo('submit form berhasil');
$I->see('Data berhasil disimpan');
Ejemplo n.º 15
0
 public function doCreateCustomerOrder(\AcceptanceTester $I)
 {
     $I->amGoingTo('submit an order for delivery');
     $this->doRegistration($I);
     $I->login('*****@*****.**', 'pass123456');
     $this->doAddMenuWithOptionToOrder($I);
     $I->amOnPage('/checkout');
     $I->click('#checkout .btn-group .btn:not(.active)');
     $I->click('Payment');
     $I->selectOption('#payment input[name=payment]', 'cod');
     $I->click('Confirm', '.buttons');
     $I->expectTo('see the order confirmation page');
     $I->see('Thanks for shopping with us online!', 'div');
     $I->see('This is a collection order.');
 }
Ejemplo n.º 16
0
<?php

// @group mandatory
$I = new AcceptanceTester($scenario);
$I->wantTo('ensure that JavaScript works');
$I->amGoingTo('check javascript with a modal');
$I->amOnPage('/en-us');
$I->dontSee('#infoModal');
$I->click('footer .pull-left a');
$I->waitForElementVisible('#infoModal', 3);
$I->seeElement('#infoModal');
$I->makeScreenshot('modal');
$I->click('#infoModal .close');
$I->dontSee('#infoModal');
Ejemplo n.º 17
0
 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']);
 }
Ejemplo n.º 18
0
$I->see("foo article abstract content", ".abstract");
// see that the content in the editing field matches the iframe content
$I->expectTo("see the content in the editing field match the article preview");
$I->switchToIFrame();
$I->seeInField("input#title_input", "Foo Test");
// make a change to a default field (always visible)
$I->amGoingto("change the title");
$I->switchToIframe();
$I->seeInField("#title_input", "Foo Test");
$I->fillField("#title_input", "New Title");
// see change in iframe
$I->expectTo("see the change I made reflected in the preview frame");
$I->switchToIFrame("editing_iframe");
$I->see("New Title", ".title");
// make a change to a dynamic field (stored in Field db)
$I->amGoingTo("change the xxx field");
$I->switchToIframe();
$I->seeInField("#abstract_input", "foo article abstract content");
$I->fillField("#abstract_input", "New abstract");
// see change in iframe
$I->expectTo("see the change I made reflected in the preview frame");
$I->switchToIFrame("editing_iframe");
$I->see("New abstract", ".abstract");
// click save
$I->amGoingTo("save the article");
$I->switchToIframe();
$I->click("Save");
// see change in the dashboard
$I->expectTo("see the change I made reflected in the dashboard");
$I->amOnPage("/spectre/dashboard");
$I->see("New Title");
Ejemplo n.º 19
0
<?php

// @group onlyCrud
use tests\_pages\LoginPage;
$I = new AcceptanceTester($scenario);
$I->wantTo('ensure that crudOnly works (no access rules)');
$I->amOnPage('/onlyCrud/country');
$I->see('Countries', 'h1');
$I->makeScreenshot('crud-country');
$I->expectTo('see view, edit and delete button');
$I->seeElementInDOM('[data-key="1"] .glyphicon-file');
$I->seeElementInDOM('[data-key="2"] .glyphicon-pencil');
$I->seeElementInDOM('[data-key="3"] .glyphicon-trash');
$I->amGoingTo('create a Country');
$I->click('New');
$I->see('Country', 'h1');
$I->see('Create', '.btn');
$I->fillField('#country-country', 'Xyzland');
$I->makeScreenshot('crud-pre-create-country');
$I->click('Create');
$I->wait(1);
$I->see('Xyzland', 'table');
$I->see('Country', 'table');
$I->makeScreenshot('crud-create-country');
$I->click('Edit');
$I->wait(1);
$I->seeInField('#country-country', 'Xyzland');
$I->see('Country', 'h1');
$I->fillField('#country-country', 'Abcstan');
$I->click('Save');
$I->wait(1);
Ejemplo n.º 20
0
 public function customer_会員登録戻る(\AcceptanceTester $I)
 {
     $I->wantTo('EF0401-UC01-T05 会員登録 戻るボタン');
     $I->amOnPage('/entry');
     $faker = Fixtures::get('faker');
     $new_email = microtime(true) . '.' . $faker->safeEmail;
     // 会員情報入力フォームに、会員情報を入力する
     // 「同意する」ボタンを押下する
     $form = ['entry[name][name01]' => '姓', 'entry[name][name02]' => '名', 'entry[kana][kana01]' => 'セイ', 'entry[kana][kana02]' => 'メイ', 'entry[zip][zip01]' => '530', 'entry[zip][zip02]' => '0001', 'entry[address][pref]' => 27, 'entry[address][addr01]' => '大阪市北区', 'entry[address][addr02]' => '梅田2-4-9 ブリーゼタワー13F', 'entry[tel][tel01]' => '111', 'entry[tel][tel02]' => '111', 'entry[tel][tel03]' => '111', 'entry[email][first]' => $new_email, 'entry[email][second]' => $new_email, 'entry[password][first]' => 'password', 'entry[password][second]' => 'password'];
     $findPluginByCode = Fixtures::get('findPluginByCode');
     $Plugin = $findPluginByCode('MailMagazine');
     if ($Plugin) {
         $I->amGoingTo('メルマガプラグインを発見したため、メルマガを購読します');
         $form['entry[mailmaga_flg]'] = '1';
     }
     $I->submitForm("#main_middle form", $form);
     $I->click('#main_middle form .btn_group p:nth-child(2) button');
     $I->see('新規会員登録', '#main_middle h1');
 }
Ejemplo n.º 21
0
<?php

use schmunk42\giiant\tests\_pages\LoginPage;
#new schmunk42\giiant\tests\_pages\LoginPage;
$I = new AcceptanceTester($scenario);
$I->wantTo('ensure that crud works with access rules');
$I->amOnPage('/crud/actor');
$I->dontSee('Actor', 'h2');
$I->makeScreenshot('crud-actor-login');
$I->see('Sign in', 'h3');
$I->amGoingTo('try to login with correct credentials');
// TODO: use LoginPage
$username = '******';
$password = '******';
$I->fillField('input[name="login-form[login]"]', $username);
$I->fillField('input[name="login-form[password]"]', $password);
$I->click('Sign in');
$I->waitForElement('#link-logout', 5);
#LoginPage::openBy($I);
#$loginPage = LoginPage::openBy($I);
#$loginPage->login('admin', 'admin');
$I->see('Actor', 'h2');
$I->makeScreenshot('crud-actor');
 public function systeminfo_メンバー管理編集実施(\AcceptanceTester $I)
 {
     $I->wantTo('EA0803-UC02-T01 メンバー管理 - 編集 - 編集実施');
     // 表示
     $config = Fixtures::get('config');
     $I->amOnPage('/' . $config['admin_route'] . '/setting/system/member');
     $I->see('システム設定メンバー管理', '#main .page-header');
     $I->click('#main .container-fluid .table_list .table tbody tr:nth-child(1) td:nth-child(5) .dropdown a');
     $I->click('#main .container-fluid .table_list .table tbody tr:nth-child(1) td:nth-child(5) .dropdown .dropdown-menu li:nth-child(1) a');
     $I->see('メンバー登録・編集', '#main .container-fluid div:nth-child(1) .box-header .box-title');
     $I->fillField(['id' => 'admin_member_name'], 'administrator');
     $I->click('#aside_column button');
     // FIXME 以下の不具合のためシステムエラーが発生する
     // https://github.com/EC-CUBE/eccube-api/pull/60
     $findPluginByCode = Fixtures::get('findPluginByCode');
     $Plugin = $findPluginByCode('EccubeApi');
     if ($Plugin) {
         $I->amGoingTo('EccubeApi プラグインを発見したため、不具合を回避しました。 詳細: https://github.com/EC-CUBE/eccube-api/pull/60');
     } else {
         $I->see('メンバーを保存しました。', '#main .container-fluid div:nth-child(1) .alert-success');
         $I->see('メンバー管理', '#main .container-fluid div:nth-child(1) .box-header .box-title');
         $I->see('administrator', '#main .container-fluid .table_list .table tbody tr:nth-child(1) td:nth-child(1)');
     }
 }
Ejemplo n.º 23
0
 public function mypage_会員情報編集(\AcceptanceTester $I)
 {
     $I->wantTo('EF0504-UC01-T01 Mypage 会員情報編集');
     $createCustomer = Fixtures::get('createCustomer');
     $customer = $createCustomer();
     $I->loginAsMember($customer->getEmail(), 'password');
     $faker = Fixtures::get('faker');
     $new_email = microtime(true) . '.' . $faker->safeEmail;
     // TOPページ>マイページ>会員情報編集
     $I->amOnPage('/mypage');
     $I->click('#main_middle .local_nav ul li:nth-child(3) a');
     // 会員情報フォームに既存の登録情報が表示される
     $I->seeInField(['id' => 'entry_name_name01'], $customer->getName01());
     $form = ['entry[name][name01]' => '姓05', 'entry[name][name02]' => '名05', 'entry[kana][kana01]' => 'セイ', 'entry[kana][kana02]' => 'メイ', 'entry[zip][zip01]' => '530', 'entry[zip][zip02]' => '0001', 'entry[address][pref]' => 27, 'entry[address][addr01]' => '大阪市北区', 'entry[address][addr02]' => '梅田2-4-9 ブリーゼタワー13F', 'entry[tel][tel01]' => '111', 'entry[tel][tel02]' => '111', 'entry[tel][tel03]' => '111', 'entry[email][first]' => $new_email, 'entry[email][second]' => $new_email, 'entry[password][first]' => 'password', 'entry[password][second]' => 'password'];
     $findPluginByCode = Fixtures::get('findPluginByCode');
     $Plugin = $findPluginByCode('MailMagazine');
     if ($Plugin) {
         $I->amGoingTo('メルマガプラグインを発見したため、メルマガを購読します');
         // 必須入力が効いてない https://github.com/EC-CUBE/mail-magazine-plugin/issues/29
         $form['entry[mailmaga_flg]'] = '1';
     }
     // 会員情報フォームに会員情報を入力する
     $I->submitForm("#main_middle form", $form);
     // 会員情報編集(完了)画面が表示される
     $I->see('会員情報編集(完了)', '#main_middle .page-heading');
     // 「トップページへ」ボタンを押下する
     $I->click('#main_middle #deliveradd_input .btn_group p a');
     // TOPページヘ遷移する
     $I->see('新着情報', '#contents_bottom #news_area h2');
 }
Ejemplo n.º 24
0
<?php

$I = new AcceptanceTester($scenario);
$I->wantTo("change a post slug");
$I->loginAs("*****@*****.**", "secret");
$I->OpenAnArticle("foo-test");
$I->amGoingTo("change the article slug");
$I->seeInField("#slug_input", "foo-test");
$I->fillField("#slug_input", "bar-test");
$I->click("Save");
$I->expect("the article slug to have changed");
$I->OpenAnArticle("bar-test");
$I->seeInField("#slug_input", "bar-test");
<?php

$I = new AcceptanceTester($scenario);
$I->am('a visitor');
$I->amGoingTo('use the ad contact form');
// Messaging system is ON by default, so I am getting the login form instead.
$I->amOnPage('/jobs/title-for-the-ad.html');
$I->see('Send Message', 'a');
Ejemplo n.º 26
0
<?php

use tests\codeception\_pages\LoginPage;
$I = new AcceptanceTester($scenario);
$I->wantTo('login as admin');
$I->amGoingTo('try to login as admin');
$loginPage = LoginPage::openBy($I);
$loginPage->login('admin', 'admin');
$I->see('admin', '#link-user-menu');
$I->makeScreenshot('admin-login-frontend');
Ejemplo n.º 27
0
<?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

$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');
Ejemplo n.º 29
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]');
Ejemplo n.º 30
0
$I = new AcceptanceTester($scenario);
$I->wantTo("create a new article");
$I->loginAs("*****@*****.**", "secret");
// see I'm on the dashboard and click to create a new article
$I->expectTo("see a link to make a new article");
$I->see("New Post", "a");
$I->click("New Post");
// see that a new post appears in the iframe
$I->expectTo("see a blank post template in the preview frame");
$I->see("Editing Frame");
$I->switchToIFrame("editing_iframe");
$I->waitForElement(".title");
$I->see("", ".title");
// set the article title
$I->amGoingTo("change the title");
$I->switchToIFrame();
$I->fillField("#title_input", "Brand New Post");
// set the article slug
$I->amGoingTo("set the slug");
$I->fillField("#slug_input", "brand-new-post");
// see changes in iframe
$I->expectTo("see new title in the preview");
$I->switchToIFrame("editing_iframe");
$I->see("Brand New Post", ".title");
// save changes
$I->amGoingTo("save changes");
$I->switchToIFrame();
$I->click("Save");
// see new article in dashboard
$I->expectTo("See new article in the dashboard");