m (add cat UI Link, automatically update 'Last Edited', link to Ja Codex) |
m (Restore old version) |
||
(92 intermediate revisions by 29 users not shown) | |||
Line 2: | Line 2: | ||
{{en|Theme Unit Test}} |
{{en|Theme Unit Test}} |
||
{{ja|Theme Unit Test}} |
{{ja|Theme Unit Test}} |
||
+ | {{es|Prueba Unitaria de Temas}} |
||
}} |
}} |
||
Line 8: | Line 9: | ||
This step in [[Theme_Development#Theme_Testing_Process|Theme testing]] correlates to a WordPress export (WXR) file that you can import into a WordPress installation to test your Theme. To be clear, this is only one step in testing your Theme. See [[Theme_Development#Theme_Testing_Process|Theme testing]] for a full guide. |
This step in [[Theme_Development#Theme_Testing_Process|Theme testing]] correlates to a WordPress export (WXR) file that you can import into a WordPress installation to test your Theme. To be clear, this is only one step in testing your Theme. See [[Theme_Development#Theme_Testing_Process|Theme testing]] for a full guide. |
||
− | == |
+ | == Setup == |
− | # Download test data: http://svn.automattic.com/wpcom-themes/test-data.2010-08-02.xml |
||
− | # Import test data into your WordPress install. Do this by going to Tools -> Import. |
||
− | # Each "test" is a post or page described in the sections below. |
||
− | == |
+ | === Test Environment Setup === |
+ | # Clone the theme test data file <code>themeunittestdata.wordpress.xml</code> from the GitHub repository https://github.com/WPTT/theme-unit-test (last updated 30/January/2020). |
||
− | When viewing multiple posts (<tt>index.php</tt>): |
||
+ | Or Download a copy from https://raw.githubusercontent.com/WPTT/theme-unit-test/master/themeunittestdata.wordpress.xml |
||
+ | # Import test data into your WordPress install by going to Tools => Import => WordPress |
||
+ | # Select the XML file from your computer |
||
+ | # Click on "Upload file and import". |
||
+ | # Under "Import Attachments," check the "Download and import file attachments" box and click submit.<br />Note: you may have to repeat the Import step until you see "All Done" to obtain the full list of Posts and Media. |
||
+ | # Read [https://make.wordpress.org/themes/handbook/get-involved/become-a-reviewer/ Becoming a reviewer], and follow the easy steps. |
||
+ | ==== Test Environment Installer Package ==== |
||
+ | If you want to have famous 5 minute installation package for theme unit test environment, you can find it here: https://github.com/Evinceknow/Theme-Unit-Test-Environment-for-WordPress. Setup it as WordPress main installation package. |
||
+ | |||
+ | ==== I18N Test Data ==== |
||
+ | - [https://github.com/jawordpressorg/theme-test-data-ja Japanese Test Data] |
||
+ | |||
+ | === WordPress Settings === |
||
+ | Adjust WordPress settings as follows: |
||
+ | * Settings -> General: set the Site Title to something fairly long, and set the Tagline to something even longer. These settings will facilitate testing how the Theme handles these values. |
||
+ | * Settings -> Reading: set "Blog pages show at most" to 5. This setting will ensure that index/archive pagination is triggered. |
||
+ | * Settings -> Discussion: enable Threaded Comments, at least 3 levels deep. This setting will facilitate testing of Theme comment list styling. |
||
+ | * Settings -> Discussion: enable Break comments into pages, and set 5 comments per page. This setting will facilitate testing of Theme paginating link markup/styling. |
||
+ | * Settings -> Media: ensure that no values are set for max width or height of Embedded media. This setting will facilitate testing of the Theme $content_width setting/implementation. Note: If you are using the most recent version of WordPress, ignore this setting as it has been removed (https://core.trac.wordpress.org/ticket/21719). |
||
+ | * Settings -> Permalinks: ensure that a non-default permalink setting is selected, e.g. "Month and name". This setting will facilitate stepping through the Theme Unit Tests. |
||
+ | |||
+ | Create at least two Custom Menus: |
||
+ | * Long Menu: all included Pages |
||
+ | * Short Menu: a menu of 2-3 Pages |
||
+ | |||
+ | == Template Hierarchy Index Pages == |
||
+ | |||
+ | When viewing any Template Hierarchy Index page, including the default index page (<tt>index.php</tt>), and (''if applicable'') Blog Posts Index (<tt>home.php</tt>), Date Archives (<tt>archive.php</tt>), Category Archives (<tt>category.php</tt>), Tag Archives (<tt>tag.php</tt>), or Author Archives (<tt>author.php</tt>): |
||
+ | * Posts display correctly, with no apparent visual problems or errors. |
||
* Posts display in correct order. |
* Posts display in correct order. |
||
* Correct number of posts display (as per setting in ''Settings'' > ''Reading''). |
* Correct number of posts display (as per setting in ''Settings'' > ''Reading''). |
||
+ | * Page navigation displays and works correctly. |
||
+ | * Debugger returns no PHP errors, warnings, or notices. |
||
+ | * The browser reports no JavaScript errors. |
||
+ | == Static Front Page == |
||
− | Test the following posts when viewing multiple posts. Post titles in the test data correlate with section titles below. |
||
+ | If the Theme includes either a <tt>front-page.php</tt> or a <tt>home.php</tt> template file, go to Dashboard -> Settings -> Reading, and set the Front Page to display a Static Page (use any existing Page), and set the Blog Posts index to another Static Page (e.g. "Lorem Ipsum"). |
||
+ | * The Front Page displays properly, and as intended |
||
+ | * The Blog Posts index page displays properly |
||
+ | * Debugger returns no PHP errors, warnings, or notices |
||
+ | * The browser reports no JavaScript errors |
||
+ | |||
+ | == 404 Page == |
||
+ | * The 404 page displays properly |
||
+ | * Some content is displayed, more than merely the basic "Error 404 - Page Not Found" message - such as some helpful text, a search form, a list of Post or Pages, etc. |
||
+ | * Debugger returns no PHP errors, warnings, or notices |
||
+ | * The browser reports no JavaScript errors |
||
+ | |||
+ | == Search Results Page == |
||
+ | * The Search Results page displays properly, with search query results displayed. |
||
+ | * Debugger returns no PHP errors, warnings, or notices |
||
+ | * The browser reports no JavaScript errors |
||
+ | |||
+ | == Blog Posts Index Page == |
||
+ | |||
+ | Test the following posts when viewing the Blog Posts Index page. Post Titles in the test data correlate with section titles below. |
||
=== Scheduled Post === |
=== Scheduled Post === |
||
− | * Should not be displayed by the Theme (status "scheduled", rather than " |
+ | * Should not be displayed by the Theme (status "scheduled", rather than "publish"). |
=== Draft Post === |
=== Draft Post === |
||
− | * Should not be displayed by the Theme (status "draft", rather than " |
+ | * Should not be displayed by the Theme (status "draft", rather than "publish"). |
=== Layout Test === |
=== Layout Test === |
||
* Displays properly as a "Sticky Post." |
* Displays properly as a "Sticky Post." |
||
− | * Page navigation links display properly. |
+ | * Page navigation links display and work properly. |
− | * Page navigation links work properly (link to correct post page). |
||
=== Readability Test === |
=== Readability Test === |
||
Line 36: | Line 85: | ||
* "Read More" link works properly (links to single post at "More" tag location). |
* "Read More" link works properly (links to single post at "More" tag location). |
||
− | === |
+ | === Post Format Tests (All) === |
+ | * If Theme supports Post Format Type, Post displays as intended in the index view |
||
− | * Wide image overflows properly (using max-width CSS rule or $content_width value is defined). |
||
+ | |||
− | * Sidebar must not be pushed to the bottom of the page. |
||
+ | === Post Format Test: Gallery === |
||
− | * Gallery thumbnail images display correctly. |
||
+ | * Gallery images display as intended in the index view |
||
+ | |||
+ | === Post Format Test: Image (Linked) === |
||
+ | * Image displays as intended in the index view |
||
+ | * Image does not overflow the content area |
||
+ | |||
+ | === Post Format Test: Image (Attached) === |
||
+ | * Image displays as intended in the index view |
||
+ | * Image does not overflow the content area |
||
+ | |||
+ | === Post Format Test: Video === |
||
+ | * Video displays as intended in the index view |
||
+ | * Video does not overflow the content area |
||
=== This Post Has No Body === |
=== This Post Has No Body === |
||
Line 46: | Line 108: | ||
=== (no title) === |
=== (no title) === |
||
* Lack of post title should not adversely impact layout. |
* Lack of post title should not adversely impact layout. |
||
− | * Post permalink should be displayed. |
+ | * Post permalink should be displayed. Making the post date a permalink is a great solution. See Twenty Ten for an example. |
=== Many Categories & Many Tags === |
=== Many Categories & Many Tags === |
||
+ | * Theme must incorporate both the "Tag" and the "Category" taxonomies in some manner. |
||
* Large number of categories/tags should not adversely impact layout. |
* Large number of categories/tags should not adversely impact layout. |
||
Line 56: | Line 119: | ||
* Comments should not be displayed. |
* Comments should not be displayed. |
||
* Once password is entered, post or excerpt displays properly. |
* Once password is entered, post or excerpt displays properly. |
||
− | |||
− | == Archive Pages == |
||
− | |||
− | === Date Archives === |
||
− | When viewing Date Archives (<tt>archive.php</tt>, ''if applicable''): |
||
− | * Posts display correctly, with no apparent visual problems or errors. |
||
− | * Posts display in correct order. |
||
− | * Correct number of posts display (as per setting in ''Settings'' > ''Reading''). |
||
− | |||
− | === Category Archives === |
||
− | When viewing Category Archives (<tt>category.php</tt>, ''if applicable''): |
||
− | * Posts display correctly, with no apparent visual problems or errors. |
||
− | * Posts display in correct order. |
||
− | * Correct number of posts display (as per setting in ''Settings'' > ''Reading''). |
||
− | |||
− | === Tag Archives === |
||
− | When viewing Tag Archives (<tt>tag.php</tt>, ''if applicable''): |
||
− | * Posts display correctly, with no apparent visual problems or errors. |
||
− | * Posts display in correct order. |
||
− | * Correct number of posts display (as per setting in ''Settings'' > ''Reading''). |
||
− | |||
− | === Author Archives === |
||
− | When viewing Author Archives (<tt>author.php</tt>, ''if applicable''): |
||
− | * Posts display correctly, with no apparent visual problems or errors. |
||
− | * Posts display in correct order. |
||
− | * Correct number of posts display (as per setting in ''Settings'' > ''Reading''). |
||
== Single Post == |
== Single Post == |
||
Line 106: | Line 143: | ||
** Nested lists should be indented correctly. |
** Nested lists should be indented correctly. |
||
* The following HTML tags should be styled appropriately to ensure semantic meaning of each tag is preserved: <tt>address</tt>, <tt>a</tt>, <tt>big</tt>, <tt>cite</tt>, <tt>code</tt>, <tt>del</tt>, <tt>em</tt>, <tt>ins</tt>, <tt>kbd</tt>, <tt>pre</tt>, <tt>q</tt>, <tt>s</tt>, <tt>strong</tt>, <tt>sub</tt>, <tt>sup</tt>, <tt>tt</tt>, <tt>var</tt>. |
* The following HTML tags should be styled appropriately to ensure semantic meaning of each tag is preserved: <tt>address</tt>, <tt>a</tt>, <tt>big</tt>, <tt>cite</tt>, <tt>code</tt>, <tt>del</tt>, <tt>em</tt>, <tt>ins</tt>, <tt>kbd</tt>, <tt>pre</tt>, <tt>q</tt>, <tt>s</tt>, <tt>strong</tt>, <tt>sub</tt>, <tt>sup</tt>, <tt>tt</tt>, <tt>var</tt>. |
||
− | ** |
+ | ** Note: <tt>abbr</tt> and <tt>acronym</tt> require no special styling. Also, <tt>s</tt> may be address but was deprected with HTML 4 and can be left with no special styling as well. |
* <tt>div</tt>, <tt>span</tt> maintain proper block or inline display, and styled (as appropriate). |
* <tt>div</tt>, <tt>span</tt> maintain proper block or inline display, and styled (as appropriate). |
||
Line 114: | Line 151: | ||
=== Images Test === |
=== Images Test === |
||
+ | |||
− | * Image Alignment Tests |
||
+ | '''Page 1''' |
||
+ | * Un-Captioned Image Alignment Tests |
||
** Images are aligned properly: Center, Left, Right, None. |
** Images are aligned properly: Center, Left, Right, None. |
||
** Check caption styles on first image. |
** Check caption styles on first image. |
||
** Images should not have a border unless it's part of design. |
** Images should not have a border unless it's part of design. |
||
+ | |||
+ | '''Page 2''' |
||
+ | * Captioned Image Alignment Tests |
||
+ | ** Images are aligned properly: Center, Left, Right, None. |
||
+ | ** Check caption styles on first image. |
||
+ | ** Images should not have a border unless it's part of design. |
||
+ | |||
+ | '''Page 3''' |
||
* Other Image Tests |
* Other Image Tests |
||
** Wide Image (Resized) Test |
** Wide Image (Resized) Test |
||
Line 123: | Line 170: | ||
*** Sidebar must not be pushed to the bottom of the page. |
*** Sidebar must not be pushed to the bottom of the page. |
||
** Wide Image (Not Resized) Test |
** Wide Image (Not Resized) Test |
||
− | *** Wide image overflows properly (using <tt>max-width</tt> CSS rule or <tt> |
+ | *** Wide image overflows properly (such as using <tt>max-width</tt> CSS rule or <tt>overflow</tt> CSS rule). |
*** Sidebar must not be pushed below content due to image overlap. |
*** Sidebar must not be pushed below content due to image overlap. |
||
** Thumbnails |
** Thumbnails |
||
*** Thumbnails display properly. |
*** Thumbnails display properly. |
||
− | * Gallery Test |
||
− | ** Gallery displays correctly (check for spacing after gallery). |
||
− | ** Gallery image thumbnails link to image post. |
||
− | ** ''Note: check for proper clearing of floats around <tt><h2>Gallery Test</h2></tt>'' |
||
+ | '''Page 4''' |
||
− | === Embedded Media Test === |
||
+ | * Floats are cleared properly for floated element (thumbnail image) at the end of the Post Content. |
||
− | * Embedded Audio (Enclosures) Test |
||
− | ** Enclosure links work properly. |
||
− | * Embedded Video Test |
||
− | ** Video embeds work. |
||
− | ** Embedded videos do not overlap each other. |
||
− | ** Embedded videos do not push sidebar(s) below content due to overlap. |
||
+ | === Post Format Tests (All) === |
||
− | === If you say it loud enough, you’ll always sound precocious; Supercalifragilisticexpialidocious! === |
||
+ | * If Theme supports Post Format type, Post displays as intended in the single-post view. |
||
− | * Test title line height |
||
+ | |||
− | * Look for potential overflow issues if the theme has a small title area |
||
+ | === Post Format Test: Gallery === |
||
+ | * Gallery displays correctly (check for spacing after gallery). |
||
+ | * Gallery image thumbnails link to image post. |
||
+ | |||
+ | === Post Format Test: Image (Linked) === |
||
+ | * Image displays as intended in single-post view. |
||
+ | * Image does not overflow the content area. |
||
+ | |||
+ | === Post Format Test: Image (Attached) === |
||
+ | * Image displays as intended in single-post view. |
||
+ | * Image does not overflow the content area. |
||
+ | |||
+ | === Post Format Test: Video === |
||
+ | * Video embeds work. |
||
+ | * Embedded video does not push sidebar(s) below content due to overlap. |
||
+ | * <tt>$content_width</tt> should have an appropriate value defined. |
||
+ | |||
+ | === Post Format Test: Audio === |
||
+ | * Enclosure links work properly. |
||
+ | |||
+ | === Post With Long Title === |
||
+ | Long Post Title with long non-breaking string: '''If you say it loud enough, you’ll always sound precocious; Supercalifragilisticexpialidocious!''' |
||
+ | * Test title line height. |
||
+ | * Look for potential overflow issues if the theme has a small title area. |
||
=== This Post Has No Body === |
=== This Post Has No Body === |
||
Line 149: | Line 211: | ||
=== (no title) === |
=== (no title) === |
||
* Post displays properly. |
* Post displays properly. |
||
+ | * A link to the singular view of the post is recommended to be displayed. Making the post date a permalink (see Twenty Ten for an example) is a great solution. |
||
− | * Post permalink exists. |
||
=== Many Categories / Many Tags === |
=== Many Categories / Many Tags === |
||
+ | * Theme incorporates both the "Tag" and "Category" taxonomies in some manner. |
||
* Category links work correctly. |
* Category links work correctly. |
||
* Categories display properly without adversely impacting design. |
* Categories display properly without adversely impacting design. |
||
Line 164: | Line 227: | ||
* Comments are displayed correctly. |
* Comments are displayed correctly. |
||
* Threaded comments display correctly. |
* Threaded comments display correctly. |
||
+ | * Comment pagination displays correctly. |
||
* Author comment is styled (as appropriate). |
* Author comment is styled (as appropriate). |
||
* User avatars are displayed properly. |
* User avatars are displayed properly. |
||
* Comment form displays properly for both logged in/logged out users. |
* Comment form displays properly for both logged in/logged out users. |
||
* When logged in as admin, edit links are displayed and work correctly. |
* When logged in as admin, edit links are displayed and work correctly. |
||
− | * HTML is displayed properly in comments, especially lists and block quotes |
+ | * HTML is displayed properly in comments, especially lists and block quotes. |
=== Comments Disabled === |
=== Comments Disabled === |
||
Line 182: | Line 246: | ||
=== Page With Comments === |
=== Page With Comments === |
||
− | * Tags and |
+ | * Tags, Categories, and Post date/time stamp should not be displayed. |
− | * |
+ | * Comment list and comment reply form are displayed. |
− | * Make sure datestamps or timestamps are not visible. |
||
=== Page With Comments Disabled === |
=== Page With Comments Disabled === |
||
− | * |
+ | * Comment list and comment reply form are not displayed. |
* No "Comments Disabled" message should be displayed. |
* No "Comments Disabled" message should be displayed. |
||
* Layout not adversely impacted by minimal page content. |
* Layout not adversely impacted by minimal page content. |
||
Line 232: | Line 295: | ||
== Related Pages == |
== Related Pages == |
||
− | * [[ |
+ | * [[Theme Development]] |
− | * [[ |
+ | * [[Theme Review]] |
[[Category:Design and Layout]] |
[[Category:Design and Layout]] |
Languages: English • Unit Test 日本語 Español • (Add your language)
(Last Edited: 2020-07-31)
This step in Theme testing correlates to a WordPress export (WXR) file that you can import into a WordPress installation to test your Theme. To be clear, this is only one step in testing your Theme. See Theme testing for a full guide.
themeunittestdata.wordpress.xml
from the GitHub repository https://github.com/WPTT/theme-unit-test (last updated 30/January/2020).Or Download a copy from https://raw.githubusercontent.com/WPTT/theme-unit-test/master/themeunittestdata.wordpress.xml
If you want to have famous 5 minute installation package for theme unit test environment, you can find it here: https://github.com/Evinceknow/Theme-Unit-Test-Environment-for-WordPress. Setup it as WordPress main installation package.
Adjust WordPress settings as follows:
Create at least two Custom Menus:
When viewing any Template Hierarchy Index page, including the default index page (index.php), and (if applicable) Blog Posts Index (home.php), Date Archives (archive.php), Category Archives (category.php), Tag Archives (tag.php), or Author Archives (author.php):
If the Theme includes either a front-page.php or a home.php template file, go to Dashboard -> Settings -> Reading, and set the Front Page to display a Static Page (use any existing Page), and set the Blog Posts index to another Static Page (e.g. "Lorem Ipsum").
Test the following posts when viewing the Blog Posts Index page. Post Titles in the test data correlate with section titles below.
Test the following posts when viewing a single post (single.php). Each section title matches a post title in the test data.
Page 2
Page 3
Page 1
Page 2
Page 3
Page 4
Long Post Title with long non-breaking string: If you say it loud enough, you’ll always sound precocious; Supercalifragilisticexpialidocious!
Test the following pages (page.php) by viewing the page that matches the section titles below.
Tests for search.php and 404.php.
Theme authors should only be using links that point directly to a website specifically for the theme; an appropriate website page for the theme; or a reasonably related URL giving more information about the theme. Using anchor text for search engine gains will not be accepted.
This Unit Test is just one step in Theme testing. Continue to Theme testing for the full guide.