Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E2Eテストと共にあらんことを #3048

Merged

Conversation

kiy0taka
Copy link
Contributor

@kiy0taka kiy0taka commented Apr 12, 2018

概要(Overview・Refs Issue)

  • EC-CUBE/eccube-codeception に分かれていたE2Eテストを本体リポジトリに取り込み
  • Travis上でもPHPUnitのテストと合わせてCodeceptionのテストを行う

方針(Policy)

  • PRを受けたときは1環境(PostgreSQL/Chrome)でのE2Eテストが通れば受け入れ基準を満たすものとする
  • 他の環境の組み合わせはこれまで通りEC-CUBE/eccube-codeception のリポジトリを使って行う

テスト(Test)

ローカルでのテスト方法

ローカルに必要なもの

設定

codeception/_envs/travis.ymlを元にcodeception/_envs/local.ymlを作成します。必要に応じてローカルの環境に変更してください。

modules:
    config:
        Db:
            user: 'postgres'
            password: ''
            dsn: 'pgsql:host=localhost;dbname=eccube_db'
        WebDriver:
            host: 'localhost'
            port: 9515
            url: 'http://localhost:8000'
        MailCatcher:
            url: 'localhost'
            port: 1080

実行方法

  1. PostgreSQL/MailCatcherはローカルで起動しておく
  2. EC-CUBEをAPP_ENV=codeceptionで起動しておく
  3. ChromeDriverを起動
    1. $ chromedriver --url-base=/wd/hub
  4. Codeceptionを実行
    1. $ vendor/bin/codecept run acceptance --env chrome,local -g admin01

@kiy0taka kiy0taka added this to the 3.n.0 milestone Apr 12, 2018
@kiy0taka kiy0taka force-pushed the may-the-e2e-testing-be-with-you branch from 771917c to 9994a1a Compare April 12, 2018 09:00
@kiy0taka kiy0taka force-pushed the may-the-e2e-testing-be-with-you branch from 793dc5b to 394b6cb Compare April 13, 2018 01:59
@kiy0taka kiy0taka force-pushed the may-the-e2e-testing-be-with-you branch from 394b6cb to 2671fe3 Compare April 13, 2018 02:42
@ryo-endo ryo-endo merged commit 6ada568 into EC-CUBE:experimental/sf Apr 13, 2018
@okazy
Copy link
Contributor

okazy commented Jun 4, 2018

実行手順4のオススメのオプション
vendor/bin/codecept run acceptance --env chrome-headless,local --html report.html -g admin01

  • --env chrome-headless : ブラウザ操作をバックグラウンドで実行
  • --html report.html : codeception/_output/report.html にレポートを出力

特定のテストケースだけの実行例
vendor/bin/codecept run acceptance --env chrome,local --html report.html EF03OrderCest:ログインしてカートをマージ

@chihiro-adachi
Copy link
Contributor

Dbの設定は現在では不要。local.yamlは以下の記載で動作します。

modules:
    config:
        WebDriver:
            host: 'localhost'
            port: 9515
            url: 'http://localhost:8080'
        MailCatcher:
            url: 'localhost'
            port: 1080

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
document Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants