def METHOD_NAME(title, directory, fileToDeploy, extension, verifications, postbootcommands):
	if directory is not None:
		print("Build "+title)
		mvn_path = findMaven()
		os.chdir(directory)
		subprocess.run([mvn_path, 'clean', 'package'])
		os.chdir("target")
	CDIReproducerTargetPath = os.getcwd()
	print("Prepare postbootcommandfile");
	os.chdir(TEST_PATH)
	postbootcommandfile = open("postboot.asadmin", "w")
	for postbootcommand in postbootcommands:
		postbootcommandfile.write(postbootcommand+"\n")
	if fileToDeploy is not None:
		postbootcommandfile.write("deploy "+os.path.join(CDIReproducerTargetPath, fileToDeploy+"."+extension)+"\n")
	postbootcommandfile.close()
	print("Run Payara with postbootcommand file parameter")
	print("Search log for 'Reading in commands from .../postboot.asadmin' right after server start")
	print("Changing path to Payara: "+PAYARA_PATH_BIN)
	print("Going to Payara dir: '"+os.path.join(PAYARA_PATH_BIN, "bin")+"'")
	if not os.path.isdir(PAYARA_PATH_BIN):
		raise Exception("Unable to find Payara, used: '" + PAYARA_PATH_BIN + "', try to set PAYARA_HOME env. variable") 
	os.chdir(os.path.join(PAYARA_PATH_BIN, "bin"))
	asadmin_cmd = os.path.join('.', 'asadmin')
	if platform.system() == "Windows":
		asadmin_cmd = asadmin_cmd + ".bat"
	subprocess.run([asadmin_cmd , 'start-domain', '--postbootcommandfile', os.path.join(TEST_PATH, 'postboot.asadmin')])
	testErrors = 0;
	for verification in verifications:
		urlToDownload = verification[0]
		textToVerify = verification[1]
		url = urlToDownload
		if not url.startswith("http"):
			url = "http://localhost:8080/"+urlToDownload
		print("Trying to load url: "+url)
		pageContent = ""
		attempts = 1
		headers = {"User-Agent": "Real Python", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"}
		while True:
			error = None
			response = None
			try:
				#print("Creating request")
				urlRequest = urllib.request.Request(url, headers=headers)
				with urllib.request.urlopen(urlRequest) as response:
					#print("Reading it")
					pageBytes = response.read()
					#print("Parsing to string")
					pageContent = pageBytes.decode('utf-8')
					#print("Page content: >>"+pageContent+"<<")
			except BaseException as ex:
				error = "ERROR: Unable to open the url: "+url+", "+str(ex)
			finally:
				if response is not None:
					#print("Closing")
					response.close()
			if textToVerify in pageContent:
				print("OK: "+urlToDownload)
				break
			else:
				error = textToVerify + " not found in the output, was: "+pageContent
			if error is not None:
				if attempts<ATTEMPTS:
					print("Attempt #" + str(attempts) + ": " + error)
					attempts=attempts+1
					time.sleep(1) # wait a second before another attempt
				else:
					print("ERROR! " + error)
					# add error if all attempts failed
					testErrors += 1
					break
	#input("Press enter to shutdown")
	if fileToDeploy is not None:
		print("Undeploying")
		subprocess.run([asadmin_cmd, 'undeploy', fileToDeploy])
	print("Shutdown Payara")
	subprocess.run([asadmin_cmd, 'stop-domain'])
	# cleanup
	os.chdir(TEST_PATH)
	os.remove("postboot.asadmin") 
	return testErrors