DevOps:Doc/FlexForm/2.1, 2.5/create pages
No edit summary |
mNo edit summary |
||
| (4 intermediate revisions by 2 users not shown) | |||
| Line 2: | Line 2: | ||
* These tests assume you are using a wiki with $wgCapitalLinks set to true (the default setting). Else tests like A1 and A2 will produce different results, as the first letter won't be capitalized automatically. You can still use these tests, but you will have to carefully evaluate the results yourself, as some of the instructions will not be applicable. | * These tests assume you are using a wiki with $wgCapitalLinks set to true (the default setting). Else tests like A1 and A2 will produce different results, as the first letter won't be capitalized automatically. You can still use these tests, but you will have to carefully evaluate the results yourself, as some of the instructions will not be applicable. | ||
* Tests should be done with FlexForm extension setting create-seo-titles set to true as well as false. | * Tests should be done with FlexForm extension setting create-seo-titles set to true as well as false. Note that create-seo-titles is only applied to input from formfields that is inserted in mwwrite of a create, not to hardcoded values in mwwrite. Therefore most of these tests (except for D) should have the same results with create-seo-titles set to true or false. | ||
* To execute the tests, copy the | * To execute the tests, copy the content shown below to a page on your wiki. The content contains test instructions as well as forms to test different _create options. | ||
* After you finish testing, delete the created test pages. You can for example find these in your contributions or use the Semantic MediaWiki query to get a list of pages and delete them through Special:DeleteBatch. | * After you finish testing, delete the created test pages. You can for example find these in your contributions or use the Semantic MediaWiki query to get a list of pages and delete them through Special:DeleteBatch. | ||
== A. next_available test == | == A. next_available test == | ||
* Test each create multiple times | * Test each create multiple times | ||
| Line 16: | Line 16: | ||
=== A1. Test_page === | === A1. Test_page === | ||
<syntaxhighlight lang="html"> | |||
<form> | <form> | ||
<_create mwwrite="Test_page" mwtemplate="Test" mwoption="next_available" mwfollow /> | <_create mwwrite="Test_page" mwtemplate="Test" mwoption="next_available" mwfollow /> | ||
| Line 22: | Line 23: | ||
<input type="submit" /> | <input type="submit" /> | ||
</form> | </form> | ||
</syntaxhighlight> | |||
=== A2. test_page === | === A2. test_page === | ||
<syntaxhighlight lang="html"> | |||
<form> | <form> | ||
<_create mwwrite="test_page" mwtemplate="Test" mwoption="next_available" mwfollow /> | <_create mwwrite="test_page" mwtemplate="Test" mwoption="next_available" mwfollow /> | ||
| Line 30: | Line 33: | ||
<input type="submit" /> | <input type="submit" /> | ||
</form> | </form> | ||
</syntaxhighlight> | |||
=== A3. :Test_page === | === A3. :Test_page === | ||
<syntaxhighlight lang="html"> | |||
<form> | <form> | ||
<_create mwwrite=":Test_page" mwtemplate="Test" mwoption="next_available" mwfollow /> | <_create mwwrite=":Test_page" mwtemplate="Test" mwoption="next_available" mwfollow /> | ||
| Line 38: | Line 42: | ||
<input type="submit" /> | <input type="submit" /> | ||
</form> | </form> | ||
</syntaxhighlight> | |||
=== A4. Test page === | === A4. Test page === | ||
<syntaxhighlight lang="html"> | |||
<form> | <form> | ||
<_create mwwrite="Test page" mwtemplate="Test" mwoption="next_available" mwfollow /> | <_create mwwrite="Test page" mwtemplate="Test" mwoption="next_available" mwfollow /> | ||
| Line 46: | Line 51: | ||
<input type="submit" /> | <input type="submit" /> | ||
</form> | </form> | ||
</syntaxhighlight> | |||
=== A5. Template:test_page === | === A5. Template:test_page === | ||
<syntaxhighlight lang="html"> | |||
<form> | <form> | ||
<_create mwwrite="Template:test_page" mwtemplate="Test" mwoption="next_available" mwfollow /> | <_create mwwrite="Template:test_page" mwtemplate="Test" mwoption="next_available" mwfollow /> | ||
| Line 54: | Line 60: | ||
<input type="submit" /> | <input type="submit" /> | ||
</form> | </form> | ||
</syntaxhighlight> | |||
=== A6. [namespace]:Test_page === | === A6. [namespace]:Test_page === | ||
<syntaxhighlight lang="html"> | |||
<form> | <form> | ||
<_create mwwrite="[namespace]:Test_page" mwtemplate="Test" mwoption="next_available" mwfollow /> | <_create mwwrite="[namespace]:Test_page" mwtemplate="Test" mwoption="next_available" mwfollow /> | ||
| Line 70: | Line 77: | ||
<input type="submit" /> | <input type="submit" /> | ||
</form> | </form> | ||
</syntaxhighlight> | |||
== B. add_random test == | == B. add_random test == | ||
* Test each create multiple times | * Test each create multiple times | ||
| Line 78: | Line 85: | ||
* Tests B4 and B5 (with namespace options "template" and "Template") should result in similar pagetitles | * Tests B4 and B5 (with namespace options "template" and "Template") should result in similar pagetitles | ||
** note: you might see "Template" in the created page in a different language, if your user preference is set to a language other than English | ** note: you might see "Template" in the created page in a different language, if your user preference is set to a language other than English | ||
=== B1. Test_page === | === B1. Test_page === | ||
<syntaxhighlight lang="html"> | |||
<form> | <form> | ||
<_create mwwrite="Test_page" mwtemplate="Test" mwoption="add_random" mwfollow /> | <_create mwwrite="Test_page" mwtemplate="Test" mwoption="add_random" mwfollow /> | ||
| Line 87: | Line 94: | ||
<input type="submit" /> | <input type="submit" /> | ||
</form> | </form> | ||
</syntaxhighlight> | |||
=== B2. test_page === | === B2. test_page === | ||
<syntaxhighlight lang="html"> | |||
<form> | <form> | ||
<_create mwwrite="test_page" mwtemplate="Test" mwoption="add_random" mwfollow /> | <_create mwwrite="test_page" mwtemplate="Test" mwoption="add_random" mwfollow /> | ||
| Line 95: | Line 103: | ||
<input type="submit" /> | <input type="submit" /> | ||
</form> | </form> | ||
</syntaxhighlight> | |||
=== B3. :Test_page === | === B3. :Test_page === | ||
<syntaxhighlight lang="html"> | |||
<form> | <form> | ||
<_create mwwrite=":Test_page" mwtemplate="Test" mwoption="add_random" mwfollow /> | <_create mwwrite=":Test_page" mwtemplate="Test" mwoption="add_random" mwfollow /> | ||
| Line 103: | Line 112: | ||
<input type="submit" /> | <input type="submit" /> | ||
</form> | </form> | ||
</syntaxhighlight> | |||
=== B4. Template:test_page === | === B4. Template:test_page === | ||
<syntaxhighlight lang="html"> | |||
<form> | <form> | ||
<_create mwwrite="Template:test_page" mwtemplate="Test" mwoption="add_random" mwfollow /> | <_create mwwrite="Template:test_page" mwtemplate="Test" mwoption="add_random" mwfollow /> | ||
| Line 111: | Line 121: | ||
<input type="submit" /> | <input type="submit" /> | ||
</form> | </form> | ||
</syntaxhighlight> | |||
=== B5. [namespace]:Test_page === | === B5. [namespace]:Test_page === | ||
<syntaxhighlight lang="html"> | |||
<form> | <form> | ||
<_create mwwrite="[namespace]:Test_page" mwtemplate="Test" mwoption="add_random" mwfollow /> | <_create mwwrite="[namespace]:Test_page" mwtemplate="Test" mwoption="add_random" mwfollow /> | ||
| Line 127: | Line 138: | ||
<input type="submit" /> | <input type="submit" /> | ||
</form> | </form> | ||
</syntaxhighlight> | |||
=== B6. Test_page/ === | === B6. Test_page/ === | ||
<syntaxhighlight lang="html"> | |||
<form> | <form> | ||
<_create mwwrite="Test_page/" mwtemplate="Test" mwoption="add_random" mwfollow /> | <_create mwwrite="Test_page/" mwtemplate="Test" mwoption="add_random" mwfollow /> | ||
| Line 135: | Line 147: | ||
<input type="submit" /> | <input type="submit" /> | ||
</form> | </form> | ||
</syntaxhighlight> | |||
=== B7. Test_page- === | === B7. Test_page- === | ||
<syntaxhighlight lang="html"> | |||
<form> | <form> | ||
<_create mwwrite="Test_page-" mwtemplate="Test" mwoption="add_random" mwfollow /> | <_create mwwrite="Test_page-" mwtemplate="Test" mwoption="add_random" mwfollow /> | ||
| Line 143: | Line 156: | ||
<input type="submit" /> | <input type="submit" /> | ||
</form> | </form> | ||
</syntaxhighlight> | |||
== C. range tests == | == C. range tests == | ||
* Test each create multiple times | * Test each create multiple times | ||
| Line 153: | Line 166: | ||
=== C1. Test_page/range:2019000-2019999 === | === C1. Test_page/range:2019000-2019999 === | ||
<syntaxhighlight lang="html"> | |||
<form> | <form> | ||
<_create mwwrite="Test_page/" mwtemplate="Test" mwoption="range:2019000-2019999" mwfollow /> | <_create mwwrite="Test_page/" mwtemplate="Test" mwoption="range:2019000-2019999" mwfollow /> | ||
| Line 158: | Line 172: | ||
<input type="submit" /> | <input type="submit" /> | ||
</form> | </form> | ||
</syntaxhighlight> | |||
=== C2. Test_page/range:1-9999 === | === C2. Test_page/range:1-9999 === | ||
<syntaxhighlight lang="html"> | |||
<form> | <form> | ||
<_create mwwrite="Test_page/" mwtemplate="Test" mwoption="range:1-9999" mwfollow /> | <_create mwwrite="Test_page/" mwtemplate="Test" mwoption="range:1-9999" mwfollow /> | ||
| Line 165: | Line 180: | ||
<input type="submit" /> | <input type="submit" /> | ||
</form> | </form> | ||
</syntaxhighlight> | |||
=== C3. Test_page/range:1-9999 with mwleadingzero === | === C3. Test_page/range:1-9999 with mwleadingzero === | ||
<syntaxhighlight lang="html"> | |||
<form> | <form> | ||
<_create mwwrite="Test_page/" mwtemplate="Test" mwoption="range:1-9999" mwleadingzero mwfollow /> | <_create mwwrite="Test_page/" mwtemplate="Test" mwoption="range:1-9999" mwleadingzero mwfollow /> | ||
| Line 172: | Line 188: | ||
<input type="submit" /> | <input type="submit" /> | ||
</form> | </form> | ||
</syntaxhighlight> | |||
=== C4. template:Test_page/range:1-9999 with mwleadingzero === | === C4. template:Test_page/range:1-9999 with mwleadingzero === | ||
<syntaxhighlight lang="html"> | |||
<form> | <form> | ||
<_create mwwrite="template:Test_page/" mwtemplate="Test" mwoption="range:1-9999" mwleadingzero mwfollow /> | <_create mwwrite="template:Test_page/" mwtemplate="Test" mwoption="range:1-9999" mwleadingzero mwfollow /> | ||
| Line 179: | Line 196: | ||
<input type="submit" /> | <input type="submit" /> | ||
</form> | </form> | ||
</syntaxhighlight> | |||
== D. create-seo-titles test == | == D. create-seo-titles test == | ||
* The create should result | * The create should result a page title where values from input fields are cleaned up. Symbols and spaces are replace with "-" and all letters are lower case (except for the first one if $wgCapitalLinks is set to true) | ||
* D1 should give an error message as it's an invalid pagetitle: "Could not create page Test#@*( PAge. Invalid title." | |||
* D2 should create "Test page/test-page" (or invalid title when create-seo-titles is set to false) | |||
* D3 should create "Test-page" (or invalid title when create-seo-titles is set to false) | |||
=== D1. Test_#@*( PAge === | === D1. Test_#@*( PAge === | ||
<syntaxhighlight lang="html"> | |||
<form> | <form> | ||
<_create mwwrite="Test_#@*( PAge" mwtemplate="Test" mwfollow /> | <_create mwwrite="Test_#@*( PAge" mwtemplate="Test" mwfollow /> | ||
<input type="text" name="Content" value="{{#time:r|now||l}}" /> | <input type="text" name="Content" value="{{#time:r|now||l}}" /> | ||
<input type="submit" /> | |||
</form> | |||
</syntaxhighlight> | |||
=== D2. Test page/[Title] === | |||
<syntaxhighlight lang="html"> | |||
<form> | |||
<_create mwwrite="Test page/[Title]" mwtemplate="Test" mwfollow /> | |||
<input type="text" name="Content" value="{{#time:r|now||l}}" /> | |||
<input type="text" name="Title" value="Test_#@*( PAge" /> | |||
<input type="submit" /> | <input type="submit" /> | ||
</form> | </form> | ||
</syntaxhighlight> | |||
=== D3. [Title] === | |||
<syntaxhighlight lang="html"> | |||
<form> | |||
<_create mwwrite="[Title]" mwtemplate="Test" mwfollow /> | |||
<input type="text" name="Content" value="{{#time:r|now||l}}" /> | |||
<input type="text" name="Title" value="test_#@*( PAge" /> | |||
<input type="submit" /> | |||
</form> | |||
</syntaxhighlight> | |||
== Potentially useful Semantic MediaWiki query to find created pages (if you are using SMW) == | == Potentially useful Semantic MediaWiki query to find created pages (if you are using SMW) == | ||
<pre> | |||
{{#ask:[[~*Test page*]] | {{#ask:[[~*Test page*]] | ||
|?=Page | |?=Page | ||
| Line 199: | Line 239: | ||
|order=desc | |order=desc | ||
}} | }} | ||
</pre> | </pre> | ||
Latest revision as of 10:51, 10 October 2025
- These tests assume you are using a wiki with $wgCapitalLinks set to true (the default setting). Else tests like A1 and A2 will produce different results, as the first letter won't be capitalized automatically. You can still use these tests, but you will have to carefully evaluate the results yourself, as some of the instructions will not be applicable.
- Tests should be done with FlexForm extension setting create-seo-titles set to true as well as false. Note that create-seo-titles is only applied to input from formfields that is inserted in mwwrite of a create, not to hardcoded values in mwwrite. Therefore most of these tests (except for D) should have the same results with create-seo-titles set to true or false.
- To execute the tests, copy the content shown below to a page on your wiki. The content contains test instructions as well as forms to test different _create options.
- After you finish testing, delete the created test pages. You can for example find these in your contributions or use the Semantic MediaWiki query to get a list of pages and delete them through Special:DeleteBatch.
A. next_available test
- Test each create multiple times
- Verify that the created page gets a new number each time, i.e. "Test page1" then "Test page2" then "Test page3" etc.
- Tests A1, A2, A3, A4 and A6 (with namespace option "(Main)") should result in similar pagetitles
- note: with create-seo-titles set to true, A4 will produce a different pagetitle, for example "Test-page1"
- Tests A5 and A6 (with namespace options "template" and "Template") should result in similar pagetitles
- note: you might see "Template" in the created page in a different language, if your user preference is set to a language other than English
A1. Test_page
<form>
<_create mwwrite="Test_page" mwtemplate="Test" mwoption="next_available" mwfollow />
<input type="text" name="Content" value="{{#time:r|now||l}}" />
<input type="submit" />
</form>
A2. test_page
<form>
<_create mwwrite="test_page" mwtemplate="Test" mwoption="next_available" mwfollow />
<input type="text" name="Content" value="{{#time:r|now||l}}" />
<input type="submit" />
</form>
A3. :Test_page
<form>
<_create mwwrite=":Test_page" mwtemplate="Test" mwoption="next_available" mwfollow />
<input type="text" name="Content" value="{{#time:r|now||l}}" />
<input type="submit" />
</form>
A4. Test page
<form>
<_create mwwrite="Test page" mwtemplate="Test" mwoption="next_available" mwfollow />
<input type="text" name="Content" value="{{#time:r|now||l}}" />
<input type="submit" />
</form>
A5. Template:test_page
<form>
<_create mwwrite="Template:test_page" mwtemplate="Test" mwoption="next_available" mwfollow />
<input type="text" name="Content" value="{{#time:r|now||l}}" />
<input type="submit" />
</form>
A6. [namespace]:Test_page
<form>
<_create mwwrite="[namespace]:Test_page" mwtemplate="Test" mwoption="next_available" mwfollow />
<input type="text" name="Content" value="{{#time:r|now||l}}" />
<div>
<select name="namespace" placeholder="Choose a namespace" required="required">
<option value="">(Main)</option>
<option value="Template" >Template</option>
<option value="template">template</option>
</select>
</div>
<input type="submit" />
</form>
B. add_random test
- Test each create multiple times
- Verify that the created page gets a new number each time, i.e. "Test page1759998954" then "Test page1759998946" etc.
- note: the numbers are not fully random as they are based on timestamp, but each create should result in a unique number.
- Tests B1, B2, B3 and B5 (with namespace option "(Main)") should result in similar pagetitles
- Tests B4 and B5 (with namespace options "template" and "Template") should result in similar pagetitles
- note: you might see "Template" in the created page in a different language, if your user preference is set to a language other than English
B1. Test_page
<form>
<_create mwwrite="Test_page" mwtemplate="Test" mwoption="add_random" mwfollow />
<input type="text" name="Content" value="{{#time:r|now||l}}" />
<input type="submit" />
</form>
B2. test_page
<form>
<_create mwwrite="test_page" mwtemplate="Test" mwoption="add_random" mwfollow />
<input type="text" name="Content" value="{{#time:r|now||l}}" />
<input type="submit" />
</form>
B3. :Test_page
<form>
<_create mwwrite=":Test_page" mwtemplate="Test" mwoption="add_random" mwfollow />
<input type="text" name="Content" value="{{#time:r|now||l}}" />
<input type="submit" />
</form>
B4. Template:test_page
<form>
<_create mwwrite="Template:test_page" mwtemplate="Test" mwoption="add_random" mwfollow />
<input type="text" name="Content" value="{{#time:r|now||l}}" />
<input type="submit" />
</form>
B5. [namespace]:Test_page
<form>
<_create mwwrite="[namespace]:Test_page" mwtemplate="Test" mwoption="add_random" mwfollow />
<input type="text" name="Content" value="{{#time:r|now||l}}" />
<div>
<select name="namespace" placeholder="Choose a namespace" required="required">
<option value="">(Main)</option>
<option value="Template" >Template</option>
<option value="template">template</option>
</select>
</div>
<input type="submit" />
</form>
B6. Test_page/
<form>
<_create mwwrite="Test_page/" mwtemplate="Test" mwoption="add_random" mwfollow />
<input type="text" name="Content" value="{{#time:r|now||l}}" />
<input type="submit" />
</form>
B7. Test_page-
<form>
<_create mwwrite="Test_page-" mwtemplate="Test" mwoption="add_random" mwfollow />
<input type="text" name="Content" value="{{#time:r|now||l}}" />
<input type="submit" />
</form>
C. range tests
- Test each create multiple times
- C1 should create titles "Test_page/2019000", "Test_page/2019001", "Test_page/2019002" etc.
- C2 should create titles "Test_page/1", "Test_page/2", "Test_page/3" etc.
- C3 should create titles "Test_page/0001", "Test_page/0002", "Test_page/0003" etc.
- C3 should create titles "Template:Test_page/0001", "Template:Test_page/0002", "Template:Test_page/0003" etc.
- note: you might see "Template" in the created page in a different language, if your user preference is set to a language other than English
C1. Test_page/range:2019000-2019999
<form>
<_create mwwrite="Test_page/" mwtemplate="Test" mwoption="range:2019000-2019999" mwfollow />
<input type="text" name="Content" value="{{#time:r|now||l}}" />
<input type="submit" />
</form>
C2. Test_page/range:1-9999
<form>
<_create mwwrite="Test_page/" mwtemplate="Test" mwoption="range:1-9999" mwfollow />
<input type="text" name="Content" value="{{#time:r|now||l}}" />
<input type="submit" />
</form>
C3. Test_page/range:1-9999 with mwleadingzero
<form>
<_create mwwrite="Test_page/" mwtemplate="Test" mwoption="range:1-9999" mwleadingzero mwfollow />
<input type="text" name="Content" value="{{#time:r|now||l}}" />
<input type="submit" />
</form>
C4. template:Test_page/range:1-9999 with mwleadingzero
<form>
<_create mwwrite="template:Test_page/" mwtemplate="Test" mwoption="range:1-9999" mwleadingzero mwfollow />
<input type="text" name="Content" value="{{#time:r|now||l}}" />
<input type="submit" />
</form>
D. create-seo-titles test
- The create should result a page title where values from input fields are cleaned up. Symbols and spaces are replace with "-" and all letters are lower case (except for the first one if $wgCapitalLinks is set to true)
- D1 should give an error message as it's an invalid pagetitle: "Could not create page Test#@*( PAge. Invalid title."
- D2 should create "Test page/test-page" (or invalid title when create-seo-titles is set to false)
- D3 should create "Test-page" (or invalid title when create-seo-titles is set to false)
D1. Test_#@*( PAge
<form>
<_create mwwrite="Test_#@*( PAge" mwtemplate="Test" mwfollow />
<input type="text" name="Content" value="{{#time:r|now||l}}" />
<input type="submit" />
</form>
D2. Test page/[Title]
<form>
<_create mwwrite="Test page/[Title]" mwtemplate="Test" mwfollow />
<input type="text" name="Content" value="{{#time:r|now||l}}" />
<input type="text" name="Title" value="Test_#@*( PAge" />
<input type="submit" />
</form>
D3. [Title]
<form>
<_create mwwrite="[Title]" mwtemplate="Test" mwfollow />
<input type="text" name="Content" value="{{#time:r|now||l}}" />
<input type="text" name="Title" value="test_#@*( PAge" />
<input type="submit" />
</form>
Potentially useful Semantic MediaWiki query to find created pages (if you are using SMW)
{{#ask:[[~*Test page*]]
|?=Page
|?#-=Page
|?Modification date
|sort=Modification date
|order=desc
}}