Ejemplo n.º 1
0
 /**
  * @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));
 }
Ejemplo n.º 2
0
 /**
  * @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));
     });
 }
 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 there should not be :email administrator anymore
  */
 public function thereShouldBeNoAnymore($email)
 {
     Assert::false($this->indexPage->isSingleResourceOnPage(['email' => $email]), sprintf('Administrator with %s email should be deleted', $email));
 }
 /**
  * @Then /^(this customer group) should still be named "([^"]+)"$/
  */
 public function thisChannelNameShouldBe(CustomerGroupInterface $customerGroup, $customerGroupName)
 {
     $this->iWantToBrowseCustomerGroupsOfTheStore();
     Assert::true($this->indexPage->isSingleResourceOnPage(['name' => $customerGroup->getName()]), sprintf('Customer group name %s has not been assigned properly.', $customerGroupName));
 }
 /**
  * @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 coupon) should still exist in the registry$/
  */
 public function couponShouldStillExistInTheRegistry(PromotionCouponInterface $coupon)
 {
     Assert::true($this->indexPage->isSingleResourceOnPage(['code' => $coupon->getCode()]), sprintf('Coupon with code %s should exist.', $coupon->getCode()));
 }
 /**
  * @param ShippingMethodInterface $shippingMethod
  * @param bool $state
  */
 private function assertShippingMethodState(ShippingMethodInterface $shippingMethod, $state)
 {
     $this->iWantToBrowseShippingMethods();
     Assert::true($this->indexPage->isSingleResourceOnPage(['name' => $shippingMethod->getName(), 'enabled' => $state]), sprintf('Shipping method with name %s and state %s has not been found.', $shippingMethod->getName(), $state));
 }
Ejemplo n.º 9
0
 /**
  * @param int $count
  *
  * @throws \InvalidArgumentException
  */
 private function assertCountOfExchangeRatesOnTheList($count)
 {
     $actualCount = $this->indexPage->countItems();
     Assert::same($actualCount, (int) $count, 'Expected %2$d exchange rates to be on the list, but found %d instead.');
 }
Ejemplo n.º 10
0
 /**
  * @Given /^(country "([^"]*)") should appear in the store$/
  */
 public function countryWithNameShouldAppearInTheStore(CountryInterface $country)
 {
     expect($this->countryIndexPage->isResourceOnPage(['code' => $country->getCode()]))->toBe(true);
 }
 /**
  * @Then there should still be only one shipping category with code :code
  */
 public function thereShouldStillBeOnlyOneShippingCategoryWith($code)
 {
     $this->iWantToBrowseShippingCategories();
     Assert::true($this->indexPage->isSingleResourceOnPage(['code' => $code]), sprintf('Shipping method with code %s cannot be found.', $code));
 }
 /**
  * @Then the last product attribute on the list should have name :name
  */
 public function theLastProductAttributeOnTheListShouldHave($name)
 {
     $fields = $this->indexPage->getColumnFields('name');
     $actualName = end($fields);
     Assert::same($actualName, $name, sprintf('Expected last product attribute\'s name to be "%s", but it is "%s".', $name, $actualName));
 }
 /**
  * @Then /^(this variant) should not exist in the product catalog$/
  */
 public function productVariantShouldNotExist(ProductVariantInterface $productVariant)
 {
     $this->iWantToViewAllVariantsOfThisProduct($productVariant->getProduct());
     Assert::false($this->indexPage->isSingleResourceOnPage(['name' => $productVariant->getName()]), sprintf('Product variant with code %s exists but should not.', $productVariant->getName()));
 }
Ejemplo n.º 14
0
 function it_throws_an_exception_if_resource_can_not_be_founded_on_page(IndexPageInterface $indexPage)
 {
     $indexPage->isResourceOnPage(['name' => 'Norwegian'])->willReturn(false);
     $this->shouldThrow(NotEqualException::class)->during('storeShouldBeAvailableInLanguage', ['Norwegian']);
 }
Ejemplo n.º 15
0
 /**
  * @Then the order :order should have order payment state :orderPaymentState
  * @Then /^(this order) should have order payment state "([^"]+)"$/
  * @Then /^(its) payment state should be "([^"]+)"$/
  */
 public function theOrderShouldHavePaymentState(OrderInterface $order, $orderPaymentState)
 {
     Assert::true($this->indexPage->isSingleResourceOnPage(['payment state' => $orderPaymentState]), sprintf('Cannot find order with "%s" order payment state in the list.', $orderPaymentState));
 }
 /**
  * @Then the static content :title should no longer exist in the store
  */
 public function theStaticContentShouldNoLongerExistInTheStore($title)
 {
     Assert::false($this->indexPage->isSingleResourceOnPage(['title' => $title]), sprintf('Static content with title %s exists, but should not.', $title));
 }
