Allow passing a list of space-separated specs to --spec (#3375)

* cli: add otherSpecs for varargs [wip]

* scripts: pass command-line args through to debugged command

* cli: parse space-delimited specs

* cli: undo unneeded

* cli: cleaned up parseVariableOpts, added warning

* cli: cleanup

* cli: add tests

* cli: glorious whitespace

* cli: a more robust test

* cli: better snapshot

* server: strip single-quotes around --spec arg

#2298
This commit is contained in:
Zach Bloomquist
2019-03-15 00:42:46 -04:00
committed by Brian Mann
parent 6a53b4bed1
commit 5a0d8b5cfe
7 changed files with 98 additions and 6 deletions
+16 -2
View File
@@ -228,15 +228,29 @@ describe('cli', () => {
expect(run.start).to.be.calledWith({ parallel: true })
})
it('calls runs with --ci-build-id', () => {
it('calls run with --ci-build-id', () => {
this.exec('run --ci-build-id 123')
expect(run.start).to.be.calledWith({ ciBuildId: '123' })
})
it('calls runs with --group', () => {
it('calls run with --group', () => {
this.exec('run --group staging')
expect(run.start).to.be.calledWith({ group: 'staging' })
})
it('calls run with space-separated --specs', () => {
this.exec('run --spec a b c d e f g')
expect(run.start).to.be.calledWith({ spec: 'a,b,c,d,e,f,g' })
this.exec('run --dev bang --spec foo bar baz -P ./')
expect(run.start).to.be.calledWithMatch({ spec: 'foo,bar,baz' })
})
it('warns with space-separated --specs', (done) => {
sinon.spy(logger, 'warn')
this.exec('run --spec a b c d e f g --dev')
snapshot(logger.warn.getCall(0).args[0])
done()
})
})
context('cypress open', () => {
+3
View File
@@ -18,6 +18,7 @@ describe('exec run', function () {
const args = run.processRunOptions({
browser: 'test browser',
})
snapshot(args)
})
@@ -25,6 +26,7 @@ describe('exec run', function () {
const args = run.processRunOptions({
record: 'my record id',
})
snapshot(args)
})
@@ -33,6 +35,7 @@ describe('exec run', function () {
record: 'foo',
browser: 'test browser',
})
snapshot(args)
})
})