Skip to content

Commit

Permalink
[Tax rate][Behat] Add include tax rate step in add tax feature
Browse files Browse the repository at this point in the history
  • Loading branch information
hatem20 authored and jakubtobiasz committed Feb 15, 2023
1 parent 55c6a06 commit 03c3438
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,4 @@ Feature: Adding a new tax rate
And I add it
Then I should be notified that it has been successfully created
And the tax rate "United States Sales Tax" should appear in the registry
And the tax rate "United States Sales Tax" should be included in price
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
namespace Sylius\Behat\Context\Ui\Admin;

use Behat\Behat\Context\Context;
use Sylius\Behat\Element\Admin\TaxRate\FilterElementInterface;
use Sylius\Behat\Page\Admin\Crud\IndexPageInterface;
use Sylius\Behat\Page\Admin\TaxRate\CreatePageInterface;
use Sylius\Behat\Page\Admin\TaxRate\UpdatePageInterface;
Expand Down
6 changes: 6 additions & 0 deletions src/Sylius/Behat/Page/Admin/TaxRate/UpdatePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ public function removeZone(): void
$this->getDocument()->selectFieldOption('Zone', 'Select');
}

public function isIncludedInPrice(): bool
{
return (bool) $this->getElement('includedInPrice')->getValue();
}

protected function getCodeElement(): NodeElement
{
return $this->getElement('code');
Expand All @@ -40,6 +45,7 @@ protected function getDefinedElements(): array
'code' => '#sylius_tax_rate_code',
'name' => '#sylius_tax_rate_name',
'zone' => '#sylius_tax_rate_zone',
'includedInPrice' => '#sylius_tax_rate_includedInPrice'
]);
}
}

0 comments on commit 03c3438

Please sign in to comment.