Jump to content

FamilySearch Wiki:Extension tests: Difference between revisions

regenerate tests
(regenerate tests)
Line 9: Line 9:


== AdvancedSearch ==
== AdvancedSearch ==
If [[#CirrusSearch]] is enabled, the extension produces the "Advanced Search" form on [[Special:Search]].
If [[#CirrusSearch]] is enabled, the extension produces the "Advanced Search" form on [[Special:Search]].  


== Approved Revs==
== Approved Revs==
Line 33: Line 33:
:This test should be done while using the Chameleon skin; [{{fullurl:{{FULLPAGENAME}}|useskin=chameleon}} view page with useskin=chameleon]
:This test should be done while using the Chameleon skin; [{{fullurl:{{FULLPAGENAME}}|useskin=chameleon}} view page with useskin=chameleon]
This should be a greeny shadowed alert box with white text:
This should be a greeny shadowed alert box with white text:
<div class="alert alert-success shadow text-white font-weight-bold">
<div class="alert bg-success shadow text-white font-weight-bold">
I am bootstrapped
I am bootstrapped
</div>
</div>
Line 61: Line 61:


== CirrusSearch ==
== CirrusSearch ==
;For semantic wikis
To test that the extension is loaded, the following link (using the <code>cirrusDumpQuery</code> parameter) should show a JSON object with details of the search:
The search results should display "'''ask'''" in bold:
* [{{fullurl:Special:Search|search=Example&cirrusDumpQuery=true}} Example search with cirrusDumpQuery]
* [{{SERVER}}{{SCRIPTPATH}}/index.php?search=insource%3A+%23ask%3A&title=Special%3ASearch&profile=all&fulltext=1 Search in the source]


;For Cite enabled wikis
To test that the indexer is working, add some custom string to this section that does not currently show up in Special:Search and then confirm that it shows up - this may take a few reloads. We want a string not currently in use so that we can check that new edits get indexed. If it works, revert the addition.
The search results should display "'''ref'''" in bold:
* [{{SERVER}}{{SCRIPTPATH}}/index.php?search=insource%3A+ref&title=Special%3ASearch&profile=all&fulltext=1 Search in the source]


== Cite ==
== Cite ==
Line 89: Line 86:


== CodeMirror ==
== CodeMirror ==
* The "Editing" tab on [[Special:Preferences]] should have the "Enable colorblind-friendly mode" checkbox ("Accessibility" section).  
* The "Editing" tab on [[Special:Preferences]] should have the "Enable colorblind-friendly mode" checkbox ("Accessibility" section).
 
NOTE: in 1.35 installations use the following instead (either way remove this note and use only one of the tests)
 
* When navigating to [{{fullurl:Main Page|action=submit}} editing the main page] the codemirror interface should be loaded. Make sure that the option is enabled by running <code>mw.loader.using( [ 'mediawiki.api' ], () => new mw.Api().saveOption( 'usecodemirror', 1 ) );</code> and then reloading the page.


== ContributionScores ==
== ContributionScores ==
Line 140: Line 141:


== GlobalNotice ==
== GlobalNotice ==
No test was invented. The extension must be listed on [[Special:Version]].
If there is not already a global notice at the top of the page, create one by editing one of the following pages. We want to be as unobtrusive as possible in our testing, so ideally, use an account with bureaucrat rights and test the bureaucrat-only message, but if you don't have access to such an account, use the sysop-only message.
 
Edit [[MediaWiki:globalnotice-bureaucrat]] (or [[MediaWiki:globalnotice-sysop]] if not a bureaucrat) and confirm that the resulting content is shown at the top of the page for bureaucrats (or sysops, if that message was edited) but not for users that are not part of those groups.
 
After finishing the test, be sure to revert your changes - if you just created the page, it can be disabled by blanking it or replacing it with <code>-</code>.


== GoogleTranslator ==
== GoogleTranslator ==
Line 201: Line 206:
<section begin=test1 />This is a test.<section end=test1 />
<section begin=test1 />This is a test.<section end=test1 />
Some text ...
Some text ...
=== Section by heading ===
=== Section by heading ===
This is a section with a heading
This is a section with a heading
Line 208: Line 212:


== Lingo ==
== Lingo ==
Lingo is a glossary extension. It lets you define a list of abbreviations and their definitions on [[{{MediaWiki:Lingo-terminologypagename}}]] page and then displays these definitions whenever an abbreviation is hovered over in an article.
;Test
:{{int:Lingo-terminologypagename}}
;Expected
:Whatever except <code>⧼Lingo-termeinologypagename⧽</code>


Check it below:
Hovering over the abbreviation below should display a popup with the definition:
 
* USA <= adjust to any term defined on [[{{int:Lingo-terminologypagename}}]]
FHL <- is abbreviations


== Lockdown ==
== Lockdown ==
No test was invented. The extension must be listed on [[Special:Version]].
* Check the values of the configuration settings <code>$wgNamespacePermissionLockdown</code>, <code>$wgSpecialPageLockdown</code>, and <code>$wgActionLockdown</code>
* Identify an action that should be allowed by other configuration on the wiki, but prevented by one of these settings
* Try to perform that action
* Confirm that an error message is shown about lacking permission


== Loops ==
== Loops ==
Line 288: Line 297:
== MultimediaViewer ==
== MultimediaViewer ==
Clicking this should pop up a nice lightbox image viewer or, in case MMV is disabled by default, this should open the file page with the <code>Open in Media Viewer</code> button:
Clicking this should pop up a nice lightbox image viewer or, in case MMV is disabled by default, this should open the file page with the <code>Open in Media Viewer</code> button:
:[[File:Australian Capital Territory and New South Wales, Australia.jpg|50px]]
:[[File:JoshuaReynoldsParty.jpg|50px]]


== MyVariables ==
== MyVariables ==
Line 300: Line 309:
== OpenGraphMeta ==
== OpenGraphMeta ==
;Test
;Test
[[File:{{#setmainimage:Australian Capital Territory and New South Wales, Australia.jpg}}|100px]]
[[File:{{#setmainimage:JoshuaReynoldsParty.jpg}}|100px]]
;Expected:
;Expected:
[[File:Australian Capital Territory and New South Wales, Australia.jpg|100px]]
[[File:JoshuaReynoldsParty.jpg|100px]]


== OpenID Connect ==
== OpenID Connect ==
No test was invented. The extension must be listed on [[Special:Version]].
No test was invented. The extension must be listed on [[Special:Version]].
== PDF Handler ==
You should see the content of the uploaded PDF ([[Media:Overview of FamilySearch JMR2023.pdf|Overview of FamilySearch JMR2023.pdf]]):
[[File:Overview of FamilySearch JMR2023.pdf|page=1|200px|Succeeded]]


== Page Importer ==
== Page Importer ==
Line 334: Line 338:


== Parsoid ==
== Parsoid ==
No test was invented. The extension must be listed on [[Special:Version]].
Used to support the VisualEditor extension. If that extension is working, Parsoid works. The extension must be listed on [[Special:Version]].
 
== PDF Handler ==
You should see the content of the uploaded PDF ([[media:ExamplePDF.pdf|ExamplePDF.pdf]]):
 
[[File:ExamplePDF.pdf|page=1|200px|Succeeded]]


== PluggableAuth ==
== PluggableAuth ==
Line 373: Line 382:


== Scribunto ==
== Scribunto ==
=== [[Module:String]] ([https://en.wikipedia.org/w/index.php?title=Module:String&action=edit source]) ===
=== [[Module:String]] ===
; Test&#160;: {{#invoke:String|len|This is a test.}}  
; Test&#160;: {{#invoke:String|len|This is a test.}}  
; Expected&#160;: 15
; Expected&#160;: 15
== Semantic Drilldown ==
This should be a valid link:
[[Special:BrowseData]]
== Semantic Meeting Minutes ==
;Test: {{#synopsize:
Only this line should show, with no lines after it
This line should '''not''' show
|9999
|1}}
;Expected: Only this line should show, with no lines after it
== SemanticCompoundQueries ==
This should produce no error:
{{#compound_query: [[:+]][[Modification date::+]];?Modification date;limit=1;order=rand
|[[File:+]][[Modification date::+]];?Modification date;limit=1;order=rand
|link=none
|format=ul
}}
== SemanticMediaWiki ==
; Test&#160;:[[Test::NONEXISTENTPAGE|Test]] __SHOWFACTBOX__
; Expected&#160;:[[NONEXISTENTPAGE|Test]]
: There should be a factbox at the page bottom.
== SemanticResultFormats ==
; Test (old wikis)
{{#ask:[[{{FULLPAGENAME}}]]|?Test|format=datatables}}
; Expected
: A nice-looking DataTable with a search field
== SemanticScribunto ==
Should be an icon with information popup -> {{#invoke:SemanticScribuntoTest|info|some text}}
{{#invoke:SemanticScribuntoTest|inlineInfo}}


<div class="toccolours mw-collapsible mw-collapsed" style="width:400px; overflow:auto;">
<div class="toccolours mw-collapsible mw-collapsed" style="width:400px; overflow:auto;">
<div style="font-weight:bold;line-height:1.6;">
<div style="font-weight:bold;line-height:1.6;">
Source of [[Module:SemanticScribuntoTest]]</div>
Source of [[Module:String]]</div>
<div class="mw-collapsible-content">
<div class="mw-collapsible-content">
<pre>
<pre>
-- Module:SMW
local p = {}
local p = {}
 
function p.len(frame)
-- set with direct return results
local s = frame.args[1]
function p.info( frame )
return mw.ustring.len( s )
 
    if not mw.smw then
        return "mw.smw module not found"
    end
 
    if frame.args[1] == nil then
        return "no parameter found"
    end
 
    local tooltip
    if frame.args[2] then
        tooltip = mw.smw.info( frame.args[1], frame.args[2] )
    else
        tooltip = mw.smw.info( frame.args[1] )
    end
 
    return tooltip
end
end
-- another example, info used inside another function
function p.inlineInfo( frame )
    local output = 'This is sample output'
    -- so some stuff
    output = output .. mw.smw.info( 'This is a warning', 'warning' )
    -- some more stuff
    return output
end
return p
return p
</pre>
</pre>
</div></div>
</div></div>


== SimpleMathJax ==
== SimpleMathJax ==
Line 475: Line 415:
; Expected
; Expected
: E=mc^2 (but much better-looking)
: E=mc^2 (but much better-looking)
== StringFunctionsEscaped ==
=== Test : Lowercase Conversion Using `#lc` ===
; '''Test:'''
{{#lc: HELLO WORLD}}
; '''Expected:'''
hello world
; '''Description:'''
Converts the input string to lowercase using MediaWiki's built-in `#lc` parser function.
[[Category:Tests]]


== SpamBlacklist ==
== SpamBlacklist ==
Line 512: Line 438:
pass
pass
</syntaxhighlight>
</syntaxhighlight>
== TalkRight ==
<code>talk</code> right should be present [[Special:ListGroupRights|here]].


== TemplateData ==
== TemplateData ==
[{{fullurl:Template:Test|action=edit}} This link should take you to a page with the <code>Manage TemplateData</code> button] (normally below the first heading).
[{{fullurl:Template:Test|action=edit}} This link should take you to a page with the <code>Manage TemplateData</code> button] (normally below the first heading).
== TalkRight ==
<code>talk</code> right should be present [[Special:ListGroupRights|here]].


== TextExtracts ==
== TextExtracts ==
Line 536: Line 462:


== UserFunctions ==
== UserFunctions ==
; Test&#160;: {{#ifanon:It works|It works}}
; Test&#160;: {{#ifanon:You are not logged in|You are logged in}}
; Expected&#160;: It works
; Expected&#160;: "You are not logged in" when not logged in, and "You are logged in" when you are
 
== VEForAll ==
No test was invented. The extension must be listed on [[Special:Version]].


== Variables ==
== Variables ==
; Test&#160;: {{#vardefine:test|testing}}{{#var:test}}
; Test&#160;: {{#vardefine:test|testing}}{{#var:test}}
; Expected&#160;: testing
; Expected&#160;: testing
== VEForAll ==
The <code>ext.veforall.main</code> ResourceLoader module should be registered; in the developer console running <code>mw.loader.getState('ext.veforall.main');</code> should return a string (rather than <code>null</code>).
Note that the actual functioning of this extension is based on it being invoked by other extensions, and so even if it is installed it may not actually be used.


== VisualEditor ==
== VisualEditor ==
926

edits