4 <title>MediaWiki JavaScript Test Suite
</title>
5 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8" />
6 <!-- MediaWiki Modules -->
11 mw.config = new mw.Map( false );
14 * Simulate an average mw.config context
17 mw.config.set({
"wgLoadScript":
"/mw/trunk/phase3/load.php",
"debug": true,
"skin":
"vector",
"stylepath":
"/mw/trunk/phase3/skins",
"wgUrlProtocols":
"http\\:\\/\\/|https\\:\\/\\/|ftp\\:\\/\\/|irc\\:\\/\\/|ircs\\:\\/\\/|gopher\\:\\/\\/|telnet\\:\\/\\/|nntp\\:\\/\\/|worldwind\\:\\/\\/|mailto\\:|news\\:|svn\\:\\/\\/|git\\:\\/\\/|mms\\:\\/\\/|\\/\\/",
"wgArticlePath":
"/mw/trunk/phase3/index.php/$1",
"wgScriptPath":
"/mw/trunk/phase3",
"wgScriptExtension":
".php",
"wgScript":
"/mw/trunk/phase3/index.php",
"wgVariantArticlePath": false,
"wgActionPaths": [],
"wgServer":
"http://localhost",
"wgUserLanguage":
"en",
"wgContentLanguage":
"en",
"wgVersion":
"1.19alpha",
"wgEnableAPI": true,
"wgEnableWriteAPI": true,
"wgDefaultDateFormat":
"dmy",
"wgMonthNames": [
"",
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"],
"wgMonthNamesShort": [
"",
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"],
"wgMainPageTitle":
"Main Page",
"wgFormattedNamespaces": {
"-2":
"Media",
"-1":
"Special",
"0":
"",
"1":
"Talk",
"2":
"User",
"3":
"User talk",
"4":
"Testopedia",
"5":
"Testopedia talk",
"6":
"File",
"7":
"File talk",
"8":
"MediaWiki",
"9":
"MediaWiki talk",
"10":
"Template",
"11":
"Template talk",
"12":
"Help",
"13":
"Help talk",
"14":
"Category",
"15":
"Category talk"},
"wgNamespaceIds": {
"media": -
2,
"special": -
1,
"":
0,
"talk":
1,
"user":
2,
"user_talk":
3,
"testopedia":
4,
"testopedia_talk":
5,
"file":
6,
"file_talk":
7,
"mediawiki":
8,
"mediawiki_talk":
9,
"template":
10,
"template_talk":
11,
"help":
12,
"help_talk":
13,
"category":
14,
"category_talk":
15,
"image":
6,
"image_talk":
7,
"project":
4,
"project_talk":
5},
"wgSiteName":
"Testopedia",
"wgFileExtensions": [
"png",
"gif",
"jpg",
"jpeg"],
"wgDBname":
"mediawiki",
"wgFileCanRotate": true,
"wgAvailableSkins": {
"chick":
"Chick",
"cologneblue":
"CologneBlue",
"modern":
"Modern",
"monobook":
"MonoBook",
"myskin":
"MySkin",
"nostalgia":
"Nostalgia",
"simple":
"Simple",
"standard":
"Standard",
"vector":
"Vector"},
"wgExtensionAssetsPath":
"/mw/trunk/phase3/extensions",
"wgCookiePrefix":
"mediawiki",
"wgResourceLoaderMaxQueryLength": -
1,
"wgCaseSensitiveNamespaces": []});
19 /* WikiPage specific */
20 mw.config.set({
"wgCanonicalNamespace":
"",
"wgCanonicalSpecialPageName": false,
"wgNamespaceNumber":
0,
"wgPageName":
"Sandbox",
"wgTitle":
"Sandbox",
"wgCurRevisionId":
486,
"wgArticleId":
84,
"wgIsArticle": true,
"wgAction":
"view",
"wgUserName": null,
"wgUserGroups": [
"*"],
"wgCategories": [],
"wgBreakFrames": false,
"wgPageContentLanguage":
"en",
"wgSeparatorTransformTable": [
"",
""],
"wgDigitTransformTable": [
"",
""],
"wgRestrictionEdit": [],
"wgRestrictionMove": [],
"wgRedirectedFrom":
"Sandbox"});
22 /* Special:JavaScriptTest/qunit specific */
23 mw.config.set({
"QUnitTestSwarmInjectJSPath": false});
26 * Fix wgScriptPath and the like to the real thing,
27 * instead of fake ones (for access to /tests/qunit/data/)
30 // Regular expression to extract the path for the QUnit tests
31 // Takes into account that tests could be run from a file:// URL
32 // by excluding the 'index.html' part from the URL
33 var rePath = /(?:[^#\?](?!index.html))*\/?/;
35 // Extract path to /tests/qunit/
36 var qunitTestsPath = rePath.exec( location.pathname )[
0];
38 // Traverse up to script path
39 var pathParts = qunitTestsPath.split( '/' );
40 pathParts.pop(); pathParts.pop(); pathParts.pop();
41 var scriptPath = pathParts.join( '/' );
44 "wgServer": location.protocol + '//' + location.host,
45 "wgScriptPath": scriptPath,
46 "wgLoadScript": scriptPath + '/load.php',
47 "stylepath": scriptPath + '/skins',
48 "wgArticlePath": scriptPath + '/index.php/$
1',
49 "wgScript": scriptPath + '/index.php',
50 "wgExtensionAssetsPath": scriptPath + '/extensions'
55 <!-- MW: jquery|mediawiki -->
56 <script src=
"../../resources/jquery/jquery.js"></script>
57 <script src=
"../../resources/mediawiki/mediawiki.js"></script>
59 <!-- MW: mediawiki.user|mediawiki.util|mediawiki.page.startup|mediawiki.page.ready -->
60 <script src=
"../../resources/jquery/jquery.client.js"></script>
61 <script src=
"../../resources/jquery/jquery.cookie.js"></script>
62 <script src=
"../../resources/mediawiki/mediawiki.user.js"></script>
64 <script src=
"../../resources/jquery/jquery.messageBox.js"></script>
65 <script src=
"../../resources/jquery/jquery.mwExtension.js"></script>
66 <script src=
"../../resources/mediawiki/mediawiki.util.js"></script>
67 <script src=
"../../resources/mediawiki.page/mediawiki.page.startup.js"></script>
69 <script src=
"../../resources/jquery/jquery.checkboxShiftClick.js"></script>
70 <script src=
"../../resources/jquery/jquery.makeCollapsible.js"></script>
71 <script src=
"../../resources/jquery/jquery.placeholder.js"></script>
72 <script src=
"../../resources/mediawiki.page/mediawiki.page.ready.js"></script>
74 <!-- MW: user.options -->
76 mw.user.options.set({
"skin":
"vector"});
79 <!-- MW: Non-default modules -->
80 <script src=
"../../resources/jquery/jquery.autoEllipsis.js"></script>
81 <script src=
"../../resources/jquery/jquery.byteLength.js"></script>
82 <script src=
"../../resources/jquery/jquery.byteLimit.js"></script>
83 <script src=
"../../resources/jquery/jquery.colorUtil.js"></script>
84 <script src=
"../../resources/jquery/jquery.delayedBind.js"></script>
85 <script src=
"../../resources/jquery/jquery.getAttrs.js"></script>
86 <script src=
"../../resources/jquery/jquery.highlightText.js"></script>
87 <script src=
"../../resources/jquery/jquery.localize.js"></script>
88 <script src=
"../../resources/jquery/jquery.tabIndex.js"></script>
89 <script src=
"../../resources/jquery/jquery.tablesorter.js"></script>
90 <script src=
"../../resources/jquery/jquery.textSelection.js"></script>
91 <script src=
"../../resources/mediawiki/mediawiki.Title.js"></script>
92 <script src=
"../../resources/mediawiki.language/mediawiki.language.js"></script>
93 <script src=
"../../resources/mediawiki/mediawiki.jqueryMsg.js"></script>
94 <script src=
"../../resources/mediawiki.special/mediawiki.special.js"></script>
95 <script src=
"../../resources/mediawiki.special/mediawiki.special.recentchanges.js"></script>
97 <!-- QUnit: Load framework -->
98 <link rel=
"stylesheet" href=
"../../resources/jquery/jquery.qunit.css" />
99 <script src=
"../../resources/jquery/jquery.qunit.js"></script>
100 <script src=
"../../resources/jquery/jquery.qunit.completenessTest.js"></script>
101 <script src=
"data/testrunner.js"></script>
103 <!-- QUnit: Load test suites (maintain the same order as above please) -->
104 <script src=
"suites/resources/mediawiki/mediawiki.jscompat.test.js"></script>
105 <script src=
"suites/resources/mediawiki/mediawiki.test.js"></script>
106 <script src=
"suites/resources/mediawiki/mediawiki.user.test.js"></script>
108 <script src=
"suites/resources/jquery/jquery.client.test.js"></script>
109 <script src=
"suites/resources/jquery/jquery.mwExtension.test.js"></script>
110 <script src=
"suites/resources/mediawiki/mediawiki.util.test.js"></script>
112 <script src=
"suites/resources/jquery/jquery.autoEllipsis.test.js"></script>
113 <script src=
"suites/resources/jquery/jquery.byteLength.test.js"></script>
114 <script src=
"suites/resources/jquery/jquery.byteLimit.test.js"></script>
115 <script src=
"suites/resources/jquery/jquery.colorUtil.test.js"></script>
116 <script src=
"suites/resources/jquery/jquery.delayedBind.test.js"></script>
117 <script src=
"suites/resources/jquery/jquery.getAttrs.test.js"></script>
118 <script src=
"suites/resources/jquery/jquery.highlightText.test.js"></script>
119 <script src=
"suites/resources/jquery/jquery.localize.test.js"></script>
120 <script src=
"suites/resources/jquery/jquery.tabIndex.test.js"></script>
121 <script src=
"suites/resources/jquery/jquery.tablesorter.test.js" charset=
"UTF-8"></script>
122 <script src=
"suites/resources/jquery/jquery.textSelection.test.js" charset=
"UTF-8"></script>
123 <script src=
"suites/resources/mediawiki/mediawiki.Title.test.js"></script>
124 <script src=
"suites/resources/mediawiki/mediawiki.jqueryMsg.test.js"></script>
125 <script src=
"suites/resources/mediawiki.special/mediawiki.special.recentchanges.test.js"></script>
128 <h1 id=
"qunit-header">MediaWiki JavaScript Test Suite
</h1>
129 <h2 id=
"qunit-banner"></h2>
130 <div id=
"qunit-testrunner-toolbar">
131 <p><a href=
"http://www.mediawiki.org/wiki/Manual:JavaScript_unit_testing">See testing documentation on mediawiki.org
</a></p>
133 <h2 id=
"qunit-userAgent"></h2>
134 <ol id=
"qunit-tests"></ol>
135 <div id=
"qunit-fixture"></div>
137 <!-- Scripts inserting stuff here shall remove it themselfs! -->
138 <div id=
"content"></div>