mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-14 07:02:34 +01:00
60 lines
1.8 KiB
PHP
60 lines
1.8 KiB
PHP
|
<?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);
|
||
|
|
||
|
$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->checkOption('#terms_checkbox');
|
||
|
$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');
|
||
|
}
|
||
|
}
|