Test Author: Unknown
If it breaks: John

Sound and Notifications Test (15 min)-------------------------------------------

----Terminology-----------------------------------------------------------------
	OWSD - Orderbook Window Settings Dialog
	NSD - Notification Settings Dialog (application-level, it will be used near the end of the test)
	Trigger - a sound/notification "trigger-item" that can be added/removed from in the OWSD (the whole test revolves around these sound/notification triggers)
	[Test]Sections - each numbered item is a "section"
	[Section]Steps - the hyphenated instructions within each [test]section
--------------------------------------------------------------------------------

----FYI-------------------------------------------------------------------------
	- there is a "How-To Reference" at the bottom of the test; hopefully the ui is intuitive enough that you don't need it.
	- steps that have a corresponding "how-to" reference will indicate this with an asterisk
--------------------------------------------------------------------------------

0) Prepare:
	- Sounds are enabled by default, but we now have a key that can enable/disable them from the server as well. This was necessary to prevent crashing on systems without connected sound devices. If this key exists in your spark.conf, please make sure it's enabled = true (or simply remove it)
SoundNotifications {
    enabled = true
}

	- open an OrderBook, then click the Window Settings button in the Spark Menu to open the OWSD.
	- *add a sound trigger.

1) Sound Preview:
	First: click "Play Sound"

2) Duplicate sound triggers do not cause crash:
	- *delete the sound trigger you added in the previous step.
	- click the "(click to add)" hyperlink twice to add 2 sound triggers.
	- do not change any fields (they should be the exact same), then click OK.
	- in the orderbook, click the Window Settings button to open the settings dialog again.
	- you should only see 1 sound trigger (the duplicate should be removed).

----Sounds in the Field--------------------------------------
Prepare: open a ladder for a security that has steady market data activity (in the following steps you will be asked to enter trades, get filled, etc.)

3) "Any Order" filled sounds:
	- select "When order filled" and "(any order)," then click apply.
	- enter a 1 lot limit order across the market to trigger an immediate fill.
	- as soon as it is filled, you should hear the sound.
	- it should be the same one you selected
		Note: if you can't recall the sound, open the orderbook window settings dialog and click the "?" button next to the sound-type dropdown to hear a preview.

4) "Any Order" filled sounds don't queue indefinitely:
	First: In the ladder, make sure "Auto Clear" is NOT checked.

	Description:
		You will be testing that a tsunami of fills does not cause sounds to queue behind one another.
		Basically, if 50 fills come in at once, the sound should only play a few times, not repeatedly for 5 minutes.

	- find a price well-across the market to guarentee immediate fills for a rapid succession of 1 lot limit orders
	- rapidly click on the price cell to trigger a littany of fills (up to the tester's discretion as to how many clicks, but 25+ should be sufficient).
	- when you stop clicking, the sounds should not continue playing for more than a few seconds.
	
5) "Security Order" filled sounds:
	A)
		- in the OWSD, click the "(any order)" dropdown and select "choose securities."
		- click the "None" button that appears to add the security you chose for the ladder, then click apply.
		- enter a 1 lot limit order across the market to trigger an immediate fill.
		- you should hear the appropriate sound
	B)
		- in the settings dialog, open the sound's security picker and remove the ladder's security,
		- add a different security
		- enter a 1 lot limit order across the market to trigger an immediate fill.
		- you should NOT hear any sound.
		
6) "Any Order" canceled sounds:
	Description:
		You will be verifying that the order canceled sound trigger works, and that it can coexist with the order filled trigger.
		
	- in the settings dialog, change "choose securities" back to "(any order)" for your "When order is filled" sound.
	- click the "(click to add)" hyperlink to add another sound trigger.
		Note: the new sound trigger will be inserted at the top, of the list (not the bottom).
	- select "When order is canceled" and "(any order)," then click apply.
	- in the ladder, enter a limit order away from the market, so it is NOT liable to get filled.
	- click the order-badge to cancel the order.
	- you should hear the sound you selected for "When order is canceled"; the "When order is filled" sound should not be heard
	- enter a limit order ACROSS the market to trigger an immediate fill.
	- this time, the "When order is filled" sound should play; the "When order is canceled" sound should not be heard.

7) "Any Order" sent sounds:
	Description:
		You will be verifying that the order sent sound trigger works
		
	- in the settings dialog, change "When order is filled" to "When order is sent", then click apply
	- in the ladder, enter a limit order away from the market, so it is NOT liable to get filled.
	- you should hear the sound you selected for "When order is sent"

8) Saved with workspace:
	----Note----------------------------------------------------------------------------------------------------------------------
		- you have completed the sound-functionality testing, don't be alarmed by the 4 sound triggers you are about to add.
	    - this step just requires comparing 2 images of the settings dialog to confirm that they were retained with the workspace.
	------------------------------------------------------------------------------------------------------------------------------
	- *delete all current triggers
	- read the note below, then add the triggers that follow (i-iii)
		Note:
		  - you may replace sounds referred to as 'A' and 'B' with whatever you like; if such free will is too cumbersome, A=Game Sound Correct, B=Powerup)
		  - the steps won't specifically say "check Play Sound," but if the trigger has a sound, check it, otherwise don't.
		i) "When order is filled", "(any order)", Sound 'A'
		ii) "When order is filled", "(choose securities)" pick any 2 securities, Sound 'B'
		iii) "When order is canceled", "(any order)", Sound 'B'
	- close the shell, then restart it with the "Where I left off on" workspace.
	- open the OWSD to verify that the sound triggers were saved with the workspace.

9) Test shell does not crash when no sound card present
	- use a machine that does not have a sound card, such as eh-2 (check with Eric first)
	- update config to turn off sounds

SoundNotifications {
    enabled = false
}
	- restart your shell to pick up your config change
	- Pressing the Preview Sound button should not crash the shell
	- Having a sound notification triggered by the orderbook should not crash the shell


TEST COMPLETE-----------------------------------------------------------------

	
----How-To Reference--------------------------------------------------------------------------------------------------------------
	How to add a trigger?
		- In the OWSD, click the "(click to add)" hyperlink next to the "Sound and Notifications" section header.

	How to delete a trigger?
		- Click the "x" button in the top-left corner of the trigger-item.
----------------------------------------------------------------------------------------------------------------------------------