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
import { LabelStudio } from "@humansignal/frontend-test/helpers/LSF/LabelStudio";
import { FF_DEV_3873 } from "../../../../editor/src/utils/feature-flags";
 
export const ToolBar = {
  _controlsSelector: ".lsf-controls",
 
  get sectionOne() {
    return cy.get(".lsf-topbar").find(".lsf-topbar__group").eq(0);
  },
 
  get sectionTwo() {
    return LabelStudio.getFeatureFlag(FF_DEV_3873).then((isFFDEV3873) => {
      if (isFFDEV3873) {
        return cy.get(".lsf-bottombar");
      }
 
      return cy.get(".lsf-topbar");
    });
  },
 
  get controls() {
    return this.sectionTwo.find(this._controlsSelector);
  },
 
  get controlButtons() {
    return this.controls.find("button");
  },
 
  get viewAllBtn() {
    return this.sectionOne.find('[aria-label="Compare all annotations"]');
  },
 
  get submitBtn() {
    return this.sectionTwo.find('[aria-label="Submit current annotation"]');
  },
 
  get updateBtn() {
    return this.sectionTwo.find('[aria-label="Update current annotation"]');
  },
 
  get annotationDropdownTrigger() {
    return this.sectionOne.find(".lsf-annotation-button__trigger");
  },
 
  get dropdownMenu() {
    return cy.get(".lsf-dropdown");
  },
 
  clickCopyAnnotationBtn() {
    return LabelStudio.getFeatureFlag(FF_DEV_3873).then((isFFDEV3873) => {
      if (isFFDEV3873) {
        this.annotationDropdownTrigger.click();
        this.dropdownMenu.find('[class*="option--"]').contains("Duplicate Annotation").click();
        return void 0;
      }
 
      this.sectionOne.find('[aria-label="Copy Annotation"]').click();
    });
  },
};