本文整理汇总了PHP中Mtf\Factory\Factory::getPageFactory方法的典型用法代码示例。如果您正苦于以下问题:PHP Factory::getPageFactory方法的具体用法?PHP Factory::getPageFactory怎么用?PHP Factory::getPageFactory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mtf\Factory\Factory
的用法示例。
在下文中一共展示了Factory::getPageFactory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testCreateNewLocalizedStoreView
/**
* @ZephyrId MAGETWO-12405
*/
public function testCreateNewLocalizedStoreView()
{
$objectManager = Factory::getObjectManager();
$storeFixture = $objectManager->create('\\Magento\\Store\\Test\\Fixture\\Store', ['dataSet' => 'german']);
$storeListPage = Factory::getPageFactory()->getAdminSystemStore();
$storeListPage->open();
$storeListPage->getGridPageActions()->addStoreView();
$newStorePage = Factory::getPageFactory()->getAdminSystemStoreNewStore();
$newStorePage->getStoreForm()->fill($storeFixture);
$newStorePage->getFormPageActions()->save();
$storeListPage->getMessagesBlock()->assertSuccessMessage();
$this->assertContains('The store view has been saved', $storeListPage->getMessagesBlock()->getSuccessMessages());
$this->assertTrue($storeListPage->getStoreGrid()->isStoreExists($storeFixture->getName()));
$cachePage = Factory::getPageFactory()->getAdminCache();
$cachePage->open();
$cachePage->getActionsBlock()->flushCacheStorage();
$cachePage->getMessagesBlock()->assertSuccessMessage();
$configPage = Factory::getPageFactory()->getAdminSystemConfig();
$configPage->open();
$configPage->getPageActions()->selectStore(['Main Website', $storeFixture->getGroupId(), $storeFixture->getName()]);
$configGroup = $configPage->getForm()->getGroup('Locale Options');
$configGroup->open();
$configGroup->setValue('select-groups-locale-fields-code-value', 'German (Germany)');
$configPage->getPageActions()->save();
$configPage->getMessagesBlock()->assertSuccessMessage();
$homePage = Factory::getPageFactory()->getCmsIndexIndex();
$homePage->open();
$homePage->getStoreSwitcherBlock()->selectStoreView($storeFixture->getName());
$this->assertTrue($homePage->getSearchBlock()->isPlaceholderContains('Den gesamten Shop durchsuchen'));
}
示例2: testUrlRewriteCreation
/**
* Adding temporary redirect for product
*
* @return void
* @ZephyrId MAGETWO-12409
*/
public function testUrlRewriteCreation()
{
/** @var UrlRewriteProduct $urlRewriteProduct */
$urlRewriteProduct = Factory::getFixtureFactory()->getMagentoUrlRewriteUrlRewriteProduct();
$urlRewriteProduct->switchData('product_with_temporary_redirect');
//Pages & Blocks
$urlRewriteGridPage = Factory::getPageFactory()->getAdminUrlrewriteIndex();
$pageActionsBlock = $urlRewriteGridPage->getPageActionsBlock();
$urlRewriteEditPage = Factory::getPageFactory()->getAdminUrlrewriteEdit();
$categoryTreeBlock = $urlRewriteEditPage->getTreeBlock();
$productGridBlock = $urlRewriteEditPage->getProductGridBlock();
$typeSelectorBlock = $urlRewriteEditPage->getUrlRewriteTypeSelectorBlock();
$urlRewriteInfoForm = $urlRewriteEditPage->getFormBlock();
//Steps
Factory::getApp()->magentoBackendLoginUser();
$urlRewriteGridPage->open();
$pageActionsBlock->addNew();
$typeSelectorBlock->selectType($urlRewriteProduct->getUrlRewriteType());
$productGridBlock->searchAndSelect(['sku' => $urlRewriteProduct->getProductSku()]);
$categoryTreeBlock->selectCategory($urlRewriteProduct->getCategoryName());
$urlRewriteInfoForm->fill($urlRewriteProduct);
$urlRewriteEditPage->getPageMainActions()->save();
$this->assertContains('The URL Rewrite has been saved.', $urlRewriteGridPage->getMessagesBlock()->getSuccessMessages());
$this->assertUrlRedirect($_ENV['app_frontend_url'] . $urlRewriteProduct->getRewrittenRequestPath(), $_ENV['app_frontend_url'] . $urlRewriteProduct->getOriginalRequestPath());
}
示例3: testCreateCustomer
/**
* Create Customer account on frontend
*
* @ZephyrId MAGETWO-12394
*/
public function testCreateCustomer()
{
//Data
$customer = Factory::getFixtureFactory()->getMagentoCustomerCustomer();
$customer->switchData('customer_US_1');
$customerAddress = $customer->getAddressData();
//Page
$homePage = Factory::getPageFactory()->getCmsIndexIndex();
$createPage = Factory::getPageFactory()->getCustomerAccountCreate();
$accountIndexPage = Factory::getPageFactory()->getCustomerAccountIndex();
$addressEditPage = Factory::getPageFactory()->getCustomerAddressEdit();
//Step 1 Create Account
$homePage->open();
$topLinks = $homePage->getLinksBlock();
$topLinks->openLink('Register');
$createPage->getRegisterForm()->registerCustomer($customer);
//Verifying
$this->assertContains('Thank you for registering', $accountIndexPage->getMessages()->getSuccessMessages());
//Check that customer redirected to Dashboard after registration
$this->assertContains('My Dashboard', $accountIndexPage->getTitleBlock()->getTitle());
//Step 2 Set Billing Address
$accountIndexPage->getDashboardAddress()->editBillingAddress();
$addressEditPage->getEditForm()->editCustomerAddress($customerAddress);
//Verifying
$accountIndexPage = Factory::getPageFactory()->getCustomerAccountIndex();
$this->assertContains('The address has been saved', $accountIndexPage->getMessages()->getSuccessMessages());
//Verify customer address against previously entered data
$accountIndexPage->open();
$accountIndexPage->getDashboardAddress()->editBillingAddress();
$addressEditPage = Factory::getPageFactory()->getCustomerAddressEdit();
$this->verifyCustomerAddress($customerAddress, $addressEditPage->getEditForm());
}
示例4: testCreateConfigurableProduct
/**
* Edit configurable product and add new options to attribute
*
* @ZephyrId MAGETWO-12840
* @return void
*/
public function testCreateConfigurableProduct()
{
//Preconditions
//Preparing Data for original product
$configurable = Factory::getFixtureFactory()->getMagentoCatalogConfigurableProduct();
$configurable->switchData('configurable');
$configurable->persist();
$productSku = $configurable->getProductSku();
//Preparing Data for editing product
$editProduct = $configurable->getEditData();
//Steps
$createProductPage = Factory::getPageFactory()->getCatalogProductNew();
$productForm = $createProductPage->getProductForm();
//Login
Factory::getApp()->magentoBackendLoginUser();
$productGridPage = Factory::getPageFactory()->getCatalogProductIndex();
$productGridPage->open();
//Search and open original configurable product
$productGridPage->getProductGrid()->searchAndOpen(['sku' => $productSku]);
//Editing product options
$productForm->fill($editProduct);
$createProductPage->getFormAction()->save();
//Verifying
$createProductPage->getMessagesBlock()->assertSuccessMessage();
//Flush cache
$cachePage = Factory::getPageFactory()->getAdminCache();
$cachePage->open();
$cachePage->getActionsBlock()->flushMagentoCache();
//Verifying
$this->assertOnGrid($editProduct);
$this->assertOnFrontend($editProduct);
}
示例5: test
/**
* Test admin login to backend
*
* @param SuperAdmin $fixture
*/
public function test(SuperAdmin $fixture)
{
//Page
$loginPage = Factory::getPageFactory()->getAdminAuthLogin();
//Steps
$loginPage->open();
$loginPage->getLoginBlock()->fill($fixture);
$loginPage->getLoginBlock()->submit();
}
示例6: persist
/**
* Create product
*
* @param FixtureInterface $fixture [optional]
* @return mixed|string
*/
public function persist(FixtureInterface $fixture = null)
{
Factory::getApp()->magentoBackendLoginUser();
$createProductPage = Factory::getPageFactory()->getCatalogProductNew();
$createProductPage->open(['type' => $fixture->getDataConfig()['create_url_params']['type'], 'set' => $fixture->getDataConfig()['create_url_params']['set']]);
$createProductPage->getProductForm()->fill($fixture);
$createProductPage->getFormPageActions()->save();
$createProductPage->getMessagesBlock()->assertSuccessMessage();
}
示例7: assertCategoryOnFrontend
/**
* Verify category on the frontend
*
* @param Category $category
*/
protected function assertCategoryOnFrontend(Category $category)
{
//Open created category on frontend
$frontendHomePage = Factory::getPageFactory()->getCmsIndexIndex();
$frontendHomePage->open();
$navigationMenu = $frontendHomePage->getTopmenu();
$navigationMenu->selectCategoryByName($category->getCategoryName());
$this->assertEquals($category->getCategoryName(), $frontendHomePage->getTitleBlock()->getTitle());
}
示例8: persist
/**
* Create product
*
* @param FixtureInterface $fixture [optional]
* @return mixed|string
*/
public function persist(FixtureInterface $fixture = null)
{
Factory::getApp()->magentoBackendLoginUser();
$createProductPage = Factory::getPageFactory()->getCatalogProductNew();
$createProductPage->init($fixture);
$createProductPage->open();
$productForm = $createProductPage->getProductForm();
$productForm->fill($fixture);
$createProductPage->getFormAction()->save();
$createProductPage->getMessagesBlock()->assertSuccessMessage();
}
示例9: assertAbsenceOnCategory
/**
* Assert absence product on category page (frontend)
*
* @param Product $product
* @return void
*/
protected function assertAbsenceOnCategory(Product $product)
{
//Pages
$frontendHomePage = Factory::getPageFactory()->getCmsIndexIndex();
$categoryPage = Factory::getPageFactory()->getCatalogCategoryView();
//Steps
$frontendHomePage->open();
$frontendHomePage->getTopmenu()->selectCategoryByName($product->getCategoryName());
//Verification on category product list
$productListBlock = $categoryPage->getListProductBlock();
$this->assertFalse($productListBlock->isProductVisible($product->getName()));
}
示例10: persist
/**
* Execute handler
*
* @param FixtureInterface $fixture [optional]
* @return mixed
*/
public function persist(FixtureInterface $fixture = null)
{
/** @var \Magento\Customer\Test\Fixture\Address $fixture */
// Pages
$loginPage = Factory::getPageFactory()->getCustomerAccountLogin();
$addressPage = Factory::getPageFactory()->getCustomerAddressEdit();
$loginPage->open();
if ($loginPage->getLoginBlock()->isVisible()) {
$loginPage->getLoginBlock()->login($fixture->getCustomer());
}
$addressPage->open();
$addressPage->getEditForm()->editCustomerAddress($fixture);
}
示例11: testForgotPassword
/**
* Reset password on frontend
*/
public function testForgotPassword()
{
// Create Customer
$customer = Factory::getFixtureFactory()->getMagentoCustomerCustomer();
$customer->switchData('customer_US_1');
$customer->persist();
$customerAccountLoginPage = Factory::getPageFactory()->getCustomerAccountLogin();
$forgotPasswordPage = Factory::getPageFactory()->getCustomerAccountForgotpassword();
$forgotPasswordPage->open();
$forgotPasswordPage->getForgotPasswordForm()->resetForgotPassword($customer);
//Verifying
$message = sprintf('If there is an account associated with %s you will receive an email with a link to reset your password.', $customer->getEmail());
$this->assertContains($message, $customerAccountLoginPage->getMessages()->getSuccessMessages());
}
示例12: _assertOnGrid
/**
* Assert existing tax rule on manage tax rule grid
*
* @param TaxRule $fixture
*/
protected function _assertOnGrid(TaxRule $fixture)
{
//Data
$filter = ['code' => $fixture->getCode(), 'tax_rate' => implode(', ', $fixture->getTaxRate())];
if ($fixture->getTaxCustomerClass() !== null) {
$filter['tax_customer_class'] = implode(', ', $fixture->getTaxCustomerClass());
}
if ($fixture->getTaxProductClass() !== null) {
$filter['tax_product_class'] = implode(', ', $fixture->getTaxProductClass());
}
//Verification
$taxGridPage = Factory::getPageFactory()->getTaxRuleIndex();
$taxGridPage->open();
$this->assertTrue($taxGridPage->getTaxRuleGrid()->isRowVisible($filter), 'New tax rule was not found.');
}
示例13: persist
/**
* Login admin user
*
* @param FixtureInterface $fixture [optional]
* @return void|mixed
*/
public function persist(FixtureInterface $fixture = null)
{
if (null === $fixture) {
$fixture = Factory::getFixtureFactory()->getMagentoBackendAdminSuperAdmin();
}
$loginPage = Factory::getPageFactory()->getAdminAuthLogin();
$loginForm = $loginPage->getLoginBlock();
$adminHeaderPanel = $loginPage->getHeaderBlock();
if (!$adminHeaderPanel || !$adminHeaderPanel->isVisible()) {
$loginPage->open();
if ($adminHeaderPanel->isVisible()) {
return;
}
$loginForm->fill($fixture);
$loginForm->submit();
$loginPage->waitForHeaderBlock();
}
}
示例14: testCreateCustomer
/**
* New customer creation in backend
*
* @ZephyrId MAGETWO-12516
*/
public function testCreateCustomer()
{
//Data
$customerFixture = Factory::getFixtureFactory()->getMagentoCustomerCustomer();
$customerFixture->switchData('backend_customer');
$searchData = array('email' => $customerFixture->getEmail());
//Pages
$customerPage = Factory::getPageFactory()->getCustomerIndex();
$customerCreatePage = Factory::getPageFactory()->getCustomerIndexNew();
//Steps
$customerPage->open();
$customerPage->getPageActionsBlock()->addNew();
$customerCreatePage->getCustomerForm()->fillCustomer($customerFixture);
$customerCreatePage->getPageActionsBlock()->saveAndContinue();
$customerCreatePage->getMessagesBlock()->assertSuccessMessage();
//Verifying
$customerPage->open();
$this->assertTrue($customerPage->getCustomerGridBlock()->isRowVisible($searchData), 'Customer email "' . $searchData['email'] . '" not found in the grid');
}
示例15: test
/**
* Adding permanent redirect for category
*
* @param UrlRewriteCategory $urlRewriteCategory
* @return void
* @ZephyrId MAGETWO-12407
*/
public function test(\Magento\UrlRewrite\Test\Fixture\UrlRewriteCategory $urlRewriteCategory)
{
$urlRewriteCategory->switchData('category_with_permanent_redirect');
//Pages & Blocks
$urlRewriteIndexPage = Factory::getPageFactory()->getAdminUrlrewriteIndex();
$pageActionsBlock = $urlRewriteIndexPage->getPageActionsBlock();
$urlRewriteEditPage = Factory::getPageFactory()->getAdminUrlrewriteEdit();
$categoryTreeBlock = $urlRewriteEditPage->getTreeBlock();
$urlRewriteInfoForm = $urlRewriteEditPage->getFormBlock();
//Steps
Factory::getApp()->magentoBackendLoginUser();
$urlRewriteIndexPage->open();
$pageActionsBlock->addNew();
$categoryTreeBlock->selectCategory($urlRewriteCategory->getCategoryName());
$urlRewriteInfoForm->fill($urlRewriteCategory);
$urlRewriteEditPage->getPageMainActions()->save();
$this->assertContains('The URL Rewrite has been saved.', $urlRewriteIndexPage->getMessagesBlock()->getSuccessMessages());
$this->assertUrlRedirect($_ENV['app_frontend_url'] . $urlRewriteCategory->getRewrittenRequestPath(), $_ENV['app_frontend_url'] . $urlRewriteCategory->getOriginalRequestPath());
}