driver, new ElementResolver($this->driver, $this->resolver->format($selector)) ); $browser->parent = $this; if ($this->page) { $browser->onWithoutAssert($this->page); } if ($selector instanceof Component) { $browser->onComponent($selector, $this->resolver); } call_user_func($callback, $browser); return $this; } public function __call($method, $parameters) { $parentComponent = $this->parent ? $this->parent->component : null; if ($parentComponent && method_exists($parentComponent, $method)) { array_unshift($parameters, $this); $parentComponent->{$method}(...$parameters); return $this; } return parent::__call($method, $parameters); } }