public function updateInvoiceDesign(AcceptanceTester $I)
 {
     $I->wantTo('Design my invoice');
     $I->amOnPage('/settings/invoice_design');
     $I->click('select#invoice_design_id');
     $I->click('select#invoice_design_id option:nth-child(2)');
     $I->fillField('#font_size', 10);
     $I->click('#primary_color + .sp-replacer');
     $I->executeJS('$("#primary_color").val("#7364b6")');
     $I->executeJS('$(".sp-container:nth-child(1) .sp-choose").click()');
     $I->click('#secondary_color + .sp-replacer');
     $I->executeJS('$("#secondary_color").val("#aa6709")');
     $I->executeJS('$(".sp-container:nth-child(2) .sp-choose").click()');
     /*
     $I->fillField(['name' => 'labels_item'], $this->faker->text(6));
     $I->fillField(['name' => 'labels_description'], $this->faker->text(12));
     $I->fillField(['name' => 'labels_unit_cost'], $this->faker->text(12));
     $I->fillField(['name' => 'labels_quantity'], $this->faker->text(8));
     
     $I->uncheckOption('#hide_quantity');
     $I->checkOption('#hide_paid_to_date');
     */
     $I->click('Save');
     $I->wait(3);
     $I->seeInDatabase('accounts', ['font_size' => 10]);
 }
Esempio n. 2
0
 public function i_can_edit_the_users_email(\AcceptanceTester $I)
 {
     $I->clickNode('#attribute3-node');
     $I->fillField('text', '*****@*****.**');
     $I->click('button.dvs-sidebar-save-group');
     $I->wait(self::WAIT_TIME);
     $I->seeInDatabase('users', array('email' => '*****@*****.**'));
 }
Esempio n. 3
0
 public function it_register_a_valide_user(AcceptanceTester $I)
 {
     $name = 'a';
     $email = 'a@a.a';
     $I->register(compact('name', 'email'));
     $I->dontSee('username');
     $I->seeInDatabase('users', ['username' => $name, 'email' => $email]);
 }
Esempio n. 4
0
 public function editTask(AcceptanceTester $I)
 {
     $description = $this->faker->text(100);
     $I->wantTo('edit a task');
     $I->amOnPage('/tasks/1/edit');
     $I->seeCurrentUrlEquals('/tasks/1/edit');
     $I->fillField('#description', $description);
     $I->click('Save');
     $I->seeInDatabase('tasks', ['description' => $description]);
 }
Esempio n. 5
0
 public function i_can_save_this_model(\AcceptanceTester $I)
 {
     $value = $I->generateRandomString();
     $I->clickNode('#model0-node');
     $I->click('.dvs-sidebar-elements button');
     $I->waitForElement('#dvs-sidebar-field-form', 5);
     $I->fillField('text', $value);
     $I->click('button.dvs-sidebar-save-group');
     $I->wait(10);
     $I->seeInDatabase('dvs_test_models', array('id' => 1, 'name' => $value));
 }
Esempio n. 6
0
 public function editInvoice(AcceptanceTester $I)
 {
     $I->wantTo('edit an invoice');
     $I->amOnPage('/invoices/1/edit');
     //change po_number with random number
     $po_number = rand(100, 300);
     $I->fillField('#po_number', $po_number);
     //save
     $I->executeJS('submitAction()');
     $I->wait(1);
     //check if po_number was updated
     $I->seeInDatabase('invoices', ['po_number' => $po_number]);
 }
Esempio n. 7
0
 public function i_can_create_a_new_user(\AcceptanceTester $I)
 {
     $I->clickNode('#creatorcreator-933e76acb06dec2ba6c31ba9c058a4e9-node');
     $I->click('button[data-creator-attribute-name="Name"]');
     $I->waitForElement('#dvs-sidebar-field-form', self::WAIT_TIME);
     $I->fillField('text', 'tester');
     $I->click('a[data-breadcrumb-id="0"]');
     $I->wait(1);
     $I->click('button[data-creator-attribute-name="Email"]');
     $I->waitForElement('#dvs-sidebar-field-form', self::WAIT_TIME);
     $I->fillField('text', '*****@*****.**');
     $I->click('a[data-breadcrumb-id="0"]');
     $I->wait(1);
     $I->click('button[data-creator-attribute-name="Password"]');
     $I->waitForElement('#dvs-sidebar-field-form', self::WAIT_TIME);
     $I->fillField('text', 'password');
     $I->click('button.dvs-sidebar-save-group');
     $I->wait(self::WAIT_TIME);
     $I->seeInDatabase('users', array('email' => '*****@*****.**'));
 }
