Skip to content

Commit

Permalink
Feature/MontFerret#250 wait style (MontFerret#257)
Browse files Browse the repository at this point in the history
* Added WAIT_ATTR functions
  • Loading branch information
ziflex authored and Владимир Фетисов committed Apr 10, 2019
1 parent 75fe1bb commit f7ead39
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/drivers/http/document.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,14 @@ func (doc *HTMLDocument) WaitForClassBySelectorAll(_ context.Context, _, _ value
return core.ErrNotSupported
}

func (doc *HTMLDocument) WaitForAttributeBySelector(_ context.Context, _, _ values.String, _ core.Value, _ drivers.WaitEvent) error {
return core.ErrNotSupported
}

func (doc *HTMLDocument) WaitForAttributeBySelectorAll(_ context.Context, _, _ values.String, _ core.Value, _ drivers.WaitEvent) error {
return core.ErrNotSupported
}

func (doc *HTMLDocument) Close() error {
return nil
}
4 changes: 4 additions & 0 deletions pkg/drivers/http/element.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,10 @@ func (el *HTMLElement) WaitForClass(_ context.Context, _ values.String, _ driver
return core.ErrNotSupported
}

func (el *HTMLElement) WaitForAttribute(_ context.Context, _ values.String, _ core.Value, _ drivers.WaitEvent) error {
return core.ErrNotSupported
}

func (el *HTMLElement) ensureStyles(ctx context.Context) error {
if el.styles == nil {
styles, err := el.parseStyles(ctx)
Expand Down
6 changes: 6 additions & 0 deletions pkg/drivers/value.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ type (
WaitForStyle(ctx context.Context, name values.String, value core.Value, when WaitEvent) error

WaitForClass(ctx context.Context, class values.String, when WaitEvent) error

WaitForAttribute(ctx context.Context, name values.String, value core.Value, when WaitEvent) error
}

// The Document interface represents any web page loaded in the browser
Expand Down Expand Up @@ -160,6 +162,10 @@ type (
WaitForClassBySelector(ctx context.Context, selector, class values.String, when WaitEvent) error

WaitForClassBySelectorAll(ctx context.Context, selector, class values.String, when WaitEvent) error

WaitForAttributeBySelector(ctx context.Context, selector, name values.String, value core.Value, when WaitEvent) error

WaitForAttributeBySelectorAll(ctx context.Context, selector, name values.String, value core.Value, when WaitEvent) error
}
)

Expand Down

0 comments on commit f7ead39

Please sign in to comment.