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
| const assert = require("assert");
|
| Feature("Video region snapshots").tag("@regress");
|
| Scenario("Restoring video regions from snapshots", async ({ I, LabelStudio, AtOutliner }) => {
| I.amOnPage("/");
| LabelStudio.init({
| annotations: [
| {
| id: "1001",
| result: [
| {
| value: {
| sequence: [
| {
| frame: 1,
| enabled: true,
| x: 38.266666666666666,
| y: 38.898756660746,
| width: 41.333333333333336,
| height: 22.202486678507995,
| rotation: 0,
| time: 0.041666666666666664,
| },
| ],
| framesCount: 1009,
| },
| id: "tJhYZLMC9G",
| from_name: "box",
| to_name: "video",
| type: "videorectangle",
| origin: "manual",
| },
| ],
| },
| ],
| config: `
| <View>
| <Video name="video" value="$video" />
| <VideoRectangle name="box" toName="video" />
| </View>`,
| data: { video: "/files/opossum_intro.webm" },
| });
|
| I.say("waitForObjectsReady");
| LabelStudio.waitForObjectsReady();
|
| {
| I.say("Check the video annotation creation");
| const result = await LabelStudio.serialize();
|
| assert.notStrictEqual(result[0].value.sequence.length, 0);
| }
|
| {
| I.say("Check restoring the snapshot from history");
| LabelStudio.clearModalIfPresent();
| AtOutliner.seeRegions(1);
| AtOutliner.clickRegion(1);
| I.say("delete region");
| I.pressKey("Backspace");
| I.say("undo action");
| I.click("button[aria-label=Undo]");
| const result = await LabelStudio.serialize();
|
| assert.notStrictEqual(result[0].value.sequence.length, 0);
| }
| });
|
|