/** * @Then the route with content :title should not be added */ public function theRouteWithContentShouldNotBeAdded($title) { if (!$this->indexPage->isOpen()) { $this->indexPage->open(); } Assert::false($this->indexPage->isSingleResourceOnPage(['content' => $title]), sprintf('Found route with content "%s" assigned, but expected not to.', $title)); }
/** * @Then /^(the administrator) should see the order with total "([^"]+)" in order list$/ */ public function theAdministratorShouldSeeTheOrderWithTotalInOrderList(AdminUserInterface $user, $total) { $this->sharedSecurityService->performActionAsAdminUser($user, function () use($total) { $this->indexPage->open(); Assert::true($this->indexPage->isSingleResourceOnPage(['total' => $total]), sprintf('The order with total "%s" has not been found.', $total)); }); }
/** * @When I browse product options */ public function iBrowseProductOptions() { $this->indexPage->open(); }
/** * @When I delete shipping method :shippingMethod * @When I try to delete shipping method :shippingMethod */ public function iDeleteShippingMethod(ShippingMethodInterface $shippingMethod) { $this->indexPage->open(); $this->indexPage->deleteResourceOnPage(['name' => $shippingMethod->getName()]); }
/** * @Given I am browsing products * @When I want to browse products */ public function iWantToBrowseProducts() { $this->indexPage->open(); }
function it_throws_an_exception_if_resource_with_given_name_exist_but_it_should_not(IndexPageInterface $indexPage) { $indexPage->open()->shouldBeCalled(); $indexPage->isResourceOnPage(['name' => 'Food and Beverage'])->willReturn(true); $this->shouldThrow(new \InvalidArgumentException('Tax category with name Food and Beverage was created, but it should not.'))->during('taxCategoryWithElementValueShouldNotBeAdded', ['name', 'Food and Beverage']); }
/** * @Then this administrator should not be added */ public function thisAdministratorShouldNotBeAdded() { $this->indexPage->open(); Assert::same(1, $this->indexPage->countItems(), 'There should not be any new administrators'); }
/** * @When I want to browse customer groups of the store */ public function iWantToBrowseCustomerGroupsOfTheStore() { $this->indexPage->open(); }
/** * @Then tax category with :element :name should not be added */ public function taxCategoryWithElementValueShouldNotBeAdded($element, $name) { $this->indexPage->open(); Assert::false($this->indexPage->isSingleResourceOnPage([$element => $name]), sprintf('Tax category with %s %s was created, but it should not.', $element, $name)); }
/** * @Then /^(this order) should not exist in the registry$/ */ public function orderShouldNotExistInTheRegistry(OrderInterface $order) { $this->indexPage->open(); Assert::false($this->indexPage->isSingleResourceOnPage(['number' => $order->getNumber()]), sprintf('Order with number %s exists but should not.', $order->getNumber())); }
/** * @Then /^(this customer) should be disabled$/ */ public function thisCustomerShouldBeDisabled(CustomerInterface $customer) { $this->indexPage->open(); Assert::eq('No', $this->indexPage->getCustomerAccountStatus($customer), 'Customer account should be disabled, but it does not.'); }
/** * @When /^I delete (this product attribute)$/ */ public function iDeleteThisProductAttribute(AttributeInterface $productAttribute) { $this->indexPage->open(); $this->indexPage->deleteResourceOnPage(['code' => $productAttribute->getCode(), 'name' => $productAttribute->getName()]); }
/** * @Then /^I should see (\d+) customer groups in the list$/ */ public function iShouldSeeCustomerGroupsInTheList($amountOfCustomerGroups) { $this->indexPage->open(); Assert::same((int) $amountOfCustomerGroups, $this->indexPage->countItems(), sprintf('Amount of customer groups should be equal %s, but is %s.', $amountOfCustomerGroups, $this->indexPage->countItems())); }
/** * @When /^I browse shipping categories$/ */ public function iWantToBrowseShippingCategories() { $this->indexPage->open(); }
/** * @When /^I want to view all variants of (this product)$/ */ public function iWantToViewAllVariantsOfThisProduct(ProductInterface $product) { $this->indexPage->open(['productId' => $product->getId()]); }
/** * @Then /^there should still be only one coupon with code "([^"]+)" related to (this promotion)$/ */ public function thereShouldStillBeOnlyOneCouponWithCodeRelatedTo($code, PromotionInterface $promotion) { $this->indexPage->open(['promotionId' => $promotion->getId()]); Assert::true($this->indexPage->isSingleResourceOnPage(['code' => $code]), sprintf('There is no coupon with code %s.', $code)); }
/** * @Then zone with :element :value should not be added */ public function zoneWithNameShouldNotBeAdded($element, $value) { $this->indexPage->open(); Assert::false($this->indexPage->isSingleResourceOnPage([$element => $value]), sprintf('Zone with %s %s was added, but it should not.', $element, $value)); }
/** * @When I browse orders of a customer :customer */ public function iBrowseOrdersOfACustomer(CustomerInterface $customer) { $this->ordersIndexPage->open(['id' => $customer->getId()]); }
/** * @When I delete static content :title */ public function iDeleteStaticContent($title) { $this->indexPage->open(); $this->indexPage->deleteResourceOnPage(['title' => $title]); }
/** * @Given I am browsing payment methods * @When I browse payment methods */ public function iBrowsePaymentMethods() { $this->indexPage->open(); }
/** * @param TaxRateInterface $taxRate * @param string $element * @param string $taxRateElement */ private function assertFieldValue(TaxRateInterface $taxRate, $element, $taxRateElement) { $this->indexPage->open(); Assert::true($this->indexPage->isResourceOnPage(['code' => $taxRate->getCode(), $element => $taxRateElement]), sprintf('Tax rate %s %s has not been assigned properly.', $element, $taxRateElement)); }
/** * @Then the exchange rate between :sourceCurrencyName and :targetCurrencyName should not be added * @Then the exchange rate with source currency :sourceCurrencyName should not be added * @Then the exchange rate with target currency :targetCurrencyName should not be added */ public function theExchangeRateBetweenAndShouldNotBeAdded($sourceCurrencyName, $targetCurrencyName) { $this->indexPage->open(); $this->assertExchangeRateIsNotOnTheList($sourceCurrencyName, $targetCurrencyName); }
/** * @Given I am browsing orders * @When I browse orders */ public function iBrowseOrders() { $this->indexPage->open(); }
/** * @Then the product association type :productAssociationType should appear in the store */ public function theProductAssociationTypeShouldAppearInTheStore(ProductAssociationTypeInterface $productAssociationType) { $this->indexPage->open(); Assert::true($this->indexPage->isSingleResourceOnPage(['name' => $productAssociationType->getName()]), sprintf('Product association type with name %s should exist but it does not.', $productAssociationType->getName())); }