{
	"description": "Tree format: Insert elements with multiple parents multiple times",
	"setup": [
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Has parent",
			"contents": "[[Has type::Page]]"
		},
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Part of",
			"contents": "[[Has type::Text]]"
		},
		{
			"namespace": "NS_TEMPLATE",
			"page": "Example/Tree format template",
			"contents": "FOO{{{1|}}}BAR"
		},
		{
			"page": "Example/Tree 1",
			"contents": "<!-- No parent -->[[Part of::Tree test]]"
		},
		{
			"page": "Example/Tree 2",
			"contents": "<!-- No parent -->[[Part of::Tree test]]"
		},
		{
			"page": "Example/Tree 3",
			"contents": "<!-- No parent -->[[Part of::Tree test]]"
		},
		{
			"page": "Example/Tree 11",
			"contents": "[[Has parent::Example/Tree 1]][[Part of::Tree test]]"
		},
		{
			"page": "Example/Tree 12",
			"contents": "[[Has parent::Example/Tree 1]][[Has parent::Example/Tree 2]][[Part of::Tree test]]"
		},
		{
			"page": "Example/Tree 13",
			"contents": "[[Has parent::Example/Tree 1]][[Part of::Tree test]]"
		},
		{
			"page": "Example/Tree 121",
			"contents": "[[Has parent::Example/Tree 12]][[Part of::Tree test]]"
		},
		{
			"page": "Example/Tree 06-01",
			"contents": "<div>{{#ask:[[Part of::Tree test]] |format=tree |parent=Has parent }}</div>"
		},
		{
			"page": "Example/Tree 06-02",
			"contents": "<div>{{#ask:[[Part of::Tree test]] |format=tree |parent=Has parent |template=Example/Tree format template }}</div>"
		}
	],
	"tests": [
		{
			"type": "parser-html",
			"about": "Tree 06-01 (Insert elements with multiple parents multiple times)",
			"subject": "Example/Tree 06-01",
			"assert-output": {
				"to-contain": [
					"div > ul > li:nth-child(1) > a[title=\"Example/Tree 1\"] + ul > li:nth-child(1) > a[title=\"Example/Tree 11\"]:only-child",
					"div > ul > li:nth-child(1) > a[title=\"Example/Tree 1\"] + ul > li:nth-child(2) > a[title=\"Example/Tree 12\"] + ul > li:only-child > a[title=\"Example/Tree 121\"]:only-child",
					"div > ul > li:nth-child(1) > a[title=\"Example/Tree 1\"] + ul > li:nth-child(3) > a[title=\"Example/Tree 13\"]:only-child",

					"div > ul > li:nth-child(2) > a[title=\"Example/Tree 2\"] + ul > li:only-child > a[title=\"Example/Tree 12\"] + ul > li:only-child > a[title=\"Example/Tree 121\"]:only-child",

					"div > ul > li:nth-child(3) > a[title=\"Example/Tree 3\"]:only-child",

					[ "div > ul > li", 3 ],
					[ "div > ul > li > ul > li", 4 ],
					[ "div > ul > li > ul > li > ul > li", 2 ]
				]
			}
		},
		{
			"type": "parser-html",
			"about": "Tree 06-02-1 (Insert elements with multiple parents multiple times (with template)) - structure",
			"subject": "Example/Tree 06-02",
			"assert-output": {
				"to-contain": [
					"div > ul > li:nth-child(1) > a[title=\"Example/Tree 1\"] + ul > li:nth-child(1) > a[title=\"Example/Tree 11\"]:only-child",
					"div > ul > li:nth-child(1) > a[title=\"Example/Tree 1\"] + ul > li:nth-child(2) > a[title=\"Example/Tree 12\"] + ul > li:only-child > a[title=\"Example/Tree 121\"]:only-child",
					"div > ul > li:nth-child(1) > a[title=\"Example/Tree 1\"] + ul > li:nth-child(3) > a[title=\"Example/Tree 13\"]:only-child",

					"div > ul > li:nth-child(2) > a[title=\"Example/Tree 2\"] + ul > li:only-child > a[title=\"Example/Tree 12\"] + ul > li:only-child > a[title=\"Example/Tree 121\"]:only-child",

					"div > ul > li:nth-child(3) > a[title=\"Example/Tree 3\"]:only-child",

					[ "div > ul > li", 3 ],
					[ "div > ul > li > ul > li", 4 ],
					[ "div > ul > li > ul > li > ul > li", 2 ]
				]
			}
		},
		{
			"type": "parser",
			"about": "Tree 06-02-2 (Insert elements with multiple parents multiple times (with template)) - content",
			"subject": "Example/Tree 06-02",
			"assert-output": {
				"to-contain": [
					"FOO.*Example/Tree 1.*BAR",
					"FOO.*Example/Tree 11.*BAR",
					"FOO.*Example/Tree 12.*BAR",
					"FOO.*Example/Tree 121.*BAR",
					"FOO.*Example/Tree 13.*BAR",
					"FOO.*Example/Tree 2.*BAR",
					"FOO.*Example/Tree 3.*BAR"
				]
			}
		}
	],
	"settings": {
		"wgContLang": "en",
		"wgLang": "en",
		"smwgNamespacesWithSemanticLinks": {
			"NS_MAIN": true,
			"SMW_NS_PROPERTY": true
		}
	},
	"meta": {
		"version": "2",
		"is-incomplete": false,
		"debug": true
	}
}