Ejemplo n.º 17
0
 /**
  * @Then there should still be only one payment method with :element :code
  */
 public function thereShouldStillBeOnlyOnePaymentMethodWith($element, $code)
 {
     $this->iBrowsePaymentMethods();
     Assert::true($this->indexPage->isSingleResourceOnPage([$element => $code]), sprintf('Payment method with %s %s cannot be found.', $element, $code));
 }
 /**
  * @Then /^(this customer group) should no longer exist in the registry$/
  */
 public function thisCustomerGroupShouldNoLongerExistInTheRegistry(CustomerGroupInterface $customerGroup)
 {
     Assert::false($this->indexPage->isSingleResourceOnPage(['name' => $customerGroup->getName()]), sprintf('Customer group %s should no longer exist in the registry', $customerGroup->getName()));
 }
Ejemplo n.º 19
0
 /**
  * @Given product with :element :value should not be added
  */
 public function productWithNameShouldNotBeAdded($element, $value)
 {
     $this->iWantToBrowseProducts();
     Assert::false($this->indexPage->isSingleResourceOnPage([$element => $value]), sprintf('Product with %s %s was created, but it should not.', $element, $value));
 }
Ejemplo n.º 20
0
 /**
  * @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()));
 }
Ejemplo n.º 21
0
 /**
  * @Then /^I should see (\d+) product options in the list$/
  */
 public function iShouldSeeProductOptionsInTheList($amount)
 {
     $foundRows = $this->indexPage->countItems();
     Assert::same((int) $amount, $foundRows, '%2$s rows with product options should appear on page, %s rows has been found');
 }
Ejemplo n.º 22
0
 function it_throws_not_equal_exception_if_country_does_not_appear_in_the_store(IndexPageInterface $countryIndexPage, CountryInterface $country)
 {
     $country->getCode()->willReturn('FR');
     $countryIndexPage->isResourceOnPage(['code' => 'FR'])->willReturn(false);
     $this->shouldThrow(NotEqualException::class)->during('countryWithNameShouldAppearInTheStore', [$country]);
 }
Ejemplo n.º 23
0
 /**
  * @Then /^I should(?:| still) see the (zone named "([^"]+)") in the list$/
  */
 public function iShouldSeeTheZoneNamedInTheList(ZoneInterface $zone)
 {
     Assert::true($this->indexPage->isSingleResourceOnPage(['code' => $zone->getCode(), 'name' => $zone->getName()]), sprintf('Zone named %s should exist in the registry', $zone->getName()));
 }
 /**
  * @Then /^(this product attribute) should no longer exist in the registry$/
  */
 public function thisProductAttributeShouldNoLongerExistInTheRegistry(AttributeInterface $productAttribute)
 {
     Assert::false($this->indexPage->isSingleResourceOnPage(['code' => $productAttribute->getCode()]), sprintf('Product attribute %s should no exist in the registry, but it does.', $productAttribute->getName()));
 }
 /**
  * @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.');
 }
Ejemplo n.º 26
0
 /**
  * @Then it should have a :state state
  */
 public function itShouldHaveState($state)
 {
     $this->indexPage->isSingleResourceOnPage(['state' => $state]);
 }
Ejemplo n.º 27
0
 /**
  * @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));
 }
Ejemplo n.º 28
0
 /**
  * @Then I should not see the order with number :orderNumber in the list
  */
 public function iShouldNotSeeASingleOrderFromCustomer($orderNumber)
 {
     Assert::false($this->indexPage->isSingleResourceOnPage(['number' => $orderNumber]), sprintf('Cannot find order with number "%s" in the list.', $orderNumber));
 }
Ejemplo n.º 29
0
 /**
  * @Then I should see the order :orderNumber with total :total
  */
 public function iShouldSeeTheOrderWithTotal($orderNumber, $total)
 {
     Assert::true($this->indexPage->isSingleResourceOnPage(['Total' => $total]), sprintf('The total of order "%s" is not "%s".', $orderNumber, $total));
 }
Ejemplo n.º 30
0
 /**
  * @Then the store should be available in the :name language
  */
 public function storeShouldBeAvailableInLanguage($name)
 {
     expect($this->indexPage->isResourceOnPage(['name' => $name]))->toBe(true);
 }