public function afterStep(Scope\StepScope $scope)
    {
        // If "mainWindow" variable is not empty that means that additional window has been opened.
        // Then, if number of opened windows equals to one, we need to switch back to original window,
        // otherwise an error will occur: "Window not found. The browser window may have been closed".
        // This happens due to auto closing window by JavaScript (CKFinder does this after choosing a file).
        if (!empty($this->mainWindow) && count($this->getWindowNames()) == 1) {
            $this->iSwitchToWindow();
        }

        if (self::hasTag('javascript') && self::isStepImpliesJsEvent($scope)) {
            $this->waitAjaxAndAnimations();
        }
    }