编码接收,配置套件测试路径 [英] Codeception, configure suite test path

查看:54
本文介绍了编码接收,配置套件测试路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用Codeception时遇到问题。

I'm having a problem with Codeception.

我有一个涉及团队的项目,我想用Codeception实施测试,并且该测试应该对每个人都有效在我的团队中。

I have a project that involving team, and I want to implement test with codeception and this test should work for everyone in my team.

当前,我出于个人目的设置测试,下面是它的示例配置:

currently I setup the test for my own-purpose, and here is the example configuration of it:

class_name: FunctionalTester
modules:
    enabled:
        # add framework module here
        - Yii1
        - \Helper\Functional
        - PhpBrowser
        - Db
    config:
        Yii1:
            appPath: '/Volumes/disk0s4/www/new-proj/trunk/test.php'
            url: 'https://my.proj.local/test.php'
        PhpBrowser:
            url: 'https://my.proj.didin/'
        Db:
            dsn: 'mysql:host=127.0.0.1;dbname=test-proj-new'
            user: 'root'
            password: 'root'
            dump: ''

根据上面的套件配置,在config> Yii1> appPath下:路径是固定的,并且运行良好仅适用于我,但不幸的是,此配置对我团队中的其他人不起作用。因此,其他人应该为此拥有自我配置文件,但要继续运行相同的测试文件。

According to suite-configuration above, under config > Yii1 > appPath: the path is fixed, and it working well only for me, but unfortunately this configuration won't work for other people in my team. So other people should have self-configuration file for this, but keep to run the same test-file.

因此,您有任何想法来处理此类问题吗?情况?
我真的很感谢您的所有投入,并非常感谢您的关注。

So, do you have any idea to handle the kind of this situation? I really appreciate all of your input and thanks a lot for attention.

推荐答案

感谢@Rob forrest,所以我把它作为答案。

Thanks for @Rob forrest, so I put it as the answer here.

当前,我找到了解决此问题的方法,
我看到了-env 选项可用于此,这里是配置:

Currently I found a solution to get this situation, I see --env option can be used to this, and here is the configuration:

class_name: FunctionalTester
modules:
    enabled:
        # add framework module here
        - Yii1
        - \Helper\Functional
        - PhpBrowser
        - Db
    config:
        Yii1:
            appPath: '/Volumes/disk0s4/www/new-proj/trunk/test.php'
            url: 'https://my.proj.local/test.php'
        PhpBrowser:
            url: 'https://my.proj.didin/'
        Db:
            dsn: 'mysql:host=127.0.0.1;dbname=test-proj-new'
            user: 'root'
            password: 'root'
env:
    my_env:
       modules:
            enabled:
                - Yii1
                - \Helper\Functional
            config:
                Yii1:
                     appPath: 'path to index.php of my environment'
                     url: 'http://my.local/test.php'
    production_env:
       modules:
            enabled:
                - Yii1
                - \Helper\Functional
            config:
                Yii1:
                     appPath: 'path to index.php of production environment'
                     url: 'http://my.local.com/test.php'

最后,要运行测试,只需添加--env选项,如下所示:
codecept运行功能--env my_env
codecept运行功能--env production_env

finally, to run the test, just add --env option as follows: codecept run functional --env my_env or codecept run functional --env production_env

至少这是我目前唯一实现的方法,但是我仍然打开所有人的任何输入。

at least this is the only way that I implemented for now, but I still open any input from all of you.

谢谢

这篇关于编码接收,配置套件测试路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