Пример #1
0
 public function testScreenshot()
 {
     $this->module->amOnPage('/');
     @unlink(\Codeception\Configuration::outputDir() . 'testshot.png');
     $testName = "debugTest";
     $this->module->makeScreenshot($testName);
     $this->assertFileExists(\Codeception\Configuration::outputDir() . 'debug/' . $testName . '.png');
     @unlink(\Codeception\Configuration::outputDir() . 'debug/' . $testName . '.png');
     $this->module->_saveScreenshot(\Codeception\Configuration::outputDir() . 'testshot.png');
     $this->assertFileExists(\Codeception\Configuration::outputDir() . 'testshot.png');
     @unlink(\Codeception\Configuration::outputDir() . 'testshot.png');
 }
Пример #2
0
 public function testBug2046()
 {
     $this->module->webDriver = null;
     $this->module->_saveScreenshot(\Codeception\Configuration::outputDir() . 'testshot.png');
 }
Пример #3
0
 public function afterStep(StepEvent $e)
 {
     if (!$this->webDriverModule or !$this->dir) {
         return;
     }
     if ($e->getStep() instanceof CommentStep) {
         return;
     }
     $step = $e->getStep();
     if ($step->getAction() == "makeScreenshot") {
         $filename = str_pad($this->stepNum, 3, "0", STR_PAD_LEFT) . '.png';
         //echo "aa".$this->stepNum;
         //echo "bb".$filename;
         //echo "CC".$this->dir;
         //die();
         $this->webDriverModule->_saveScreenshot($this->dir . DIRECTORY_SEPARATOR . $filename);
         $this->stepNum++;
         $this->slides[$filename] = $e->getStep();
     }
 }
Пример #4
0
 public function afterStep(StepEvent $e)
 {
     if (!$this->webDriverModule or !$this->dir) {
         return;
     }
     if ($e->getStep() instanceof CommentStep) {
         return;
     }
     $filename = str_pad($this->stepNum, 3, "0", STR_PAD_LEFT) . '.png';
     $this->webDriverModule->_saveScreenshot($this->dir . DIRECTORY_SEPARATOR . $filename);
     $this->stepNum++;
     $this->slides[$filename] = $e->getStep();
 }