Skip to content

Commit

Permalink
Merge pull request #43 from arun-madhavan-013/main
Browse files Browse the repository at this point in the history
Modify the voice tests to use config.py provided voice system.
  • Loading branch information
bgy36ww authored Feb 20, 2024
2 parents 3b8119a + 6b32d80 commit 7702f9c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
)

# Please set the voice asssitant you want to set here.
va = 'AmazonAlexa'
va = 'AmazonAlexa'
4 changes: 2 additions & 2 deletions conformance.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
("voice/list",'{}', dab.voice.list, 200, "Conformance"),
("voice/set",f'{{"voiceSystem":{{"name":"{config.va}","enabled":true}}}}', dab.voice.set, 5000, "Conformance"),
("voice/send-audio",'{"fileLocation": "https://storage.googleapis.com/ytlr-cert.appspot.com/voice/ladygaga.wav"}',dab.voice.send_audio, 10000, "Conformance"),
("voice/send-text",'{"requestText" : "Play lady Gaga music on YouTube", "voiceSystem": "Alexa"}', dab.voice.send_text, 10000, "Conformance"),
("voice/send-text",f'{{"requestText" : "Play lady Gaga music on YouTube", "voiceSystem" : "{config.va}"}}', dab.voice.send_text, 10000, "Conformance"),
("version",' {}', dab.version.default, 200, "Conformance"),
("system/restart",' {}', dab.system.restart, 30000, "Conformance"),
]
]
21 changes: 11 additions & 10 deletions voice_audio.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import dab.applications
import dab.system
import dab.voice
import config

# Voice action steps
SEND_VOICE_AUDIO_TEST_CASES = [
("voice/send-audio",'{"fileLocation": "https://storage.googleapis.com/ytlr-cert.appspot.com/voice/ladygaga.wav", "voiceSystem": "Alexa"}', dab.voice.send_audio, "Are you on search page with Lady Gaga?", "Voice launch Lady gaga"),
("voice/send-audio",'{"fileLocation": "https://storage.googleapis.com/ytlr-cert.appspot.com/voice/pressenter.wav", "voiceSystem": "Alexa"}', dab.voice.send_audio, "Is video playing?", "Voice play video"),
("voice/send-audio",'{"fileLocation": "https://storage.googleapis.com/ytlr-cert.appspot.com/voice/playvideo.wav", "voiceSystem": "Alexa"}', dab.voice.send_audio, "If video was not playing, is it playing now?", "Voice resume video"),
("voice/send-audio",'{"fileLocation": "https://storage.googleapis.com/ytlr-cert.appspot.com/voice/setvolume0.wav", "voiceSystem": "Alexa"}', dab.voice.send_audio, "Did volume of the video changed?", "voice mute"),
("voice/send-audio",'{"fileLocation": "https://storage.googleapis.com/ytlr-cert.appspot.com/voice/setvolume5.wav", "voiceSystem": "Alexa"}', dab.voice.send_audio, "Did volume of the video changed?", "voice volume up"),
("voice/send-audio",'{"fileLocation": "https://storage.googleapis.com/ytlr-cert.appspot.com/voice/pausevideo.wav", "voiceSystem": "Alexa"}', dab.voice.send_audio, "Did video paused?", "voice pause"),
("voice/send-audio",'{"fileLocation": "https://storage.googleapis.com/ytlr-cert.appspot.com/voice/fastforwardvideo.wav", "voiceSystem": "Alexa"}', dab.voice.send_audio, "Did video playback fast forward?", "voice fastforward"),
("voice/send-audio",'{"fileLocation": "https://storage.googleapis.com/ytlr-cert.appspot.com/voice/rewindvideo.wav", "voiceSystem": "Alexa"}', dab.voice.send_audio, "Did video playback rewind?", "voice rewind"),
("voice/send-audio",'{"fileLocation": "https://storage.googleapis.com/ytlr-cert.appspot.com/voice/exittomainmenu.wav", "voiceSystem": "Alexa"}', dab.voice.send_audio, "Are you on main menu?", "voice exit"),
]
("voice/send-audio",f'{{"fileLocation": "https://storage.googleapis.com/ytlr-cert.appspot.com/voice/ladygaga.wav", "voiceSystem": "{config.va}"}}', dab.voice.send_audio, "Are you on search page with Lady Gaga?", "Voice launch Lady gaga"),
("voice/send-audio",f'{{"fileLocation": "https://storage.googleapis.com/ytlr-cert.appspot.com/voice/pressenter.wav", "voiceSystem": "{config.va}"}}', dab.voice.send_audio, "Is video playing?", "Voice play video"),
("voice/send-audio",f'{{"fileLocation": "https://storage.googleapis.com/ytlr-cert.appspot.com/voice/playvideo.wav", "voiceSystem": "{config.va}"}}', dab.voice.send_audio, "If video was not playing, is it playing now?", "Voice resume video"),
("voice/send-audio",f'{{"fileLocation": "https://storage.googleapis.com/ytlr-cert.appspot.com/voice/setvolume0.wav", "voiceSystem": "{config.va}"}}', dab.voice.send_audio, "Did volume of the video changed?", "voice mute"),
("voice/send-audio",f'{{"fileLocation": "https://storage.googleapis.com/ytlr-cert.appspot.com/voice/setvolume5.wav", "voiceSystem": "{config.va}"}}', dab.voice.send_audio, "Did volume of the video changed?", "voice volume up"),
("voice/send-audio",f'{{"fileLocation": "https://storage.googleapis.com/ytlr-cert.appspot.com/voice/pausevideo.wav", "voiceSystem": "{config.va}"}}', dab.voice.send_audio, "Did video paused?", "voice pause"),
("voice/send-audio",f'{{"fileLocation": "https://storage.googleapis.com/ytlr-cert.appspot.com/voice/fastforwardvideo.wav", "voiceSystem": "{config.va}"}}', dab.voice.send_audio, "Did video playback fast forward?", "voice fastforward"),
("voice/send-audio",f'{{"fileLocation": "https://storage.googleapis.com/ytlr-cert.appspot.com/voice/rewindvideo.wav", "voiceSystem": "{config.va}"}}', dab.voice.send_audio, "Did video playback rewind?", "voice rewind"),
("voice/send-audio",f'{{"fileLocation": "https://storage.googleapis.com/ytlr-cert.appspot.com/voice/exittomainmenu.wav", "voiceSystem": "{config.va}"}}', dab.voice.send_audio, "Are you on main menu?", "voice exit"),
]
19 changes: 10 additions & 9 deletions voice_text.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import dab.applications
import dab.system
import dab.voice
import config

