summaryrefslogtreecommitdiff
path: root/tests/qunit/index.html
blob: ef7ff8dea9c98633afed4b257f49b9f550cadd85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<!DOCTYPE html>
<html>
<head>
	<title>MediaWiki JavaScript Test Suite</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<!-- MediaWiki Modules -->

	<!-- MW: startup -->
	<script>
	function startUp(){
		mw.config = new mw.Map( false );

		/**
		 * Simulate an average mw.config context
		 */
		/* StartUp module */
		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": []});
		
		/* WikiPage specific */
		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"});
		
		/**
		 * Fix wgScriptPath and the like to the real thing,
		 * instead of fake ones (for access to /tests/qunit/data/)
		 */

		// Regular expression to extract the path for the QUnit tests
		// Takes into account that tests could be run from a file:// URL
		// by excluding the 'index.html' part from the URL
		var rePath = /(?:[^#\?](?!index.html))*\/?/;

		// Extract path to /tests/qunit/
		var qunitTestsPath = rePath.exec( location.pathname )[0];

		// Traverse up to script path
		var pathParts = qunitTestsPath.split( '/' );
		pathParts.pop(); pathParts.pop(); pathParts.pop();
		var scriptPath = pathParts.join( '/' );
		
		mw.config.set({
			"wgServer": location.protocol + '//' + location.host,
			"wgScriptPath": scriptPath,
			"wgLoadScript": scriptPath + '/load.php',
			"stylepath": scriptPath + '/skins',
			"wgArticlePath": scriptPath + '/index.php/$1',
			"wgScript": scriptPath + '/index.php',
			"wgExtensionAssetsPath": scriptPath + '/extensions'
		});
	}
	</script>

	<!-- MW: jquery|mediawiki -->
	<script src="../../resources/jquery/jquery.js"></script>
	<script src="../../resources/mediawiki/mediawiki.js"></script>

	<!-- MW: mediawiki.page.startup -->
	<script src="../../resources/jquery/jquery.client.js"></script>
	<script src="../../resources/mediawiki/mediawiki.util.js"></script>
	<script src="../../resources/mediawiki.page/mediawiki.page.startup.js"></script>

	<!-- MW: mediawiki.user|mediawiki.page.ready -->
	<script src="../../resources/jquery/jquery.cookie.js"></script>
	<script src="../../resources/mediawiki/mediawiki.user.js"></script>

	<script src="../../resources/jquery/jquery.messageBox.js"></script>
	<script src="../../resources/jquery/jquery.mwExtension.js"></script>

	<script src="../../resources/jquery/jquery.checkboxShiftClick.js"></script>
	<script src="../../resources/jquery/jquery.makeCollapsible.js"></script>
	<script src="../../resources/jquery/jquery.placeholder.js"></script>
	<script src="../../resources/mediawiki.page/mediawiki.page.ready.js"></script>

	<!-- MW: user.options -->
	<script>
	mw.user.options.set({"skin": "vector"});
	</script>

	<!-- MW: Non-default modules -->
	<script src="../../resources/jquery/jquery.autoEllipsis.js"></script>
	<script src="../../resources/jquery/jquery.byteLength.js"></script>
	<script src="../../resources/jquery/jquery.byteLimit.js"></script>
	<script src="../../resources/jquery/jquery.colorUtil.js"></script>
	<script src="../../resources/jquery/jquery.delayedBind.js"></script>
	<script src="../../resources/jquery/jquery.getAttrs.js"></script>
	<script src="../../resources/jquery/jquery.highlightText.js"></script>
	<script src="../../resources/jquery/jquery.localize.js"></script>
	<script src="../../resources/jquery/jquery.tabIndex.js"></script>
	<script src="../../resources/jquery/jquery.tablesorter.js"></script>
	<script src="../../resources/jquery/jquery.textSelection.js"></script>
	<script src="../../resources/mediawiki/mediawiki.Title.js"></script>
	<script src="../../resources/mediawiki.language/mediawiki.language.js"></script>
	<script src="../../resources/mediawiki/mediawiki.jqueryMsg.js"></script>
	<script src="../../resources/mediawiki.special/mediawiki.special.js"></script>
	<script src="../../resources/mediawiki.special/mediawiki.special.recentchanges.js"></script>

	<!-- QUnit: Load framework -->
	<link rel="stylesheet" href="../../resources/jquery/jquery.qunit.css" />
	<script src="../../resources/jquery/jquery.qunit.js"></script>
	<script src="../../resources/jquery/jquery.qunit.completenessTest.js"></script>
	<script src="data/testrunner.js"></script>

	<!-- QUnit: Load test suites (maintain the same order as above please) -->
	<script src="suites/resources/mediawiki/mediawiki.jscompat.test.js"></script>
	<script src="suites/resources/mediawiki/mediawiki.test.js"></script>
	<script src="suites/resources/mediawiki/mediawiki.user.test.js"></script>

	<script src="suites/resources/jquery/jquery.client.test.js"></script>
	<script src="suites/resources/jquery/jquery.mwExtension.test.js"></script>
	<script src="suites/resources/mediawiki/mediawiki.util.test.js"></script>

	<script src="suites/resources/jquery/jquery.autoEllipsis.test.js"></script>
	<script src="suites/resources/jquery/jquery.byteLength.test.js"></script>
	<script src="suites/resources/jquery/jquery.byteLimit.test.js"></script>
	<script src="suites/resources/jquery/jquery.colorUtil.test.js"></script>
	<script src="suites/resources/jquery/jquery.delayedBind.test.js"></script>
	<script src="suites/resources/jquery/jquery.getAttrs.test.js"></script>
	<script src="suites/resources/jquery/jquery.highlightText.test.js"></script>
	<script src="suites/resources/jquery/jquery.localize.test.js"></script>
	<script src="suites/resources/jquery/jquery.tabIndex.test.js"></script>
	<script src="suites/resources/jquery/jquery.tablesorter.test.js" charset="UTF-8"></script>
	<script src="suites/resources/jquery/jquery.textSelection.test.js" charset="UTF-8"></script>
	<script src="suites/resources/mediawiki/mediawiki.Title.test.js"></script>
	<script src="suites/resources/mediawiki/mediawiki.jqueryMsg.test.js"></script>
	<script src="suites/resources/mediawiki.special/mediawiki.special.recentchanges.test.js"></script>
</head>
<body>
	<h1 id="qunit-header">MediaWiki JavaScript Test Suite</h1>
	<h2 id="qunit-banner"></h2>
	<div id="qunit-testrunner-toolbar">
		<p><a href="http://www.mediawiki.org/wiki/Manual:JavaScript_unit_testing">See testing documentation on mediawiki.org</a></p>
	</div>
	<h2 id="qunit-userAgent"></h2>
	<ol id="qunit-tests"></ol>
	<div id="qunit-fixture"></div>

<!-- Scripts inserting stuff here shall remove it themselfs! -->
<div id="content"></div>
</body>
</html>