Skip to content

nhp/tt_magetest

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Goal

The main goal is to create a test for every single page in default magento, frontend and admin.

Another objective is to write the tests configurable so one can just create a module, reset the defaults in config.xml to fit their needs and run the tests.

Furthermore it should be easy to extend to allow it to easily cover third-party modules.

Version

The included tests are based on Magento 1.9.1 CE with sample data but if you modify the XMLs it should work on any magento where Xtest can run.

Requirements

Xtest from Code-x (https://github.com/code-x/Xtest)

Selenium server (http://docs.seleniumhq.org/download/)

Phpunit (included in Xtest)

Magento (of course) with sampledata (to run the included tests)

Usage

Of course you can use Xtest as normal (see Documentation) but you can do simple Pagetests with minimal effort with this module.

For a complete overwiew have a look at: config.xml
The basics are covered below:

Test multiple Frontend-Pages by url

place just an other URL-Element into /config/default/xtest/frontendtest/urls following this schema:

<url_1>
<url>/about-magento-demo-store</url>
<rendername>FE_Footer_AboutPage</rendername>
<assert>
<a1><![CDATA[class=" cms-page-view cms-about-magento-demo-store"]]></a1>
</assert>
</url_1>

Test multiple Adminhtml-Pages by url

place just an other URL-Element into /config/default/xtest/admintest/urls following this schema:

<url_1>
<url>/admin/sales_order/index</url>
<rendername>ADM_Sales_OrderIndex</rendername>
<assert>
<a1><![CDATA[<a href="#" name="real_order_id" title="asc" class="not-sort">]]></a1>
</assert>
</url_1>
You can configure the admin-user by changing /config/default/xtest/admintest/user

Test multiple customer account-Pages

place just an other URL-Element into /config/default/xtest/customertest/urls following this schema:

<url_1>
<url>/customer/account/index</url>
<assert>
<a1><![CDATA[<body class=" customer-account-index customer-account">]]></a1>
</assert>
<rendername>FE_Customer_Dashboard</rendername>
</url_1>
You can configure the customer accounts by changing /config/default/xtest/customertest/customers
Please note that all URLs will be called for all accounts.

Test multiple product pages

place just an other URL-Element into /config/default/xtest/producttest/products following this schema:

<sku_1>
<sku>hbm010</sku>
<assert>
<a1><![CDATA[<div class="price-box">]]></a1>
<a2><![CDATA[<span class="regular-price" id="product-price-]]></a2>
<a3><![CDATA[<span class="price">]]></a3>
</assert>
<rendername>FE_Product_hbm010</rendername>
</sku_1>

Test multiple category pages

place just an other URL-Element into /config/default/xtest/catalogtest/categories following this schema:

<cat_1>
<catid>22</catid>
<assert>
<a1><![CDATA[<div class="sort-by">]]></a1>
<a2><![CDATA[<div class="product-info">]]></a2>
<a3><![CDATA[<div class="price-box">]]></a3>
</assert>
</cat_1>

Test a page 'interactive' (click an an element and then assert)

place just an other URL-Element into /config/default/xtest/catalogtest/categories following this schema:

<url_1>
<url>/</url>
<rendername>FE_CustomerAccount</rendername>
<clickon><![CDATA[#header div.skip-links > div.account-cart-wrapper > a]]></clickon>
<assert>
<a1><![CDATA[<a class="skip-link skip-account skip-active" data-target-element="#header-account" href="[[unsecure_base_url]]customer/account/">]]></a1>
<a2><![CDATA[<div class="header-minicart">]]></a2>
</assert>
</url_1>

Test the checkout

Just have a look at config.xml at /config/default/xtest/checkouttest as well as xtext.xml at /config/default/xtest/selenium/checkout

Configuring Test to fit for customized templates

Just have a look at config.xml at /config/default/xtest/pageconfig, you can configure every aspect covered in this module.

About

Suite for flexible and via XML configurable checking all page types in stock Magento

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%