1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00
invoiceninja/tests/acceptance/GoProCest.php

60 lines
1.8 KiB
PHP
Raw Normal View History

<?php
use Codeception\Util\Fixtures;
use \AcceptanceTester;
use Faker\Factory;
class GoProCest
{
private $faker;
public function _before(AcceptanceTester $I)
{
$this->faker = Factory::create();
}
public function signUpAndGoPro(AcceptanceTester $I)
{
$userEmail = $this->faker->safeEmail;
$userPassword = $this->faker->password;
$I->wantTo('test purchasing a pro plan');
$I->amOnPage('/invoice_now');
$I->click('Sign Up');
$I->wait(1);
2015-10-13 09:11:44 +02:00
$I->checkOption('#terms_checkbox');
$I->fillField(['name' =>'new_first_name'], $this->faker->firstName);
$I->fillField(['name' =>'new_last_name'], $this->faker->lastName);
$I->fillField(['name' =>'new_email'], $userEmail);
$I->fillField(['name' =>'new_password'], $userPassword);
$I->click('Save');
$I->wait(1);
$I->amOnPage('/dashboard');
$I->click('Go Pro');
$I->wait(1);
$I->click('Upgrade Now!');
$I->wait(1);
$I->fillField(['name' => 'address1'], $this->faker->streetAddress);
$I->fillField(['name' => 'address2'], $this->faker->streetAddress);
$I->fillField(['name' => 'city'], $this->faker->city);
$I->fillField(['name' => 'state'], $this->faker->state);
$I->fillField(['name' => 'postal_code'], $this->faker->postcode);
$I->selectDropdown($I, 'United States', '.country-select .dropdown-toggle');
$I->fillField(['name' => 'card_number'], '4242424242424242');
$I->fillField(['name' => 'cvv'], '1234');
$I->selectOption('#expiration_month', 12);
$I->selectOption('#expiration_year', date('Y'));
$I->click('.btn-success');
$I->wait(1);
$I->see('Successfully applied payment');
$I->amOnPage('/dashboard');
$I->dontSee('Go Pro');
}
}