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
class TextareaHelper {
  private get _baseRootSelector() {
    return ".lsf-text-area";
  }
 
  private _rootSelector: string;
 
  constructor(rootSelector) {
    this._rootSelector = rootSelector.replace(/^\&/, this._baseRootSelector);
  }
 
  get root() {
    return cy.get(this._rootSelector);
  }
 
  get input() {
    return this.root.find('[aria-label="TextArea Input"]');
  }
 
  get rows() {
    return this.root.find(".lsf-row");
  }
 
  row(idx: number) {
    return this.rows.eq(idx - 1);
  }
 
  type(text: string) {
    return this.input.type(text);
  }
 
  clickRowEdit(idx: number) {
    this.row(idx).find('[aria-label="Edit Region"]').click();
  }
 
  rowInput(idx: number) {
    return this.row(idx).find(".ant-input, input, textarea");
  }
 
  rowType(idx: number, text: string) {
    return this.rowInput(idx).type(text);
  }
 
  hasValue(text: string) {
    this.rows.contains(text);
  }
 
  hasNoValue(text: string) {
    this.rows.contains(text).should("not.exist");
  }
}
 
const Textarea = new TextareaHelper("&:eq(0)");
const useTextarea = (rootSelector: string) => {
  return new TextareaHelper(rootSelector);
};
 
export { Textarea, useTextarea };