@@ -22,6 +22,25 @@ const config = `
22
22
</View>
23
23
` ;
24
24
25
+ const configSpeech = `
26
+ <View>
27
+ <AudioPlus name="audio" value="$url"></AudioPlus>
28
+ <Labels name="label" toName="audio">
29
+ <Label value="Speech"/>
30
+ <Label value="Noise" background="grey"/>
31
+ </Labels>
32
+ <TextArea name="transcription" toName="audio"
33
+ perRegion="true" whenTagName="label" whenLabelValue="Speech"
34
+ displayMode="region-list"/>
35
+ <Choices name="sentiment" toName="audio" showInline="true"
36
+ perRegion="true" whenTagName="label" whenLabelValue="Speech">
37
+ <Choice value="Positive" html="<span style='font-size: 45px; vertical-align: middle;'> 😀 </span>"/>
38
+ <Choice value="Neutral" html="<span style='font-size: 45px; vertical-align: middle;'> 😐 </span>"/>
39
+ <Choice value="Negative" html="<span style='font-size: 45px; vertical-align: middle;'> 🙁 </span>"/>
40
+ </Choices>
41
+ </View>
42
+ ` ;
43
+
25
44
const data = {
26
45
url : 'https://htx-misc.s3.amazonaws.com/opensource/label-studio/examples/audio/barradeen-emotional.mp3' ,
27
46
} ;
@@ -54,6 +73,7 @@ const annotations = [
54
73
] ;
55
74
56
75
const params = { annotations : [ { id : 'test' , result : annotations } ] , config, data } ;
76
+ const paramsSpeech = { annotations : [ { id : 'test' , result : [ ] } ] , config : configSpeech , data } ;
57
77
58
78
Scenario ( 'Check if regions are selected' , async function ( { I, LabelStudio, AtAudioView, AtSidebar } ) {
59
79
LabelStudio . setFeatureFlags ( {
@@ -88,6 +108,47 @@ Scenario('Check if regions are selected', async function({ I, LabelStudio, AtAud
88
108
AtSidebar . dontSeeSelectedRegion ( ) ;
89
109
} ) ;
90
110
111
+ Scenario ( 'Check if there are ghost regions' , async function ( { I, LabelStudio, AtAudioView, AtSidebar } ) {
112
+ LabelStudio . setFeatureFlags ( {
113
+ ff_front_dev_2715_audio_3_280722_short : true ,
114
+ } ) ;
115
+ I . amOnPage ( '/' ) ;
116
+
117
+ LabelStudio . init ( paramsSpeech ) ;
118
+
119
+ await AtAudioView . waitForAudio ( ) ;
120
+
121
+ I . waitForDetached ( 'loading-progress-bar' , 10 ) ;
122
+
123
+ await AtAudioView . lookForStage ( ) ;
124
+
125
+ for ( let i = 0 ; i < 20 ; i ++ ) {
126
+ // creating a new region
127
+ I . pressKey ( '1' ) ;
128
+ AtAudioView . dragAudioRegion ( ( 40 * i ) + 10 , 30 ) ;
129
+ AtAudioView . clickAt ( ( 40 * i ) + 20 ) ;
130
+ I . pressKey ( '2' ) ;
131
+ I . pressKey ( '1' ) ;
132
+ I . pressKey ( 'u' ) ;
133
+ }
134
+
135
+ AtSidebar . seeRegions ( 20 ) ;
136
+
137
+ for ( let i = 0 ; i < 20 ; i ++ ) {
138
+ // creating a new region
139
+ AtAudioView . clickAt ( ( 40 * i ) + 20 ) ;
140
+ AtSidebar . seeSelectedRegion ( ) ;
141
+ AtAudioView . dontSeeGhostRegion ( ) ;
142
+ I . pressKey ( 'u' ) ;
143
+ }
144
+
145
+ AtSidebar . seeRegions ( 20 ) ;
146
+
147
+ I . pressKey ( 'u' ) ;
148
+
149
+ AtSidebar . dontSeeSelectedRegion ( ) ;
150
+ } ) ;
151
+
91
152
Scenario ( 'Delete region by pressing delete hotkey' , async function ( { I, LabelStudio, AtAudioView, AtSidebar } ) {
92
153
LabelStudio . setFeatureFlags ( {
93
154
ff_front_dev_2715_audio_3_280722_short : true ,
0 commit comments