From df4f0d9a235a4b7ff6dbe970e28f1a418fb59c8a Mon Sep 17 00:00:00 2001 From: Arun Madhavan Date: Wed, 7 Feb 2024 16:24:16 -0500 Subject: [PATCH 1/3] Modify the voice tests to use config.py provided voice system. --- voice_audio.py | 21 +++++++++++---------- voice_text.py | 19 ++++++++++--------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/voice_audio.py b/voice_audio.py index c733166..f2bd49d 100644 --- a/voice_audio.py +++ b/voice_audio.py @@ -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"), -] \ No newline at end of file + ("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"), +] diff --git a/voice_text.py b/voice_text.py index 63d0fc1..5c5479f 100644 --- a/voice_text.py +++ b/voice_text.py @@ -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"), ] \ No newline at end of file From 6a08fd339e0d97bc17d2c4fff9bb5b1b1b46a579 Mon Sep 17 00:00:00 2001 From: Arun Madhavan Date: Mon, 12 Feb 2024 13:19:34 -0500 Subject: [PATCH 2/3] Updated the conformance test to use global config.py provided voiceSystem instead of using hardcoded one. --- config.py | 2 +- conformance.py | 4 ++-- setup.env | 9 +++++++++ 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100755 setup.env diff --git a/config.py b/config.py index b838bbf..22d814c 100644 --- a/config.py +++ b/config.py @@ -6,4 +6,4 @@ ) # Please set the voice asssitant you want to set here. -va = 'AmazonAlexa' \ No newline at end of file +va = 'AAlexa' diff --git a/conformance.py b/conformance.py index c6ea8bf..b6e8895 100644 --- a/conformance.py +++ b/conformance.py @@ -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"), -] \ No newline at end of file +] diff --git a/setup.env b/setup.env new file mode 100755 index 0000000..fe66efa --- /dev/null +++ b/setup.env @@ -0,0 +1,9 @@ +export DeviceID=02AD32014B15 +export DeviceIP=10.0.0.222 + +alias dabListTests='python3 main.py -v -b $DeviceIP -I $DeviceID -l' +alias dabSingleTest='python3 main.py -v -b $DeviceIP -I $DeviceID -c' +alias dabYoutubeTest='python3 main.py -v -b $DeviceIP -I $DeviceID -s "end_to_end_cobalt"' +alias dabConformance='python3 main.py -v -b $DeviceIP -I $DeviceID -s "conformance"' +alias dabVoiceAudio='python3 main.py -v -b $DeviceIP -I $DeviceID -s "voice_audio"' +alias dabVoiceText='python3 main.py -v -b $DeviceIP -I $DeviceID -s "voice_text"' From 6b32d801591ae6e420e5b915c317d5a0418893f7 Mon Sep 17 00:00:00 2001 From: Arun Madhavan Date: Mon, 12 Feb 2024 13:20:39 -0500 Subject: [PATCH 3/3] Clean the local modifications --- config.py | 2 +- setup.env | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) delete mode 100755 setup.env diff --git a/config.py b/config.py index 22d814c..904eacf 100644 --- a/config.py +++ b/config.py @@ -6,4 +6,4 @@ ) # Please set the voice asssitant you want to set here. -va = 'AAlexa' +va = 'AmazonAlexa' diff --git a/setup.env b/setup.env deleted file mode 100755 index fe66efa..0000000 --- a/setup.env +++ /dev/null @@ -1,9 +0,0 @@ -export DeviceID=02AD32014B15 -export DeviceIP=10.0.0.222 - -alias dabListTests='python3 main.py -v -b $DeviceIP -I $DeviceID -l' -alias dabSingleTest='python3 main.py -v -b $DeviceIP -I $DeviceID -c' -alias dabYoutubeTest='python3 main.py -v -b $DeviceIP -I $DeviceID -s "end_to_end_cobalt"' -alias dabConformance='python3 main.py -v -b $DeviceIP -I $DeviceID -s "conformance"' -alias dabVoiceAudio='python3 main.py -v -b $DeviceIP -I $DeviceID -s "voice_audio"' -alias dabVoiceText='python3 main.py -v -b $DeviceIP -I $DeviceID -s "voice_text"'