1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00
invoiceninja/tests/acceptance/InvoiceDesignCest.php
2015-09-01 21:40:30 +03:00

58 lines
1.8 KiB
PHP

<?php
use \AcceptanceTester;
use Faker\Factory;
class InvoiceDesignCest
{
private $faker;
public function _before(AcceptanceTester $I)
{
$I->checkIfLogin($I);
$this->faker = Factory::create();
}
public function _after(AcceptanceTester $I)
{
}
// tests
public function updateInvoiceDesign(AcceptanceTester $I)
{
$I->wantTo('Design my invoice');
$I->amOnPage('/company/advanced_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('$("#primary_color + .sp-replacer .sp-preview-inner").attr("style", "background-color: rgb(0,98,254);")');
$I->executeJS('$(".sp-container:nth-child(1) .sp-choose").click()');
$I->click('#secondary_color + .sp-replacer');
$I->executeJS('$("#secondary_color").val("#aa6709")');
//$I->executeJS('$("#secondary_color + .sp-replacer .sp-preview-inner").attr("style", "background-color: rgb(254,0,50);")');
$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]);
}
}