11import { timeouts } from './constants.json' ;
22
3- import isRecognizingSpeech from './setup/pageObjects/isRecognizingSpeech' ;
43import minNumActivitiesShown from './setup/conditions/minNumActivitiesShown' ;
5- import speechSynthesisPending from './setup/conditions/speechSynthesisPending' ;
4+ import speechRecognitionStartCalled from './setup/conditions/speechRecognitionStartCalled' ;
5+ import speechSynthesisUtterancePended from './setup/conditions/speechSynthesisUtterancePended' ;
66import uiConnected from './setup/conditions/uiConnected' ;
77
88// selenium-webdriver API doc:
@@ -25,11 +25,11 @@ describe('input hint', () => {
2525
2626 await driver . wait ( minNumActivitiesShown ( 2 ) , timeouts . directLine ) ;
2727
28- await driver . wait ( speechSynthesisPending ( ) , timeouts . ui ) ;
28+ await driver . wait ( speechSynthesisUtterancePended ( ) , timeouts . ui ) ;
2929 await pageObjects . startSpeechSynthesize ( ) ;
3030 await pageObjects . endSpeechSynthesize ( ) ;
3131
32- expect ( isRecognizingSpeech ( driver ) ) . resolves . toBeTruthy ( ) ;
32+ await expect ( speechRecognitionStartCalled ( ) . fn ( driver ) ) . resolves . toBeTruthy ( ) ;
3333 } ) ;
3434
3535 test ( 'should not turn on microphone if initiated via typing' , async ( ) => {
@@ -45,7 +45,7 @@ describe('input hint', () => {
4545
4646 await driver . wait ( minNumActivitiesShown ( 2 ) , timeouts . directLine ) ;
4747
48- expect ( isRecognizingSpeech ( driver ) ) . resolves . toBeFalsy ( ) ;
48+ await expect ( speechRecognitionStartCalled ( ) . fn ( driver ) ) . resolves . toBeFalsy ( ) ;
4949 } ) ;
5050 } ) ;
5151
@@ -63,11 +63,11 @@ describe('input hint', () => {
6363
6464 await driver . wait ( minNumActivitiesShown ( 2 ) , timeouts . directLine ) ;
6565
66- await driver . wait ( speechSynthesisPending ( ) , timeouts . ui ) ;
66+ await driver . wait ( speechSynthesisUtterancePended ( ) , timeouts . ui ) ;
6767 await pageObjects . startSpeechSynthesize ( ) ;
6868 await pageObjects . endSpeechSynthesize ( ) ;
6969
70- expect ( isRecognizingSpeech ( driver ) ) . resolves . toBeFalsy ( ) ;
70+ await expect ( speechRecognitionStartCalled ( ) . fn ( driver ) ) . resolves . toBeFalsy ( ) ;
7171 } ) ;
7272
7373 test ( 'should not turn on microphone if initiated via typing' , async ( ) => {
@@ -83,7 +83,7 @@ describe('input hint', () => {
8383
8484 await driver . wait ( minNumActivitiesShown ( 2 ) , timeouts . directLine ) ;
8585
86- expect ( isRecognizingSpeech ( driver ) ) . resolves . toBeFalsy ( ) ;
86+ await expect ( speechRecognitionStartCalled ( ) . fn ( driver ) ) . resolves . toBeFalsy ( ) ;
8787 } ) ;
8888 } ) ;
8989
@@ -101,11 +101,11 @@ describe('input hint', () => {
101101
102102 await driver . wait ( minNumActivitiesShown ( 2 ) , timeouts . directLine ) ;
103103
104- await driver . wait ( speechSynthesisPending ( ) , timeouts . ui ) ;
104+ await driver . wait ( speechSynthesisUtterancePended ( ) , timeouts . ui ) ;
105105 await pageObjects . startSpeechSynthesize ( ) ;
106106 await pageObjects . endSpeechSynthesize ( ) ;
107107
108- expect ( isRecognizingSpeech ( driver ) ) . resolves . toBeFalsy ( ) ;
108+ await expect ( speechRecognitionStartCalled ( ) . fn ( driver ) ) . resolves . toBeFalsy ( ) ;
109109 } ) ;
110110
111111 test ( 'should turn off microphone if initiated via typing' , async ( ) => {
@@ -121,7 +121,7 @@ describe('input hint', () => {
121121
122122 await driver . wait ( minNumActivitiesShown ( 2 ) , timeouts . directLine ) ;
123123
124- expect ( isRecognizingSpeech ( driver ) ) . resolves . toBeFalsy ( ) ;
124+ await expect ( speechRecognitionStartCalled ( ) . fn ( driver ) ) . resolves . toBeFalsy ( ) ;
125125 } ) ;
126126 } ) ;
127127
@@ -139,11 +139,11 @@ describe('input hint', () => {
139139
140140 await driver . wait ( minNumActivitiesShown ( 2 ) , timeouts . directLine ) ;
141141
142- await driver . wait ( speechSynthesisPending ( ) , timeouts . ui ) ;
142+ await driver . wait ( speechSynthesisUtterancePended ( ) , timeouts . ui ) ;
143143 await pageObjects . startSpeechSynthesize ( ) ;
144144 await pageObjects . endSpeechSynthesize ( ) ;
145145
146- expect ( isRecognizingSpeech ( driver ) ) . resolves . toBeFalsy ( ) ;
146+ await expect ( speechRecognitionStartCalled ( ) . fn ( driver ) ) . resolves . toBeFalsy ( ) ;
147147 } ) ;
148148
149149 test ( 'should not turn on microphone if initiated via typing' , async ( ) => {
@@ -159,7 +159,7 @@ describe('input hint', () => {
159159
160160 await driver . wait ( minNumActivitiesShown ( 2 ) , timeouts . directLine ) ;
161161
162- expect ( isRecognizingSpeech ( driver ) ) . resolves . toBeFalsy ( ) ;
162+ await expect ( speechRecognitionStartCalled ( ) . fn ( driver ) ) . resolves . toBeFalsy ( ) ;
163163 } ) ;
164164 } ) ;
165165} ) ;
0 commit comments