diff --git a/codeception.yml b/codeception.yml new file mode 100644 index 0000000..f636cf0 --- /dev/null +++ b/codeception.yml @@ -0,0 +1,13 @@ +actor: AcceptanceTester +namespace: ahnames\hipanel\tests +paths: + tests: tests + output: "%COMMON_TESTS_LOCATION%/_output" + data: tests/_data + support: tests/_support + envs: tests/_envs +extensions: + enabled: + - Codeception\Extension\RunFailed +params: + - '%PARAMS_LOCATION%' diff --git a/tests/_output/.gitignore b/tests/_output/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/tests/_output/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/tests/_support/AcceptanceTester.php b/tests/_support/AcceptanceTester.php new file mode 100644 index 0000000..32f0c16 --- /dev/null +++ b/tests/_support/AcceptanceTester.php @@ -0,0 +1,26 @@ +fields = [ + 'name' => uniqid(), + 'type' => 'Certificate tariff', + 'client' => 'hipanel_test_manager@hiqdev.com', + 'currency' => 'USD', + 'note' => 'test note', + ]; + $page = new PlanCreatePage($I, $this->fields); + $this->id = $page->createPlan(); + } + + public function ensureThatICanAddPrices(Manager $I): void + { + $I->needPage(Url::to(['@plan/view', 'id' => $this->id])); + $I->see('No prices found'); + $price = new PriceCertificateCreate($I, $this->id); + $price->addPrices('Certificate tariff'); + $price->ensureThereNoSuggestions('Certificate tariff'); + } + + public function ensureICanUpdatePrices(Manager $I): void + { + $price = new PriceCertificateUpdate($I, $this->id); + $price->updatePrices(); + } +} diff --git a/tests/acceptance/module/finance/manager/DomainCrudCest.php b/tests/acceptance/module/finance/manager/DomainCrudCest.php new file mode 100644 index 0000000..d5a9ecf --- /dev/null +++ b/tests/acceptance/module/finance/manager/DomainCrudCest.php @@ -0,0 +1,50 @@ +fields = [ + 'name' => uniqid(), + 'type' => 'Domain tariff', + 'client' => 'hipanel_test_manager@hiqdev.com', + 'currency' => 'USD', + 'note' => 'test note', + ]; + $page = new PlanCreatePage($I, $this->fields); + $this->id = $page->createPlan(); + } + + public function ensureThatICanAddPrices(Manager $I): void + { + $I->needPage(Url::to(['@plan/view', 'id' => $this->id])); + $I->see('No prices found'); + $price = new PriceDomainCreate($I, $this->id); + $price->addPrices('Default Tariff'); + $price->ensureThereNoSuggestions('Default Tariff'); + } + + public function ensureICanUpdatePrices(Manager $I): void + { + $price = new PriceDomainUpdate($I, $this->id); + $price->updatePrices(); + } +}