Template:Talk header/testcases

From Justapedia, unleashing the power of collective wisdom
Jump to navigation Jump to search


Smoke test (dynamic 'Find sources' update)

The following tests are intended to provide a very quick check of core functionality. Use the Purge cache link on this page to clear the server cache and then test the following.

Test cases

Standard talk header

Expected result: Standard array of find sources links should display. First link should be to Google with link value: https://www.google.com/search?as_eq=wikipedia&q=%22testcases%22

Basic 'Find sources' display
{{Talk header|demospace=1}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}

Domain set

Expected result: Video game link list with last link to "WPVG/Talk" with the link value: https://en.wikipedia.org/w/index.php?search=%22testcases%22+prefix%3AWikipedia+talk%3AWikiProject+Video+games&title=Special:Search&profile=default&fulltext=1

Find video game sources display
{{Talk header|demospace=main|search-domain=vg}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}

Domain and custom search term parameters

Expected result: Medical link list with last link to "Wiley" with the link value: https://onlinelibrary.wiley.com/action/doSearch?AllField=%22Marie+Curie%22+radium+Nobel

Find medical sources with custom search term
{{Talk header|demospace=1|domain=medical|search_term1=Marie Curie|search_term2=radium|search_term3=Nobel}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}

User talk page version

Expected result: Simple talk header with search box, no find sources, and no archive links.

User talk page version and parameter test
{{Talk header|disclaimer=yes|namespace=User talk|noarchive=yes|search=yes}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}

Real world testing

Provided that the above tests pass, visit several talk pages and verify they look good as well. Verify that the links default to the correct domain and that the domain override works.

For those pages, use the URL pattern below to clear the server cache:

https://en.wikipedia.org/w/index.php?title=Talk:Medtronic&action=purge

See: E. WikiProject detection for complex test cases.

Plain

