【问题标题】:Codeception WebDriver url remove trailing slashCodeception WebDriver url 删除尾部斜杠
【发布时间】:2018-10-19 02:42:38
【问题描述】:

我正在尝试测试 Laravel 5.3 应用程序。为了使用测试配置引导应用程序,我添加了 index-testing.php 入口点。

我的代码接收验收测试配置如下:

class_name: AcceptanceTester
modules:
    enabled:
        - WebDriver:
            url: 'http://nginx/index-testing.php'
            host: 'selenium'
            browser: 'chrome'
        - \Helper\Acceptance_selenium

这是测试场景的一段输出:

Scenario --
 I am on page "/"
  [GET] http://nginx/index-testing.php/
 I click ".apply-button"

所以实际上不是http://nginx/index-testing.php,而是http://nginx/index-testing.php/,这当然会导致404

如何删除这个斜杠?

【问题讨论】:

    标签: webdriver laravel-5.3 integration-testing codeception acceptance-testing


    【解决方案1】:

    我找到了答案!

    在一次测试中,我得到了这样的主页:

    $I->amOnPage('/');
    

    当我改成这个时:

    $I->amOnPage('');
    

    没有更多的尾随斜杠。

    【讨论】:

      猜你喜欢
      • 2017-05-03
      • 1970-01-01
      • 2016-01-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-19
      相关资源
      最近更新 更多