Skip to content

Commit

Permalink
add custom port
Browse files Browse the repository at this point in the history
  • Loading branch information
xudafeng committed Jun 6, 2017
1 parent 668acf3 commit be8556a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
git_version = $$(git branch 2>/dev/null | sed -e '/^[^*]/d'-e's/* \(.*\)/\1/')
npm_bin= $$(npm bin)
custom_port = `${npm_bin}/detect-port 3458 -s`

all: test
install:
Expand Down Expand Up @@ -55,5 +56,9 @@ custom-reporter:
npm install macaca-simple-reportor --save-dev
macaca doctor
CUSTOM_DIR=macaca-logs/desktop-browser-sample macaca run --verbose --reporter macaca-simple-reportor -d ./macaca-test/desktop-browser-sample.test.js
custom-port:
#npm install macaca-electron --save-dev
${npm_bin}/macaca doctor
MACACA_SERVER_PORT=${custom_port} browser=electron ${npm_bin}/macaca run --no-window --verbose -d ./macaca-test/desktop-browser-sample.test.js -p ${custom_port}

.PHONY: test-pc
4 changes: 3 additions & 1 deletion macaca-test/desktop-browser-sample.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const wd = require('macaca-wd');

const diffImage = require('./utils.js').diffImage;



var browser = process.env.browser || 'electron';
browser = browser.toLowerCase();

Expand All @@ -14,7 +16,7 @@ describe('macaca desktop sample', function() {

var driver = wd.promiseChainRemote({
host: 'localhost',
port: 3456
port: process.env.MACACA_SERVER_PORT || 3456
});

before(() => {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
},
"devDependencies": {
"blink-diff": "^1.0.13",
"detect-port": "^1.1.4",
"macaca-cli": "^2.0.0",
"macaca-simple-reportor": "^1.0.0",
"macaca-utils": "^0.1.8",
Expand Down

0 comments on commit be8556a

Please sign in to comment.