Skip to content

Commit

Permalink
url resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
potapovDim committed May 15, 2018
1 parent f570278 commit 5b3fdfe
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 55 deletions.
1 change: 0 additions & 1 deletion __specs__/integration/chrome/client.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,5 +384,4 @@ describe('client chrome', () => {
})
})

it()
})
8 changes: 4 additions & 4 deletions bin/awb
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ const args = process.argv.slice(2)

try {
if (args.includes('chrome') && args.includes('standalone') && args.includes('gecko')) {
getChromeDriver('2.34').then(getStandalone).then(getGeckoDriver)
getChromeDriver().then(getStandalone).then(getGeckoDriver)
} else if (args.includes('chrome') && args.includes('standalone')) {
getChromeDriver('2.34').then(getStandalone)
getChromeDriver().then(getStandalone)
} else if (args.includes('gecko') && args.includes('standalone')) {
getGeckoDriver().then(getStandalone)
} else if (args.includes('start') && args.includes('chrome')) {
Expand All @@ -35,11 +35,11 @@ try {
} else if (args.includes('standalone')) {
getStandalone()
} else if (args.includes('clear') && args.includes('all')) {
clearChrome('2.34').then(clearStandalone)
clearChrome().then(clearStandalone)
} else if (args.includes('killsession')) {
killProc()
} else if (args.includes('chrome')) {
getChromeDriver('2.34')
getChromeDriver()
} else if (args.includes('gecko')) {
getGeckoDriver()
}
Expand Down
96 changes: 48 additions & 48 deletions lib/capabilitiesAndBaseOpts.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,71 +1,71 @@
let timeout = 12000

const defaultChromeCapabilities = {
desiredCapabilities: {
browserName: 'chrome',
javascriptEnabled: true,
acceptSslCerts: true,
platform: 'ANY'
}
desiredCapabilities: {
browserName: 'chrome',
javascriptEnabled: true,
acceptSslCerts: true,
platform: 'ANY'
}
}

const defaultSafariCapabilities = {
desiredCapabilities: {
browserName: 'safari',
javascriptEnabled: true,
acceptSslCerts: true,
platform: 'ANY'
}
desiredCapabilities: {
browserName: 'safari',
javascriptEnabled: true,
acceptSslCerts: true,
platform: 'ANY'
}
}

const defaultFirefoxCapabilities = {
desiredCapabilities: {
browserName: "firefox",
acceptSslCerts: true,
shardTestFiles: false,
javascriptEnabled: true,
acceptSslCerts: true,
platform: 'ANY'
}
desiredCapabilities: {
browserName: "firefox",
acceptSslCerts: true,
shardTestFiles: false,
javascriptEnabled: true,
acceptSslCerts: true,
platform: 'ANY'
}
}

const baseOptionsStandAlone = {
hostname: 'localhost',
port: 4444,
path: '/wd/hub/session',
headers: {
'Content-Type': 'application/json'
},
timeout
hostname: 'localhost',
port: 4444,
path: '/wd/hub/session',
headers: {
'Content-Type': 'application/json'
},
timeout
}

const baseOptionsChrome = {
hostname: 'localhost',
port: 9515,
path: '/session',
headers: {
'Content-Type': 'application/json'
},
timeout
hostname: 'localhost',
port: 9515,
path: '/session',
headers: {
'Content-Type': 'application/json'
},
timeout
}

const baseOptionsFirefox = {
hostname: 'localhost',
port: 9516,
path: '/session',
headers: {
'Content-Type': 'application/json'
},
timeout
hostname: 'localhost',
port: 9516,
path: '/session',
headers: {
'Content-Type': 'application/json'
},
timeout
}

module.exports = {
timeout,
baseOptionsStandAlone,
baseOptionsChrome,
baseOptionsFirefox,
timeout,
baseOptionsStandAlone,
baseOptionsChrome,
baseOptionsFirefox,

defaultSafariCapabilities,
defaultChromeCapabilities,
defaultFirefoxCapabilities
defaultSafariCapabilities,
defaultChromeCapabilities,
defaultFirefoxCapabilities
}
3 changes: 2 additions & 1 deletion lib/fetchy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const fetch = require('node-fetch')
const url = require('url')

async function _fetchy(method, timeout, url, body, opts) {

Expand Down Expand Up @@ -34,7 +35,7 @@ async function _fetchy(method, timeout, url, body, opts) {


const fetchy = (method, URL, timeout, path, body, opts) => {
return _fetchy(method, timeout, URL + path, body, opts)
return _fetchy(method, timeout, url.resolve(URL, path), body, opts)
}

module.exports = fetchy
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "awb",
"version": "0.4.35",
"version": "0.4.36",
"description": "simple light weight interface for selenium webdriver (node js)",
"main": "./awb.js",
"bin": {
Expand Down

0 comments on commit 5b3fdfe

Please sign in to comment.