protected function ensureTreeNodeIsOpen(string $nodeText, RemoteWebElement $context)
    {
        $I = $this->tester;
        $I->see($nodeText, self::$treeItemSelector);

        /** @var RemoteWebElement $context */
        $context = $I->executeInSelenium(function () use ($nodeText, $context
        ) {
            return $context->findElement(\WebDriverBy::xpath('//*[text()=\'' . $nodeText . '\']/..'));
        });

        try {
            $context->findElement(\WebDriverBy::cssSelector('.chevron.collapsed'))->click();
        } catch (\Facebook\WebDriver\Exception\NoSuchElementException $e) {
            // element not found so it may be already opened...
        } catch (\Facebook\WebDriver\Exception\ElementNotVisibleException $e) {
            // element not found so it may be already opened...
        }

        return $context;
    }