Skip to content

Commit 7f4c5a1

Browse files
committed
cy.artisan() accepts options
1 parent 11765f6 commit 7f4c5a1

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/stubs/support/laravel-commands.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,16 @@ Cypress.Commands.add("seed", (seederClass) => {
134134
*
135135
* @example cy.artisan('cache:clear');
136136
*/
137-
Cypress.Commands.add("artisan", (command, parameters = {}) => {
138-
Cypress.log({
139-
name: "artisan",
140-
message: command,
141-
consoleProps: () => ({ command, parameters }),
142-
});
137+
Cypress.Commands.add('artisan', (command, parameters = {}, options = {}) => {
138+
options = Object.assign({}, { log: true }, options);
139+
140+
if (options.log) {
141+
Cypress.log({
142+
name: 'artisan',
143+
message: command,
144+
consoleProps: () => ({ command, parameters }),
145+
});
146+
}
143147

144148
return cy.csrfToken().then((token) => {
145149
return cy.request({

0 commit comments

Comments
 (0)