Plain
{{Talk header}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
Plain – no archives
{{Talk header|noarchive=yes}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
Plain – search
{{Talk header|search=yes}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
Plain – search and no archives
{{Talk header|noarchive=yes|search=yes}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
Plain – italic title
{{Talk header|italic title=yes}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
Plain – display_title
{{Talk header|display_title=someRandomTitle}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
Plain – archives_start
{{Talk header|archives_start=0}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}

arpol=yes / noarchive

arpol=yes
{{Talk header|arpol=yes}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
arpol=yes – no archives
{{Talk header|arpol=yes|noarchive=yes}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
arpol=yes – search
{{Talk header|arpol=yes|search=yes}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
arpol=yes – search and no archives
{{Talk header|arpol=yes|noarchive=yes|search=yes}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
arpol=yes – italic title
{{Talk header|arpol=yes|italic title=yes}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}

disclaimer=yes / namespace=User talk

disclaimer=yes|demospace=User talk
{{Talk header|demospace=User talk|disclaimer=yes}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
disclaimer=yes|demospace=User talk – no archives
{{Talk header|demospace=User talk|disclaimer=yes|noarchive=yes}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
disclaimer=yes|demospace=User talk – search
{{Talk header|demospace=User talk|disclaimer=yes|search=yes}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
disclaimer=yes|demospace=User talk – search and no archives
{{Talk header|demospace=User talk|disclaimer=yes|noarchive=yes|search=yes}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
disclaimer=yes|demospace=User talk – italic title
{{Talk header|demospace=User talk|disclaimer=yes|italic title=yes}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}

With shortcuts

(shortcut tasks collapsed until converted to {{Test case}})

arpol=yes and shortcuts

arpol=yes and two shortcuts
arpol=yes and two shortcuts
{{Talk header/sandbox}}
arpol=yes, one shortcut, and noarchive=yes
arpol=yes, one shortcut, and noarchive=yes
{{Talk header/sandbox}}
arpol=yes, search=yes, and two shortcuts
arpol=yes, search=yes, and two shortcuts
{{Talk header/sandbox}}
arpol=yes, search=yes, noarchive=yes, and two shortcuts arpol=yes
arpol=yes, search=yes, noarchive=yes, and two shortcuts arpol=yes
{{Talk header/sandbox}}
arpol=yes, italic title=yes, and two shortcuts
arpol=yes, italic title=yes, and two shortcuts
{{Talk header/sandbox}}

WikiProject

wp=yes
wp=yes
{{Talk header/sandbox}}
wp=yes, noarchive=yes
wp=yes, noarchive=yes
{{Talk header/sandbox}}
wp=yes, search=yes
wp=yes, search=yes
{{Talk header/sandbox}}
wp=yes, noarchive=yes, search=yes
wp=yes, noarchive=yes, search=yes
{{Talk header/sandbox}}

with demospace=1

wp=yes, demospace=1
wp=yes, demospace=1
{{Talk header/sandbox}}
wp=yes, noarchive=yes, demospace=1
wp=yes, noarchive=yes, demospace=1
{{Talk header/sandbox}}
wp=yes, search=yes, demospace=1
wp=yes, search=yes, demospace=1
{{Talk header/sandbox}}
wp=yes, noarchive=yes, search=yes, demospace=1
wp=yes, noarchive=yes, search=yes, demospace=1
{{Talk header/sandbox}}

bottom=yes

bottom=yes
{{Talk header|bottom=yes}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
bottom=yes – no archives
{{Talk header|bottom=yes|noarchive=yes}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
bottom=yes – search
{{Talk header|bottom=yes|search=yes}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
bottom=yes – search and no archives
{{Talk header|bottom=yes|noarchive=yes|search=yes}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
bottom=yes – italic title
{{Talk header|bottom=yes|italic title=yes}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}

Custom texts

custom_header=Custom header text
{{Talk header|custom_header=Custom header text}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
bottom=yes|custom_header=Custom header text
{{Talk header|bottom=yes|custom_header=Custom header text}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}

Find sources

A. Using search_term to change the default search

By default, the pagename is used as the argument to {{find sources}}. This can be altered with the use of |search_term=.

Find sources – control: no params (except demospace=1) shows find sources using the pagetitle
{{Talk header|demospace=1}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
Find sources – with search_term (5-word)
{{Talk header|demospace=1|search_term=United States embargo against Cuba}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
Find sources – with search_term (6-word)
{{Talk header|demospace=1|search_term=Clandestine press of the French Resistance}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
Find sources – with search_term (9-word)
{{Talk header|demospace=1|search_term=Collaboration with the Axis Powers during World War II}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}

B. Search_term, and search_term 1 thru 4

Find sources – control: no params (except demospace=1) shows find sources using the pagetitle
{{Talk header|demospace=1}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
Find sources – search_term shows find sources using the param value
{{Talk header|demospace=1|search_term=French Revolution}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
Find sources – search_term1 (expect:same as above)
{{Talk header|demospace=1|search_term1=French Revolution}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
Find sources – terms 1 & 2: shows find sources using the param values
{{Talk header|demospace=1|search_term1=French Revolution|search_term2=Napoleon}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
Find sources – terms 1, 2, & 3: shows find sources using the param values
{{Talk header|demospace=1|search_term1=French Revolution|search_term2=1791|search_term3=Louis XIV}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
Find sources – terms 1, 2, 3, & 4: shows find sources using the param values
{{Talk header|demospace=1|search_term1=French Revolution|search_term2=1791|search_term3=Louis XIV|search_term4=Terror}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
Find sources – terms 1 + domain: shows find sources using the param values
{{Talk header|demospace=1|domain=medical|search_term1=Marie Curie}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
Find sources – terms 1 and 2 + domain: shows find sources using the param values
{{Talk header|demospace=1|domain=medical|search_term1=Marie Curie|search_term2=radium}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
Find sources – terms 1, 2, 3 + domain: shows find sources using the param values
{{Talk header|demospace=1|domain=medical|search_term1=Marie Curie|search_term2=radium|search_term3=Nobel}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}

C. Opt-out find sources

The opt-out makes no sense, unless it's opted in before you opt it out. But opt-in is not the default in Template space, so we add param |demospace=1 to simulate the correct namespace so it would be included, then use the opt-out params to hide it again.

Find sources – control 1: no params (except demospace=1) shows find sources
{{Talk header|demospace=1}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
Find sources – control 2: 'hide_find_sources=no' is the default
{{Talk header|demospace=1|hide_find_sources=no}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
Opt-out hide_find_sources=yes hides the display
{{Talk header||demospace=1|hide_find_sources=yes}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}

Redo same trio, using alias |demospace=main:

Find sources – control 1: no params (except demospace=main) shows find sources
{{Talk header|demospace=main}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
Find sources – control 2: 'hide_find_sources=no' is the default
{{Talk header|demospace=main|hide_find_sources=no}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
Opt-out hide_find_sources=yes hides the display
{{Talk header||demospace=main|hide_find_sources=yes}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}

D. Param 'search-domain'

Article on medical topics get a different set of links generated by {{find medical sources}} rather than the regular template.

9c-1a. Param 'search-domain': find medical sources – control 1: no params (except demospace=main) shows find sources
{{Talk header|demospace=main|search-domain=medical}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
9c-1b. Param 'domain': (same as above)
{{Talk header|demospace=main|domain=medical}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
9c-2a. Param 'search-domain': find medical sources – control 2: 'hide_find_sources=no' is the default
{{Talk header|demospace=main|hide_find_sources=no|search-domain=medical}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
9c-2b. Param 'domain': (same as above)
{{Talk header|demospace=main|domain=medical|hide_find_sources=no}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
9c-3a. Param 'search-domain': medical+opt-out hide_find_sources=yes hides the display
{{Talk header|demospace=main|hide_find_sources=yes|search-domain=medical}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
9c-3b. Param 'domain': (same as above)
{{Talk header|demospace=main|domain=medical|hide_find_sources=yes}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
9c-4a. Param 'search-domain': find video sources – control 1: no params (except demospace=main) shows find sources
{{Talk header|demospace=main|search-domain=video game}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}
9c-4b. Param 'domain': (same as above)
{{Talk header|demospace=main|domain=video game}}
Side by side comparison
{{Talk header}}{{Talk header/sandbox}}


#invoke:Template test case

Template:Test case Template:Test case

E. WikiProject detection

Template:Cot These are external tests that rely on using Template:Tl transcluding the "Find sources" wrapper template (Template:Tl to choose the right domain-specific "find sources" template from among medical, video game, or general sources (and possibly others). Because these tests depend on using the WikiProjects listed in the Talk header template at the top of an article page, they cannot be tested in the normal way.

Template:Cot Template:Anchor The test cases can be performed either at Special:ExpandTemplates, or in situ at the Talk pages of actual articles which have the appropriate WikiProject listings already present, in Preview Mode. The easier method is probably to use ExpandTemplates.

Testing with ExpandTemplates

  1. go to Special:ExpandTemplates
  2. fill in the Context Title using one of the suggested Talk pages listed at the test cases below (E-1, E-2, ...)
  3. Paste invocations of the live and sandbox templates, with appropriate params (same params for each)
    Note: Template:Para must be included to prevent a runaway script from searching for endless, non-existent archives)
  4. Click [OK] and observe the results.

Example: to perform test E-1, choose an article from the E-1 list, like Illyriad, and do this:

  1. paste Talk:Illyriad into 'Context Title' (Note: this article belongs only to WP:WikiProject Video games.)
  2. paste the following text into the input wikitext box:
{{talk header|noarchive=yes}}
----
{{talk header/sandbox|noarchive=yes}}
3. Expected result: because this article is a member of WP:WikiProject Video games and not a member of project Medicine, the links displayed match those of Template:Tl.

Testing in situ

The other method is an in situ test. All of the 'tests in this section may be performed in situ in the following way:

  1. edit the Talk page of an article belonging to one or more WikiProjects detected by the template
  2. find the transclusion of template Template:Tlc (normally at the top of the Talk page; or add one)
  3. change it to Template:Tlc (+ optional params; see individual test cases below)
  4. click "Preview" button and observe the "find sources" links that are generated in the Talk header
  5. if the observed links match the "expected result" given in the test case, it's a "pass", otherwise, "fail".

Any article Talk page with the correct header and projects may be used for this; the lists in the Test cases defined below contains some suggested Talk pages with the correct WikiProjects on them to perform the test case. After viewing the test case result in Preview mode on the page, it's best to cancel out and not save the altered page. Template:Cob

Template:Anchor Template:Cot

E-1 Articles including project Video games
This test may be performed using ExpandTemplates or in situ testing. (see Methodology)

Use Template:Tl
Expected result: these should display links matching Template:Tl:

Template:Cob

Template:Anchor Template:Cot

E-2 Articles including project Medicine
This test may be performed using ExpandTemplates or in situ testing. (see Methodology)

Use Template:Tl
Expected result: these should display links matching Template:Tl

Note: the articles above only test the autodection feature for articles which transclude the wikiproject under its original name 'WikiProject Medicine' and without using a redirect. Complete testing of this feature requires testing some Talk pages of articles that incorporate a redirect to project Medicine. See test E-2a below for a selection of these.

For an additional list of sample articles employing redirects to project Medicine to use for testing, please see test B-2 here.

Template:Anchor Template:Cot

E-2a Articles using redirects to WikiProject Medicine

There are 15 redirects to WikiProject Medicine. Not all of them are in use on article Talk pages. A couple that are, include Template:Tl (hundreds of transclusions),

Articles using redirect Template:No redirectTemplate:Sndmore than 500 pages use Template:Tl;

Template:Cot

Template:Cob

Some examples for testing: (expected result: medical sources links are displayed in the TPH.

Sample article TPs for pages using other redirects to project Medicine:

Template:Cob

Template:Cob

Template:Anchor Template:Cot

E-3 Articles including project Biography
This test may be performed using ExpandTemplates or in situ testing. (see Methodology)

Use Template:Tl
Expected result: these should display links matching Template:Tl

Template:Cob

Template:Anchor Template:Cot

E-4 Project priority
articles that include multiple projects
This test may be performed using ExpandTemplates or in situ testing. (see Methodology)

These tests verify that the correct set of find sources links are displayed, for articles belonging to more than one project.

Use Template:Tl
Expected result: these should display links matching the Template:Tlc template corresponding to the search domain of the highest priority project on the page.

As of 1 Nov 2021, the priority sequence is: 1. medical, 2. video games, 3. general (legacy links). (Other domains like biographical and military are on the list for possible expansion of the template.) Further examples can be found using Petscan.

Template:Anchor Template:Cot E-4aTemplate:Sndmedical & biographical:

This test may be performed using ExpandTemplates or in situ testing. (see Methodology)

Expected result: Medical links (results match Template:Tlc)

Template:Cob

Template:Anchor Template:Cot E-4bTemplate:Sndvideo & biographical:

This test may be performed using ExpandTemplates or in situ testing. (see Methodology)

Expected result: Video links (results match Template:Tlc)

Template:Cob Template:Cob

Template:Anchor Template:Cot

E-5 Other articles not belonging to any of the automatically detected WikiProjects
This test may be performed using ExpandTemplates or in situ testing. (see Methodology)

These should default to the standard Template:Tl list:

(chosen from Special:Random)

Template:Cob

Template:Cob

F. WikiProject override

Template:Cot Please read the instructions in section #E. WikiProject detection first, to understand how they are set up, including how to execute a test case either by using Special:ExpandTemplates, or by using an in situ test.

As in that section, because the tests below depend on overriding the WikiProjects listed in the Talk header template at the top of an article page, they cannot be fully tested in the normal way. These tests may be performed in two ways: in situ, or via Special:ExpandTemplates. Where tests in this section differ from the test cases in the previous section, is that in these tests, we include a Template:Para param to override the WikiProject(s) detected by the template.

Here is an example of testing with ExpandTemplates, to override a video game Talk page with medical source links in the Talk header:

  1. go to Special:ExpandTemplates
  2. paste Talk:Illyriad into 'Context Title'. (Note: this article belongs to WP:WikiProject Video games)
  3. paste the following text into the input wikitext box:
{{tlc|talk header|noarchives=yes|domain=medical}}
----
{{tlc|talk header/sandbox|noarchives=yes|domain=medical}}

3. Expected result: although this is not a member of project Medicine, the links displayed match Template:Tl.

The other way to execute a test case, is in situ: add a Talk header with a Template:Para param to the Talk pages of actual articles which have the appropriate Talk page headers and WikiProject listings (without saving):

  • edit the Talk page header of an article belonging to, say, WikiProject medicine
  • find the transclusion of Template:Tlc (normally at the top of the page)
  • change it to (or add:) Template:Tlc, hit Preview, and take note of the "find sources" links that are generated
  • execute a set of domain override tests on this page:

Any article Talk page may be used for these tests; for suggested articles, see the list in test section #E. WikiProject detection above, which contains some suggested Talk pages with the correct WikiProjects on it to autodetect a project, and to override it using the Template:Para param, and observe the results. After viewing the test case result in Preview mode on the page, it's best to just cancel out and not save the Previewed page. Template:Cob

G. Namespace detection

Find sources links should only be emitted in the Talk header, when the template is placed on article talk pages (ns:1) or Draft talk pages (ns:119). In any other namespace, no find sources are emitted.

Template:Cot These tests may be performed in two ways: via Special:ExpandTemplates, or in situ.

Here is an example of testing with ExpandTemplates, to test whether find sources links are emitted in Draft talk space:

  1. find the name of some article in Draft that has a talk page
    • From the search box at the top of any page, type Template:Pval, and pick an article from the search suggestions dropdown list
  2. go to Special:ExpandTemplates and use one of the suggestions to test
    • paste one of the suggested 'Draft talk:' pages into 'Context Title'
    • paste the following text the input wikitext box: Template:Tlc
  3. Expected result: the Talk header template displayed by ExpandTemplates should show find sources links which search for the Context title

The other way to execute a test case, is in situ:

  • find a Draft talk page and open it for editing
  • find the transclusion of Template:Tlc (normally at the top of the page)
  • change it to (or add one if it doesn't have it:) Template:Tlc, and hit Preview
  • Expected result: "find sources" links are found in the Talk header box for the page

Any Draft talk page may be used for these tests. After viewing the test case result in Preview mode on the page, it's best to just cancel out and not save the Previewed page. Template:Cob