Bin
2025-12-16 9e0b2ba2c317b1a86212f24cbae3195ad1f3dbfa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Feature("Hotkeys").tag("@regress");
 
const AUDIO_URL = "/public/files/barradeen-emotional.mp3";
 
Scenario("Hotkeys on re-initing lsf", async ({ I, LabelStudio, AtAudioView, AtOutliner }) => {
  const params = {
    annotations: [{ id: "test", result: [] }],
    config: `<View>
  <Labels name="label" toName="audio" zoom="true" hotkey="ctrl+enter">
    <Label value="Speaker one" background="#00FF00"/>
    <Label value="Speaker two" background="#12ad59"/>
  </Labels>
  <Audio name="audio" value="$audio" />
</View>`,
    data: {
      audio: AUDIO_URL,
    },
  };
 
  LabelStudio.setFeatureFlags({
    ff_front_dev_2715_audio_3_280722_short: true,
  });
  I.amOnPage("/");
 
  I.say("Init LabelStudio");
 
  LabelStudio.init(params);
  await AtAudioView.waitForAudio();
 
  I.say("Re-init LabelStudio");
 
  LabelStudio.init(params);
  await AtAudioView.waitForAudio();
 
  AtOutliner.seeRegions(0);
 
  I.say("Draw region");
 
  await AtAudioView.lookForStage();
  I.pressKey("1");
  AtAudioView.dragAudioElement(50, 300);
  I.pressKey("u");
  AtOutliner.seeRegions(1);
 
  I.say("Try to delete it by backspace hotkey");
  AtAudioView.clickAt(150);
  I.pressKey("Backspace");
  AtOutliner.seeRegions(0);
 
  I.say("Reset selected labels");
  I.pressKey("u");
 
  I.say("Draw a couple of regions");
 
  for (let k = 0; k < 5; k++) {
    I.pressKey("2");
    AtAudioView.dragAudioElement(50 + 50 * k, 30);
    I.pressKey("u");
  }
  AtOutliner.seeRegions(5);
 
  I.say("Try to delete all regions by ctrl+backspace hotkey");
 
  I.pressKey(["CommandOrControl", "Backspace"]);
  I.acceptPopup();
 
  AtOutliner.seeRegions(0);
});