# Voice action steps
SEND_VOICE_TEXT_TEST_CASES = [
("voice/send-text",'{"requestText" : "Play lady Gaga music on YouTube", "voiceSystem": "Alexa"}', dab.voice.send_text, "Are you on search page with Lady Gaga?", "Voice launch Lady gaga"),
("voice/send-text",'{"requestText" : "Press enter", "voiceSystem": "Alexa"}', dab.voice.send_text, "Is video playing?", "Voice play video"),
("voice/send-text",'{"requestText" : "Play video", "voiceSystem": "Alexa"}', dab.voice.send_text, "If video was not playing, is it playing now?", "Voice resume video"),
("voice/send-text",'{"requestText" : "Set volume 0", "voiceSystem": "Alexa"}', dab.voice.send_text, "Did volume of the video changed?", "voice mute"),
("voice/send-text",'{"requestText" : "Set volume 5", "voiceSystem": "Alexa"}', dab.voice.send_text, "Did volume of the video changed?", "voice volume up"),
("voice/send-text",'{"requestText" : "Pause Video", "voiceSystem": "Alexa"}', dab.voice.send_text, "Did video paused?", "voice pause"),
("voice/send-text",'{"requestText" : "Fast forward video", "voiceSystem": "Alexa"}', dab.voice.send_text, "Did video playback fast forward?", "voice fastforward"),
("voice/send-text",'{"requestText" : "Rewind video", "voiceSystem": "Alexa"}', dab.voice.send_text, "Did video playback rewind?", "voice rewind"),
("voice/send-text",'{"requestText" : "Exit to main menu", "voiceSystem": "Alexa"}', dab.voice.send_text, "Are you on main menu?", "voice exit"),
("voice/send-text", f'{{"requestText" : "Play lady Gaga music on YouTube", "voiceSystem" : "{config.va}"}}', dab.voice.send_text, "Are you on search page with Lady Gaga?", "Voice launch Lady gaga"),
("voice/send-text", f'{{"requestText" : "Press enter", "voiceSystem" : "{config.va}"}}', dab.voice.send_text, "Is video playing?", "Voice play video"),
("voice/send-text", f'{{"requestText" : "Play video", "voiceSystem" : "{config.va}"}}', dab.voice.send_text, "If video was not playing, is it playing now?", "Voice resume video"),
("voice/send-text", f'{{"requestText" : "Set volume 0", "voiceSystem" : "{config.va}"}}', dab.voice.send_text, "Did volume of the video changed?", "voice mute"),
("voice/send-text", f'{{"requestText" : "Set volume 5", "voiceSystem" : "{config.va}"}}', dab.voice.send_text, "Did volume of the video changed?", "voice volume up"),
("voice/send-text", f'{{"requestText" : "Pause Video", "voiceSystem" : "{config.va}"}}', dab.voice.send_text, "Did video paused?", "voice pause"),
("voice/send-text", f'{{"requestText" : "Fast forward video", "voiceSystem" : "{config.va}"}}', dab.voice.send_text, "Did video playback fast forward?", "voice fastforward"),
("voice/send-text", f'{{"requestText" : "Rewind video", "voiceSystem" : "{config.va}"}}', dab.voice.send_text, "Did video playback rewind?", "voice rewind"),
("voice/send-text", f'{{"requestText" : "Exit to main menu", "voiceSystem" : "{config.va}"}}', dab.voice.send_text, "Are you on main menu?", "voice exit"),
]

0 comments on commit 7702f9c

Please sign in to comment.