<commit_before>local test		= require("cp.test")
local log		= require("hs.logger").new("testfcpids")

local fcp		= require("cp.finalcutpro")
local ids		= require("cp.finalcutpro.ids")
local just		= require("cp.just")

local function reset()
	fcp:launch()
	fcp:selectMenu("Window", "Workspaces", "Default")
end

local function run()
	test("Launch FCP", function()
		-- Launch FCP
		fcp:launch()
		ok(fcp:isRunning(), "FCP is running")
	end)

	test("Check FCP Primary Components", function()
		-- Reset to the default workspace
		reset()

		-- Test that various UI elements are able to be found.
		ok(fcp:primaryWindow():isShowing(), "Primary Window not showing")
		ok(fcp:browser():isShowing(), "Browser is showing")
		ok(fcp:timeline():isShowing(), "Timeline is showing")
		ok(fcp:inspector():isShowing(), "Inspector is showing")
		ok(fcp:viewer():isShowing(), "Viewer is showing")
		ok(not fcp:eventViewer():isShowing(), "Event Viewer is not showing")
	end)
	
	test("Check Event Viewer", function()
		-- Reset to default workspace
		reset()
		
		-- Turn it on and off.
		ok(not fcp:eventViewer():isShowing(), "Event Viewer is initially not showing")
		fcp:eventViewer():showOnPrimary()
		ok(fcp:eventViewer():isShowing(), "Event Viewer displays after showing")
		fcp:eventViewer():hide()
		ok(not fcp:eventViewer():isShowing(), "Event Viewer does not display after hiding")
	end)
	
	test("Command Editor", function()
		reset()
		
		-- The Command Editor.
		ok(not fcp:commandEditor():isShowing(), "Command Editor is not showing")
		fcp:commandEditor():show()
		ok(fcp:commandEditor():isShowing(), "Command Editor is showing")
		ok(fcp:commandEditor():saveButton():UI() ~= nil, "Command Editor 'Save' button found")
		fcp:commandEditor():hide()
		ok(not fcp:commandEditor():isShowing(), "Command Editor is not showing")
	end)
	
	test("Export Dialog", function()
		reset()
		
		-- Export Dialog
		ok(not fcp:exportDialog():isShowing(), "Export Dialog is not showing")
		fcp:exportDialog():show()
		ok(fcp:exportDialog():isShowing(), "Export Dialog is showing")
		fcp:exportDialog():hide()
		ok(not fcp:exportDialog():isShowing(), "Export Dialog is closed")
	end)
	
	test("Media Importer", function()
		reset()
		
		-- Media Importer
		ok(not fcp:mediaImport():isShowing(), "Media Import should not be showing yet")
		fcp:mediaImport():show()
		ok(fcp:mediaImport():isShowing(), "Media Import should be showing")
		fcp:mediaImport():hide()
		-- The window takes a moment to close sometimes, give it a second.
		just.doWhile(function() return fcp:mediaImport():isShowing() end, 1.0)
		ok(not fcp:mediaImport():isShowing(), "Media Import should not be showing now")
	end)
	
	test("Effects Browser", function()
		reset()
		
		local browser = fcp:effects()
		browser:show()
		ok(browser:isShowing())
		ok(browser:sidebar():isShowing())
		ok(browser:contents():isShowing())
		browser:hide()
		ok(not browser:isShowing())
	end)
	
	test("Transitions Browser", function()
		reset()
		
		local browser = fcp:transitions()
		browser:show()<commit_msg>#474 * Removed comments so that file/line number lists in the ‘FAIL’ messages.<commit_after>local test		= require("cp.test")
local log		= require("hs.logger").new("testfcpids")

local fcp		= require("cp.finalcutpro")
local ids		= require("cp.finalcutpro.ids")
local just		= require("cp.just")

local function reset()
	fcp:launch()
	fcp:selectMenu("Window", "Workspaces", "Default")
end

local function run()
	test("Launch FCP", function()
		-- Launch FCP
		fcp:launch()
		ok(fcp:isRunning(), "FCP is running")
	end)

	test("Check FCP Primary Components", function()
		-- Reset to the default workspace
		reset()

		-- Test that various UI elements are able to be found.
		ok(fcp:primaryWindow():isShowing())
		ok(fcp:browser():isShowing())
		ok(fcp:timeline():isShowing())
		ok(fcp:inspector():isShowing())
		ok(fcp:viewer():isShowing())
		ok(not fcp:eventViewer():isShowing())
	end)
	
	test("Check Event Viewer", function()
		-- Reset to default workspace
		reset()
		
		-- Turn it on and off.
		ok(not fcp:eventViewer():isShowing())
		fcp:eventViewer():showOnPrimary()
		ok(fcp:eventViewer():isShowing())
		fcp:eventViewer():hide()
		ok(not fcp:eventViewer():isShowing())
	end)
	
	test("Command Editor", function()
		reset()
		
		-- The Command Editor.
		ok(not fcp:commandEditor():isShowing())
		fcp:commandEditor():show()
		ok(fcp:commandEditor():isShowing())
		ok(fcp:commandEditor():saveButton():UI() ~= nil)
		fcp:commandEditor():hide()
		ok(not fcp:commandEditor():isShowing())
	end)
	
	test("Export Dialog", function()
		reset()
		
		-- Export Dialog
		ok(not fcp:exportDialog():isShowing())
		fcp:exportDialog():show()
		ok(fcp:exportDialog():isShowing())
		fcp:exportDialog():hide()
		ok(not fcp:exportDialog():isShowing())
	end)
	
	test("Media Importer", function()
		reset()
		
		-- Media Importer
		ok(not fcp:mediaImport():isShowing())
		fcp:mediaImport():show()
		ok(fcp:mediaImport():isShowing())
		fcp:mediaImport():hide()
		-- The window takes a moment to close sometimes, give it a second.
		just.doWhile(function() return fcp:mediaImport():isShowing() end, 1.0)
		ok(not fcp:mediaImport():isShowing())
	end)
	
	test("Effects Browser", function()
		reset()
		
		local browser = fcp:effects()
		browser:show()
		ok(browser:isShowing())
		ok(browser:sidebar():isShowing())
		ok(browser:contents():isShowing())
		browser:hide()
		ok(not browser:isShowing())
	end)
	
	test("Transitions Browser", function()
		reset()
		
		local browser = fcp:transitions()
		browser:show()
{'fraction_non_alphanumeric': 0.16413318856315598, 'fraction_numerical': 0.0012667390517553383, 'mean_word_length': 5.287827076222981, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3614250', 'n_tokens_mistral': 2022, 'n_tokens_neox': 1827, 'n_words': 446}