【问题标题】:How can I write a Behat step that will capture a screenshot from the Goutte driver?如何编写一个 Behat 步骤来捕获 Goutte 驱动程序的屏幕截图?
【发布时间】:2014-05-03 10:41:14
【问题描述】:

我需要将 HTML 保存在某个文件中,以便可以在浏览器中打开。

【问题讨论】:

    标签: php screenshot behat goutte


    【解决方案1】:
    /**
     * @Then /^show me the page$/
     */
    public function show_me_the_page() {
    
        $html = $this->getSession()->getDriver()->getContent();
        file_put_contents('/tmp/behat_page.html', $html);
    }
    

    【讨论】:

      猜你喜欢
      • 2014-05-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-28
      相关资源
      最近更新 更多