webdriverio-boneyard / webdrivercss-adminpanel

Administration App for CSS Regression Testing with WebdriverCSS
http://webdriver.io
MIT License
71 stars 26 forks source link

Configuring API host #4

Open mplatt opened 9 years ago

mplatt commented 9 years ago

Hey there! Just a quick question: Is there a reason to why the API_HOST is hard coded to localhost in /app/scripts/app.js or am I missing something configuration wise? I would like to run ui regression tests on my build machine while running the admin interface on a different machine.

christian-bromann commented 9 years ago

Hi Moritz, the admin interface comes with the API required for syncing images between your tests (WebdriverCSS) and the admin panel. As far as I can see when running grunt serve:dist you start the frontend application on localhost:8080 and the API server on localhost:9000. If you want to run the API on a different port just change the hardcoded configuration. It is just a default config.

mplatt commented 9 years ago

Thanks for the quick reply. Say the admin panel is deployed on some machine with the hostname foo.org. It is no problem to POST to foo.org:8080/api/repositories/bar from a test suite. Opening foo.org in a browser will however result in the UI being broken since the browser requests localhost:8080/api/repositories no matter how it is configured.

christian-bromann commented 9 years ago

Have you tried to open foo.org:9000. Seems that this is the url to the UI then. (haven't worked on that project for a while now ^^)

mplatt commented 9 years ago

Hi Christian, OK, I see ^^ Thanks again for your quick replies!

Let me ilustrate what I am encountering real quick:

First, I install and serve webdrivercss-adminpanel on foo.org:

ssh nodeuser@foo.org
git clone git@github.com:webdriverio/webdrivercss-adminpanel.git
cd webdrivercss-adminpanel/
npm install
bower install
grunt serve:dist

Now on my local dev machine I connect to http://foo.org:9000/. Page load fails with a 404 for http://localhost:9000/api/repositories. Should be http://foo.org:9000/api/repositories

Check pull req #5 for that.