Skip to content

Commit 9bf4b05

Browse files
authored
Update core.blade.php
1 parent 5f96597 commit 9bf4b05

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

.ai/pest/4/core.blade.php

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
## Pest 4
22

3-
- Pest v4 is a huge upgrade offering: browser testing, smoke testing, visual regression testing, test sharding, faster type coverage, and profanity checking.
3+
- Pest v4 is a huge upgrade to Pest and offers: browser testing, smoke testing, visual regression testing, test sharding, and faster type coverage.
44
- Browser testing is incredibly powerful and useful for this project.
55
- Browser tests should live in `tests/Browser/`.
6-
- Use the `search-docs` tool for detailed guidance on utilising these features.
6+
- Use the `search-docs` tool for detailed guidance on utilizing these features.
77

8-
## Browser testing
9-
- You can use Laravel features like `Event::fake()`, `assertAuthenticated()`, and model factories within browser tests, as well as `RefreshDatabase` (when needed) to ensure a clean state for each test.
10-
- Test on multiple browsers (Chrome, Firefox, Safari).
11-
- Test on different devices and viewports (like iPhone 14 Pro, tablets, or custom breakpoints).
12-
- Switch color schemes (light/dark mode).
13-
- Interact with the page (click, type, scroll, select, submit, drag-and-drop, touch gestures, etc.).
14-
- Take screenshots or pause tests for debugging.
8+
### Browser Testing
9+
- You can use Laravel features like `Event::fake()`, `assertAuthenticated()`, and model factories within Pest v4 browser tests, as well as `RefreshDatabase` (when needed) to ensure a clean state for each test.
10+
- If requested, test on multiple browsers (Chrome, Firefox, Safari).
11+
- If requested, test on different devices and viewports (like iPhone 14 Pro, tablets, or custom breakpoints).
12+
- Switch color schemes (light/dark mode) when appropriate.
13+
- Interact with the page (click, type, scroll, select, submit, drag-and-drop, touch gestures, etc.) when appropriate to complete the test.
14+
- Take screenshots or pause tests for debugging when appropriate.
1515

16+
### Example Tests
1617
@verbatim
17-
<code-snippet name="Pest browser test example" lang="php">
18+
<code-snippet name="Pest Browser Test Example" lang="php">
1819
it('may reset the password', function () {
1920
Notification::fake();
21+
2022
$this->actingAs(User::factory()->create());
2123

22-
$page = visit('/sign-in') // visit on a real browser...
23-
->on()->mobile() // or ->desktop(), ->tablet(), etc...
24-
->inDarkMode(); // or ->inLightMode()
24+
$page = visit('/sign-in'); // Visit on a real browser...
2525

2626
$page->assertSee('Sign In')
2727
->assertNoJavascriptErrors() // or ->assertNoConsoleLogs()
@@ -34,9 +34,11 @@
3434
});
3535
</code-snippet>
3636
@endverbatim
37+
3738
@verbatim
38-
<code-snippet name="Pest smoke testing example" lang="php">
39+
<code-snippet name="Pest Smoke Testing Example" lang="php">
3940
$pages = visit(['/', '/about', '/contact']);
41+
4042
$pages->assertNoJavascriptErrors()->assertNoConsoleLogs();
4143
</code-snippet>
4244
@endverbatim

0 commit comments

Comments
 (0)