Rename SetVisible to SetHidden for clearer semantic meaning
The method and its implementation now align with setting an element's "hidden" property instead of "visible." This change improves code clarity and consistency with expected behavior.
This commit is contained in:
parent
62cb6958fa
commit
0f9f6c776d
6
node.go
6
node.go
@ -21,7 +21,7 @@ type Node interface {
|
|||||||
|
|
||||||
ForEach(selector string, fn func(Node) error) error
|
ForEach(selector string, fn func(Node) error) error
|
||||||
|
|
||||||
SetVisible(val bool) error
|
SetHidden(val bool) error
|
||||||
SetAttribute(name, value string) error
|
SetAttribute(name, value string) error
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,8 +86,8 @@ func (n node) ForEach(selector string, fn func(Node) error) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (n node) SetVisible(val bool) error {
|
func (n node) SetHidden(val bool) error {
|
||||||
_, err := n.locator.Evaluate(fmt.Sprintf(`(element) => element.visible = %t;`, val), nil)
|
_, err := n.locator.Evaluate(fmt.Sprintf(`(element) => element.hidden = %t;`, val), nil)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user