Esempio n. 8
0
 public function editInvoice(AcceptanceTester $I)
 {
     $I->wantTo('edit an invoice');
     // Check all language files
     $count = $I->grabNumRecords('date_formats');
     for ($i = 1; $i <= $count; $i++) {
         $format = $I->grabFromDatabase('date_formats', 'format', ['id' => $i]);
         $date = mktime(0, 0, 0, 12, 31, date('Y'));
         $value = date($format, $date);
         $I->amOnPage('/settings/localization');
         $I->selectOption('date_format_id', $value);
         $I->click('Save');
         //change po_number with random number
         $I->amOnPage('/invoices/1/edit');
         $po_number = rand(100, 300);
         $I->fillField('#po_number', $po_number);
         //save
         $I->executeJS('submitAction()');
         $I->wait(1);
         //check if po_number was updated
         $I->seeInDatabase('invoices', ['po_number' => $po_number, 'invoice_date' => date('Y-m-d')]);
     }
 }
Esempio n. 9
0
//--------------------------------------------------------------------
// Error without info
//--------------------------------------------------------------------
$I->expect('the form is not submitted');
$I->seeElement('#submit');
$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');
Esempio n. 10
0
<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('add a new user and see it in database');
$I->amOnPage('/login');
$I->click('Sign Up With Email');
$I->fillField('firstname', 'Phanbook');
$I->fillField('email', '*****@*****.**');
$I->fillField('username', 'phannook');
$I->click('Sign in');
$I->seeInDatabase('users', ['email' => '*****@*****.**', 'username' => 'phannook', 'firstname' => 'Phanbook']);
Esempio n. 11
0
<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('add a new user and see it in database');
$I->amOnPage('/oauth/login');
$I->see('Sign In');
$I->submitForm('#login-form', ['email' => '*****@*****.**', 'password' => '123456', 'remember' => true], 'Sign In');
$I->amOnPage('/oauth/register/signup');
$I->fillField('firstname', 'Phanbook');
$I->fillField('email', '*****@*****.**');
$I->fillField('username', 'admin');
$I->click('Sign in');
$I->seeInDatabase('users', ['email' => '*****@*****.**', 'username' => 'admin']);
Esempio n. 12
0
<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('sign in');
$I->amOnPage('user/login');
$I->fillField('email', '*****@*****.**');
$I->fillField('password', 'adminn');
$I->click('Login', '.btn-primary');
$I->amOnPage('/');
$I->see('admin');
$I->seeInDatabase('users', ['email' => '*****@*****.**']);
$I->amOnPage('user/profile');
$I->see('Birthday');
$I->click('Create a new post');
$I->see('Title');
$I->seeInCurrentUrl('post/create');
$I->click('Create a new post', '.btn-primary');
$I->see('The title field is required.');
$I->see('The content field is required.');
Esempio n. 13
0
<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('see the Home page');
$I->amOnPage('/');
$I->see('My albums');
$I->seeInDatabase('album', array('artist' => 'Adele', 'title' => '21'));
$I->seeLink('Add new album');
$I->click('Add new album');
$I->see('Title');
$I->see('Artist');
$I->seeCurrentUrlEquals('/album/add');
$I->fillField('title', 'foo');
$I->fillField('artist', 'bar');
// enable repopulate and cleanup in codeception.yml to reset the db before each test
// enabld module Db in acceptance.suite.yml to use this feature
// click submit to add the new album
//$I->dontSee('foo');
//$I->click('submit');
//$I->see('foo');
Esempio n. 14
0
<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('add a new user and see it in the database');
$I->amOnPage('/');
$I->fillField('email', '*****@*****.**');
$I->click('Add User');
$I->seeInDatabase('users', ['email' => '*****@*****.**']);
$I->see('*****@*****.**', 'li');
Esempio n. 15
0
<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('check users info in datebase');
$I->seeInDatabase('user', array('mail' => 'test@test'));