1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-07-05 00:49:00 +02:00

Feature/new selector type (#657)

* Added remote type reference resolver

* Added support of XPath query selector

* Added CDP e2e testss covering XPath integration

* Added additional CDP e2e tests covering XPath integration

* Added type check to QuerySelector casting function

* Fixed XPath e2e tests

* Fixed vuln issue

* Added support of XPath selectors to http driver

* Added e2e tests for XPAth
This commit is contained in:
Tim Voronov
2021-09-16 21:40:20 -04:00
committed by GitHub
parent a000302259
commit 90427cd537
167 changed files with 2275 additions and 1102 deletions

View File

@ -36,19 +36,18 @@ func SetInnerText(ctx context.Context, args ...core.Value) (core.Value, error) {
return values.None, el.SetInnerText(ctx, values.ToString(args[1]))
}
err = core.ValidateType(args[1], types.String)
if err != nil {
return values.None, err
}
err = core.ValidateType(args[2], types.String)
if err != nil {
return values.None, err
}
selector := values.ToString(args[1])
selector, err := drivers.ToQuerySelector(args[1])
if err != nil {
return values.None, err
}
innerHTML := values.ToString(args[2])
return values.None, el.SetInnerTextBySelector(ctx, selector, innerHTML)