2017-01-10 9 views
2

私は、セレクションスーツをテストするために、セレンのスタンドアロンクロムサービスをセットアップしようとしています。セレントサービスでGitlab CIのコードをテストする

私はサービスとしてクロムをスタンドアロンで実行します。

services: 
    - mysql:latest 
    - selenium/standalone-chrome:latest 

そして私のセットアップ私のCodeceptionテストのための接続がextension for WordPressとwebdriverをを使用しています。

WPWebDriver: 
    url: 'http://localhost' 
    host: 'selenium__standalone-chrome' 
    browser: chrome 
    port: 4444 
    restart: true 
    wait: 2 
    adminUsername: admin 
    adminPassword: 1234 
    adminUrl: /wp-admin 

他のすべてのテストがうまく実行しますが私が接続を拒否するSeleniumを使うスイートに来る:

Time: 7.55 seconds, Memory: 16.00MB 

There was 1 failure: 

--------- 
1) SampleTestCept: Test if wp is working in selenium 
Test tests/php/acceptance/SampleTestCept.php 
Step See "Just another WordPress site" 
Fail Failed asserting that on page/
--> This site can’t be reached 
localhost refused to connect. 
Try: 
Checking the connection 
Checking the proxy and the firewall 
ERR_CONNECTION_REFUSED 
Reload 
DETAILS 
--> contains "this site can't be reached". 

Scenario Steps: 

2. $I->see("This site can't be reached") at tests/php/acceptance/SampleTestCept.php:6 
1. $I->amOnPage("/") at tests/php/acceptance/SampleTestCept.php:4 

私は何が間違っているのアイデアですか?

答えて

0

おそらく問題は、http://localhost urlを使用し、別のホスト上でseleniumサーバーを実行していることです。

Seleniumは、テストを実行しているマシンではなく、それ自身のポート80に接続しようとします。

+0

これまでのところ、これは実際問題であるとわかりました。しかし、私はイメージ "tutum__wordpress"のホスト名を使用しようとしましたが、うまくいきませんでした。 ベースコンテナのホスト名を検索しようとしましたが、[docs](https://docs.gitlab.com/ee/ci/variables/README.html)には何も見つかりませんでした。任意の変数を指定します。 – Greg36

0

環境変数HOSTNAMEを使用して、gitlabランナーの実際のホスト名を検索します。