Skip to content

Commit b1d9d22

Browse files
Merge pull request #23 from dansysanalyst/master
Friendly messages
2 parents 622a571 + 5928cb8 commit b1d9d22

File tree

4 files changed

+27
-17
lines changed

4 files changed

+27
-17
lines changed

dist/magic_test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function enableKeyboardShortcuts() {
8484
text: text
8585
}
8686
});
87-
alert("Generated an assertion for \"" + selectedText() + "\". Type `ok` in the debugger console to add it to your test file.");
87+
alert("Assertion generated for \"" + selectedText() + "\". \nType `ok` in the Magic Test console to add it to your test file.");
8888
}
8989
}
9090

@@ -11281,7 +11281,7 @@ return jQuery;
1128111281
/************************************************************************/
1128211282
/******/ // The module cache
1128311283
/******/ var __webpack_module_cache__ = {};
11284-
/******/
11284+
/******/
1128511285
/******/ // The require function
1128611286
/******/ function __webpack_require__(moduleId) {
1128711287
/******/ // Check if module is in cache
@@ -11294,14 +11294,14 @@ return jQuery;
1129411294
/******/ // no module.loaded needed
1129511295
/******/ exports: {}
1129611296
/******/ };
11297-
/******/
11297+
/******/
1129811298
/******/ // Execute the module function
1129911299
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
11300-
/******/
11300+
/******/
1130111301
/******/ // Return the exports of the module
1130211302
/******/ return module.exports;
1130311303
/******/ }
11304-
/******/
11304+
/******/
1130511305
/************************************************************************/
1130611306
/******/ /* webpack/runtime/define property getters */
1130711307
/******/ (() => {
@@ -11314,12 +11314,12 @@ return jQuery;
1131411314
/******/ }
1131511315
/******/ };
1131611316
/******/ })();
11317-
/******/
11317+
/******/
1131811318
/******/ /* webpack/runtime/hasOwnProperty shorthand */
1131911319
/******/ (() => {
1132011320
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
1132111321
/******/ })();
11322-
/******/
11322+
/******/
1132311323
/******/ /* webpack/runtime/make namespace object */
1132411324
/******/ (() => {
1132511325
/******/ // define __esModule on exports
@@ -11330,7 +11330,7 @@ return jQuery;
1133011330
/******/ Object.defineProperty(exports, '__esModule', { value: true });
1133111331
/******/ };
1133211332
/******/ })();
11333-
/******/
11333+
/******/
1133411334
/************************************************************************/
1133511335
var __webpack_exports__ = {};
1133611336
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
@@ -11417,4 +11417,4 @@ ready(function () {
1141711417
})();
1141811418

1141911419
/******/ })()
11420-
;
11420+
;

js/Context.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export function enableKeyboardShortcuts() {
77
}
88

99
document.addEventListener('keydown', keydown, false);
10-
10+
1111
function generateAssertion() {
1212
let text = selectedText();
1313
if (text.trim().length > 0) {
@@ -20,7 +20,7 @@ export function enableKeyboardShortcuts() {
2020
text: text
2121
}
2222
});
23-
alert("Generated an assertion for \"" + selectedText() + "\". Type `ok` in the debugger console to add it to your test file.");
23+
alert("Assertion generated for \"" + selectedText() + "\". \nType `ok` in the Magic Test console to add it to your test file.");
2424
}
2525
}
2626

@@ -33,4 +33,4 @@ export function enableKeyboardShortcuts() {
3333
}
3434
return text;
3535
}
36-
}
36+
}

src/Commands/MagicTestCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class MagicTestCommand extends Command
1212

1313
public function handle()
1414
{
15-
$this->comment('Your Magic Test session is starting...');
15+
$this->line('<info>***</info> Starting a 🧙 <fg=yellow>Magic Test</> session...');
1616

1717
$filter = $this->option('filter') ? (' --filter ' . $this->option('filter')) : '';
1818
shell_exec('php artisan dusk --browse' . $filter);

src/MagicTestManager.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,17 @@ public static function run(Browser $browser)
3535
$browser->script('MagicTest.run()');
3636

3737
$shell = new Shell(new Configuration([
38-
'startupMessage' => '<info>Your Magic Test session has started!</info>',
38+
'startupMessage' =>
39+
"\n"
40+
. '<info>***</info> Welcome to your 🧙 <fg=yellow>Magic Test</> session! <info>***</info>'
41+
. "\n"
42+
. "\n<fg=yellow>*</> To make a assertion press <info>Ctrl + Shift + A</info> on your browser."
43+
. "\n<fg=yellow>*</> Type <info>ok</info> to magically write it to your test file."
44+
. "\n (make as many assertions as you wish)"
45+
. "\n<fg=yellow>*</> Type <info>finish</info> to finalize and save your test file."
46+
. "\n<fg=yellow>*</> Type <info>exit</info> to leave."
47+
. "\n"
48+
. "\n<fg=yellow>💡 Tip:</> Do not close your browser window before finalizing this session here.",
3949
]));
4050

4151
$shell->addCommands([
@@ -60,7 +70,7 @@ public function runScripts(): string
6070

6171
$browser->script('MagicTest.clear()');
6272

63-
return $grammar->count() . " new " . Str::plural('action', $grammar->count()) . ($grammar->count() > 1 ? ' were' : ' was') . " added to ". MagicTest::$file . "::" . MagicTest::$method;
73+
return '🧙 <fg=yellow>' . $grammar->count() . '</> new ' . Str::plural('action', $grammar->count()) . ($grammar->count() > 1 ? ' were' : ' was') . ' added to <fg=yellow>' . MagicTest::$file . '</><fg=white>::' . MagicTest::$method . '</>';
6474
}
6575

6676
public function finish(): string
@@ -73,14 +83,14 @@ public function finish(): string
7383
(new FileEditor)->finish($content, $method)
7484
);
7585

76-
return 'Your Magic Test session has finished. See you later!';
86+
return 'Your 🧙 <fg=yellow>Magic Test</> session has finished. See you later! 👋 ';
7787
}
7888

7989
public function buildTest(Collection $grammar): void
8090
{
8191
$content = file_get_contents(MagicTest::$file);
8292
$method = MagicTest::$method;
83-
93+
8494
file_put_contents(
8595
MagicTest::$file,
8696
(new FileEditor)->process($content, $grammar, $method)

0 commit comments

Comments
 (0)