/**
  * Create custom URL Rewrite
  *
  * @param UrlRewrite $urlRewrite
  * @return void
  */
 public function test(UrlRewrite $urlRewrite)
 {
     $this->urlRewriteIndex->open();
     $this->urlRewriteIndex->getPageActionsBlock()->addNew();
     $this->urlRewriteEdit->getUrlRewriteTypeSelectorBlock()->selectType('Custom');
     $this->urlRewriteEdit->getFormBlock()->fill($urlRewrite);
     $this->urlRewriteEdit->getPageMainActions()->save();
 }
 /**
  * Update category URL rewrites
  *
  * @param UrlRewrite $categoryRedirect
  * @param UrlRewrite $urlRewrite
  * @return void
  */
 public function testUpdateCategoryUrlRewrite(UrlRewrite $categoryRedirect, UrlRewrite $urlRewrite)
 {
     //Steps
     $this->urlRewriteIndex->open();
     $filter = ['request_path' => $categoryRedirect->getRequestPath()];
     $this->urlRewriteIndex->getUrlRedirectGrid()->searchAndOpen($filter);
     $this->urlRewriteEdit->getFormBlock()->fill($urlRewrite);
     $this->urlRewriteEdit->getPageMainActions()->save();
 }
 /**
  * Test check create category rewrites
  *
  * @param UrlRewrite $urlRewrite
  * @param CatalogCategory $category
  * @return void
  */
 public function testCreateCategoryRewrite(UrlRewrite $urlRewrite, CatalogCategory $category)
 {
     //Steps
     $this->urlRewriteIndex->open();
     $this->urlRewriteIndex->getPageActionsBlock()->addNew();
     $this->urlRewriteEdit->getTreeBlock()->selectCategory($category->getName());
     $this->urlRewriteEdit->getFormBlock()->fill($urlRewrite);
     $this->urlRewriteEdit->getPageMainActions()->save();
 }
 /**
  * Update category URL rewrites
  *
  * @param UrlRewrite $categoryRedirect
  * @param UrlRewrite $urlRewrite
  * @return void
  */
 public function test(UrlRewrite $categoryRedirect, UrlRewrite $urlRewrite)
 {
     $this->markTestIncomplete('MAGETWO-26967');
     //Steps
     $this->urlRewriteIndex->open();
     $filter = ['request_path' => $categoryRedirect->getRequestPath()];
     $this->urlRewriteIndex->getUrlRedirectGrid()->searchAndOpen($filter);
     $this->urlRewriteEdit->getFormBlock()->fill($urlRewrite);
     $this->urlRewriteEdit->getPageMainActions()->save();
 }
 /**
  * Update custom URL Rewrite
  *
  * @param UrlRewrite $initialRewrite
  * @param UrlRewrite $urlRewrite
  * @return void
  */
 public function test(UrlRewrite $initialRewrite, UrlRewrite $urlRewrite)
 {
     //Precondition
     $initialRewrite->persist();
     //Steps
     $this->urlRewriteIndex->open();
     $filter = ['request_path' => $initialRewrite->getRequestPath()];
     $replaceData = $this->getReplaceData($initialRewrite);
     $this->urlRewriteIndex->getUrlRedirectGrid()->searchAndOpen($filter);
     $this->urlRewriteEdit->getFormBlock()->fill($urlRewrite, null, $replaceData);
     $this->urlRewriteEdit->getPageMainActions()->save();
 }
 /**
  * Update product URL rewrites
  *
  * @param UrlRewrite $urlRewrite
  * @param FixtureFactory $fixtureFactory
  * @return void
  */
 public function testUpdateProductUrlRewrite(UrlRewrite $urlRewrite, FixtureFactory $fixtureFactory)
 {
     /** @var UrlRewrite $productRedirect */
     $productRedirect = $fixtureFactory->createByCode('urlRewrite', ['dataSet' => 'default', 'data' => ['id_path' => [$urlRewrite->getIdPath()]]]);
     $productRedirect->persist();
     //Steps
     $this->urlRewriteIndex->open();
     $filter = ['request_path' => $productRedirect->getRequestPath()];
     $this->urlRewriteIndex->getUrlRedirectGrid()->searchAndOpen($filter);
     $this->urlRewriteEdit->getFormBlock()->fill($urlRewrite);
     $this->urlRewriteEdit->getPageMainActions()->save();
 }
 /**
  * Create CMS page rewrites
  *
  * @param CmsPage $cmsPage
  * @param UrlRewrite $urlRewrite
  * @return void
  */
 public function testCmsPageRewrite(CmsPage $cmsPage, UrlRewrite $urlRewrite)
 {
     //Preconditions
     $cmsPage->persist();
     //Steps
     $this->urlRewriteIndex->open();
     $this->urlRewriteIndex->getPageActionsBlock()->addNew();
     $this->urlRewriteEdit->getUrlRewriteTypeSelectorBlock()->selectType('For CMS page');
     $filter = ['title' => $cmsPage->getTitle()];
     $this->urlRewriteEdit->getCmsGridBlock()->searchAndOpen($filter);
     $this->urlRewriteEdit->getFormBlock()->fill($urlRewrite);
     $this->urlRewriteEdit->getPageMainActions()->save();
 }
 /**
  * Create product URL Rewrite
  *
  * @param CatalogProductSimple $product
  * @param UrlRewrite $urlRewrite
  * @return void
  */
 public function testProductUrlRewrite(CatalogProductSimple $product, UrlRewrite $urlRewrite)
 {
     //Precondition
     $product->persist();
     $filter = ['id' => $product->getId()];
     //Steps
     $this->urlRewriteIndex->open();
     $this->urlRewriteIndex->getPageActionsBlock()->addNew();
     $this->urlRewriteEdit->getUrlRewriteTypeSelectorBlock()->selectType('For product');
     $this->urlRewriteEdit->getProductGridBlock()->searchAndOpen($filter);
     $this->urlRewriteEdit->getTreeBlock()->skipCategorySelection();
     $this->urlRewriteEdit->getFormBlock()->fill($urlRewrite);
     $this->urlRewriteEdit->getPageMainActions()->save();
 }