public function startWebserver(BeforeSuiteTested $suiteEvent)
 {
     $suite = $suiteEvent->getSuite();
     if ($this->suiteIdentifier->suiteNeedsWebserver($suite) && !$this->isStarted) {
         $this->webserverController->startServer();
         $this->isStarted = true;
     }
 }
 /**
  * @param BeforeSuiteTested $event
  */
 public function onBeforeSuiteTested(BeforeSuiteTested $event)
 {
     $this->currentSuite = new Suite();
     $this->currentSuite->setName($event->getSuite()->getName());
     $print = $this->renderer->renderBeforeSuite($this);
     $this->printer->writeln($print);
 }
 /**
  * @param TestworkEvent\BeforeSuiteTested $event
  */
 public function onBeforeSuiteTested(TestworkEvent\BeforeSuiteTested $event)
 {
     $this->currentSuite = new Node\Suite();
     $this->currentSuite->setName($event->getSuite()->getName());
 }
 /**
  * @param BeforeSuiteTested $event
  */
 public function onBeforeSuiteTested(BeforeSuiteTested $event)
 {
     $this->currentSuite = new Suite();
     $this->currentSuite->setName($event->getSuite()->getName());
     $this->getCurrentFeature();
     $print = $this->renderer->renderBeforeSuite($this);
     /*Old logic, commet as tag for current suite noy used in index file*/
     /*        $this->printer->writeln($print);*/
 }
Exemple #5
0
 public function setUpTestRun(BeforeSuiteTested $event)
 {
     print "Rails logger initialised to use new suite id\n";
     $this->initRails();
     $suite_id = TestRailApiWrapper::create_new_testsuite(" " . $this->testrun_basename);
     $gerkin = new Gherkin();
     $base_path = $event->getSuite()->getSetting("paths")["features"];
     $gerkin->setBasePath($base_path);
     $i18nPath = dirname(dirname(dirname(dirname(dirname(__DIR__))))) . DIRECTORY_SEPARATOR . 'behat' . DIRECTORY_SEPARATOR . 'gherkin' . DIRECTORY_SEPARATOR . 'i18n.php';
     $gerkin->addLoader(new GherkinFileLoader(new Parser(new Lexer(new CachedArrayKeywords($i18nPath)))));
     $list = (new FilesystemFeatureLocator($gerkin, $base_path))->locateSpecifications($event->getSuite(), $base_path);
     $list->rewind();
     while ($list->valid()) {
         $suite_section = TestRailApiWrapper::create_new_section($list->current()->getTitle());
         // read scenarious from feaure
         foreach ($list->current()->getScenarios() as $scenario) {
             $test_case_id = TestRailApiWrapper::create_new_testcase($scenario->getTitle(), $suite_section);
             $this->testcases[$test_case_id] = $scenario->getTitle();
         }
         $list->next();
     }
     TestRailApiWrapper::create_new_testrun();
 }
 /**
  * @throws \InvalidArgumentException
  *
  * @param BeforeSuiteTestedEvent $event
  * @param string                 $eventName
  * @param EventDispatcher        $eventDispatcher
  */
 public function beNotifiedOfSuiteStartingEvent(BeforeSuiteTestedEvent $event, $eventName, EventDispatcher $eventDispatcher)
 {
     $suiteName = $event->getSuite()->getName();
     $this->phpUnitCodeCoverageTool->startRecordingCodeUsageWithTestName($suiteName);
 }