Skip to content

Commit

Permalink
feat(builder): add --record option to cypress builder
Browse files Browse the repository at this point in the history
  • Loading branch information
vsavkin committed Jan 15, 2019
1 parent 2f64192 commit 1d4c2e7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/builders/src/cypress/cypress.builder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ describe('Cypress builder', () => {
tsConfig: 'apps/my-app-e2e/tsconfig.json',
devServerTarget: 'my-app:serve',
headless: true,
record: false,
baseUrl: undefined,
watch: false
};
Expand Down Expand Up @@ -196,6 +197,7 @@ describe('Cypress builder', () => {
tsConfig: 'apps/my-app-e2e/tsconfig.json',
devServerTarget: undefined,
headless: true,
record: false,
baseUrl: undefined,
watch: false
}
Expand Down Expand Up @@ -236,6 +238,7 @@ describe('Cypress builder', () => {
tsConfig: 'apps/my-app-e2e/tsconfig.e2e.json',
devServerTarget: undefined,
headless: true,
record: false,
baseUrl: undefined,
watch: false
}
Expand Down Expand Up @@ -275,6 +278,7 @@ describe('Cypress builder', () => {
tsConfig: 'apps/my-app-e2e/tsconfig.e2e.json',
devServerTarget: undefined,
headless: true,
record: false,
baseUrl: undefined,
watch: false
}
Expand Down
4 changes: 4 additions & 0 deletions packages/builders/src/cypress/cypress.builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export interface CypressBuilderOptions {
cypressConfig: string;
devServerTarget: string;
headless: boolean;
record: boolean;
tsConfig: string;
watch: boolean;
browser?: string;
Expand Down Expand Up @@ -92,6 +93,7 @@ export default class CypressBuilder implements Builder<CypressBuilderOptions> {
this.initCypress(
options.cypressConfig,
options.headless,
options.record,
options.watch,
options.baseUrl,
options.browser
Expand Down Expand Up @@ -178,6 +180,7 @@ export default class CypressBuilder implements Builder<CypressBuilderOptions> {
private initCypress(
cypressConfig: string,
headless: boolean,
record: boolean,
isWatching: boolean,
baseUrl: string,
browser?: string
Expand All @@ -198,6 +201,7 @@ export default class CypressBuilder implements Builder<CypressBuilderOptions> {
}

options.headed = !headless;
options.record = record;

return fromPromise<any>(
!isWatching || headless ? Cypress.run(options) : Cypress.open(options)
Expand Down
5 changes: 5 additions & 0 deletions packages/builders/src/cypress/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
"description": "Whether or not the open the Cypress application to run the tests. If set to 'true', will run in headless mode",
"default": false
},
"record": {
"type": "boolean",
"description": "Whether or not Cypress should record the results of the tests",
"default": false
},
"baseUrl": {
"type": "string",
"description": "Use this to pass directly the address of your distant server address with the port running your application"
Expand Down

0 comments on commit 1d4c2e7

Please sign in to comment.