public function addCookie($cookie)
    {
        if (is_array($cookie)) {
            $cookie = Cookie::createFromArray($cookie);
        }
        if (!$cookie instanceof Cookie) {
            throw new InvalidArgumentException('Cookie must be set from instance of Cookie class or from array.');
        }

        $this->executor->execute(
            DriverCommand::ADD_COOKIE,
            ['cookie' => $cookie->toArray()]
        );

        return $this;
    }