-
Notifications
You must be signed in to change notification settings - Fork 39
specs and env options #46
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
Changes from all commits
3c39e4a
0d91e79
80043c2
d6006e8
752b0b2
1223794
d253999
82892ba
6337ead
644ff64
d054634
961eb70
391e88a
0446485
3500d6e
7dbd8c0
2e19a75
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -249,6 +249,136 @@ describe("capabilityHelper.js", () => { | |
chai.assert.fail("Promise error"); | ||
}); | ||
}); | ||
|
||
context("specs and env from run_setting", () => { | ||
it("sets specs list is present", () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no test where specs list is an Array or passed args is of Array type There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As call to specs for array conditions are covered in the util.js itself: https://github.com/browserstack/browserstack-cypress-cli/pull/46/files/961eb70b7347802f7cad51a6192c92b6ec21df39#diff-175b2b2ef3763bf0f62fe44137aa5d34R350 |
||
let specsList = "spec1,spec2"; | ||
let zip_url = "bs://<random>"; | ||
let bsConfig = { | ||
auth: { | ||
username: "random", | ||
access_key: "random", | ||
}, | ||
browsers: [ | ||
{ | ||
browser: "chrome", | ||
os: "Windows 10", | ||
versions: ["78", "77"], | ||
}, | ||
], | ||
run_settings: { | ||
specs: specsList | ||
}, | ||
}; | ||
|
||
return capabilityHelper | ||
.caps(bsConfig, { zip_url: zip_url }) | ||
.then(function (data) { | ||
let parsed_data = JSON.parse(data); | ||
chai.assert.equal(parsed_data.specs, specsList); | ||
chai.assert.equal(parsed_data.env, undefined); | ||
}) | ||
.catch((error) => { | ||
chai.assert.fail("Promise error"); | ||
}); | ||
}); | ||
|
||
it("sets env list is present", () => { | ||
let envList = "env1=value1,env2=value2"; | ||
let zip_url = "bs://<random>"; | ||
let bsConfig = { | ||
auth: { | ||
username: "random", | ||
access_key: "random", | ||
}, | ||
browsers: [ | ||
{ | ||
browser: "chrome", | ||
os: "Windows 10", | ||
versions: ["78", "77"], | ||
}, | ||
], | ||
run_settings: { | ||
env: envList | ||
}, | ||
}; | ||
|
||
return capabilityHelper | ||
.caps(bsConfig, { zip_url: zip_url }) | ||
.then(function (data) { | ||
let parsed_data = JSON.parse(data); | ||
chai.assert.equal(parsed_data.env, envList); | ||
chai.assert.equal(parsed_data.specs, undefined); | ||
}) | ||
.catch((error) => { | ||
chai.assert.fail("Promise error"); | ||
}); | ||
}); | ||
|
||
it("sets both specs and env list is present", () => { | ||
let specsList = "spec1,spec2"; | ||
let envList = "env1=value1,env2=value2"; | ||
let zip_url = "bs://<random>"; | ||
let bsConfig = { | ||
auth: { | ||
username: "random", | ||
access_key: "random", | ||
}, | ||
browsers: [ | ||
{ | ||
browser: "chrome", | ||
os: "Windows 10", | ||
versions: ["78", "77"], | ||
}, | ||
], | ||
run_settings: { | ||
specs: specsList, | ||
env: envList | ||
}, | ||
}; | ||
|
||
return capabilityHelper | ||
.caps(bsConfig, { zip_url: zip_url }) | ||
.then(function (data) { | ||
let parsed_data = JSON.parse(data); | ||
chai.assert.equal(parsed_data.specs, specsList); | ||
chai.assert.equal(parsed_data.env, envList); | ||
}) | ||
.catch((error) => { | ||
chai.assert.fail("Promise error"); | ||
}); | ||
}); | ||
|
||
it("both specs and env list is not present", () => { | ||
let zip_url = "bs://<random>"; | ||
let bsConfig = { | ||
auth: { | ||
username: "random", | ||
access_key: "random", | ||
}, | ||
browsers: [ | ||
{ | ||
browser: "chrome", | ||
os: "Windows 10", | ||
versions: ["78", "77"], | ||
}, | ||
], | ||
run_settings: { | ||
}, | ||
}; | ||
|
||
return capabilityHelper | ||
.caps(bsConfig, { zip_url: zip_url }) | ||
.then(function (data) { | ||
let parsed_data = JSON.parse(data); | ||
chai.assert.equal(parsed_data.specs, undefined); | ||
chai.assert.equal(parsed_data.env, undefined); | ||
}) | ||
.catch((error) => { | ||
chai.assert.fail("Promise error"); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
||
describe("validate", () => { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
confirm the cli messages and default values once
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will update the message values.