public function closeModalDialog(ScenarioEvent $event) {
		try{
			// Only for failed tests on CMS page
			if (4 === $event->getResult()) {
				$cmsElement = $this->getSession()->getPage()->find('css', '.cms');
				if($cmsElement) {
					try {
						// Navigate away triggered by reloading the page
						$this->getSession()->reload();
						$this->getSession()->getDriver()->getWebDriverSession()->accept_alert();
					} catch(\WebDriver\Exception $e) {
						// no-op, alert might not be present
					}
				}
			}
		}catch(\WebDriver\Exception $e){
			$this->logException($e);
		}
	}