Skip to content

Commit 8fa4af0

Browse files
authored
Merge branch '4.x' into feat/new-expectation
2 parents af173c5 + 922350b commit 8fa4af0

102 files changed

Lines changed: 1083 additions & 1763 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ coverage.xml
1313
# Playwright
1414
node_modules/
1515
/tests/Browser/screenshots
16+
17+
# MacOS
18+
.DS_Store

composer.json

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,28 @@
4444
}
4545
},
4646
"scripts": {
47-
"lint": "pint",
48-
"refactor": "rector",
47+
"bump:minor": [
48+
"composer update && composer bump",
49+
"npx npm-check-updates -u -t minor && npm install"
50+
],
51+
"lint": [
52+
"rector",
53+
"pint"
54+
],
4955
"test:type-coverage": "pest --type-coverage --exactly=100",
5056
"test:typos": "peck",
51-
"test:lint": "pint --test",
52-
"test:unit": "pest --parallel --coverage --exactly=76.6",
57+
"test:lint": [
58+
"rector --dry-run",
59+
"pint --test"
60+
],
61+
"test:unit": "pest --parallel --coverage --exactly=80.5",
5362
"test:types": "phpstan",
54-
"test:refactor": "rector --dry-run",
5563
"test": [
5664
"@test:lint",
5765
"@test:type-coverage",
5866
"@test:typos",
5967
"@test:unit",
60-
"@test:types",
61-
"@test:refactor"
68+
"@test:types"
6269
],
6370
"post-update-cmd": [
6471
"composer install -d playground --ansi"

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
},
2222
"homepage": "https://github.com/pestphp/pest-plugin-browser#readme",
2323
"dependencies": {
24-
"playwright": "^1.51.0"
24+
"playwright": "^1.53.0"
2525
}
2626
}

phpunit.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,4 @@
3131
<directory suffix=".php">./src</directory>
3232
</include>
3333
</source>
34-
<php>
35-
<env name="PEST_BROWSER_SCREENSHOT_DIR" value="./tests/Browser/screenshots"/>
36-
</php>
3734
</phpunit>

playground/resources/views/layouts/app.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1">
66

7-
<title>@yield('title', config('app.name'))</title>
7+
<title>@yield('title', 'Hi nunonation')</title>
88

99
<!-- Fonts -->
1010
<link rel="preconnect" href="https://fonts.bunny.net">

playground/resources/views/test-pages/element-tests.blade.php

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,12 @@ class="profile-picture" />
263263
<!-- Elements for Event Testing -->
264264
<div class="section">
265265
<h2>Event Testing</h2>
266+
<div id="focus-display" data-testid="focus-display" class="p-2 bg-blue-50 border text-sm mb-2">No element focused yet</div>
267+
<div id="hover-display" data-testid="hover-display" class="p-2 bg-green-50 border text-sm mb-2">No element hovered yet</div>
268+
<div id="hover-target" data-testid="hover-target" class="p-4 border bg-blue-100 hover:bg-blue-200 transition-colors cursor-pointer mb-4">
269+
Hover Target
270+
</div>
271+
<input id="focus-target" data-testid="focus-target" type="text" class="bg-white text-black p-2 border focus:border-blue-500 mb-4" placeholder="Focus on me" />
266272
<button id="event-button" data-testid="event-button">Click Me</button>
267273
<div id="event-result" data-testid="event-result"></div>
268274
</div>
@@ -273,9 +279,7 @@ class="profile-picture" />
273279
<div data-testid="scroll-target" style="margin-top: 500px;">
274280
This element is far down the page for scroll testing
275281
</div>
276-
</div>
277-
278-
<script>
282+
</div> <script>
279283
// Counter for click testing
280284
let clickCounter = 0;
281285
@@ -284,6 +288,22 @@ function incrementCounter() {
284288
document.querySelector('[data-testid="click-counter"]').textContent = clickCounter;
285289
}
286290
291+
// Focus tracking function
292+
function trackFocus(elementId) {
293+
const focusDisplay = document.getElementById('focus-display');
294+
if (focusDisplay) {
295+
focusDisplay.textContent = 'Last focused: ' + elementId;
296+
}
297+
}
298+
299+
// Hover tracking function
300+
function trackHover(elementId) {
301+
const hoverDisplay = document.getElementById('hover-display');
302+
if (hoverDisplay) {
303+
hoverDisplay.textContent = 'Last hovered: ' + elementId;
304+
}
305+
}
306+
287307
// Add some basic interactivity for testing
288308
document.addEventListener('DOMContentLoaded', function() {
289309
// Event button click handler
@@ -296,6 +316,40 @@ function incrementCounter() {
296316
});
297317
}
298318
319+
// Add focus tracking event listeners
320+
document.getElementById('focus-target').addEventListener('focus', function() {
321+
trackFocus('focus-target');
322+
});
323+
document.getElementById('username').addEventListener('focus', function() {
324+
trackFocus('username');
325+
});
326+
document.getElementById('password').addEventListener('focus', function() {
327+
trackFocus('password');
328+
});
329+
document.getElementById('search').addEventListener('focus', function() {
330+
trackFocus('search');
331+
});
332+
document.getElementById('comments').addEventListener('focus', function() {
333+
trackFocus('comments');
334+
});
335+
336+
// Hover tracking
337+
const hoverTarget = document.getElementById('hover-target');
338+
if (hoverTarget) {
339+
['mouseenter', 'mouseover', 'pointerenter'].forEach(event => {
340+
hoverTarget.addEventListener(event, function() {
341+
trackHover('hover-target');
342+
});
343+
});
344+
}
345+
346+
// Add global hover detection for Playwright compatibility
347+
document.addEventListener('mousemove', function(e) {
348+
if (e.target.id === 'hover-target') {
349+
trackHover('hover-target');
350+
}
351+
});
352+
299353
// Make forms more interactive
300354
const usernameInput = document.getElementById('username');
301355
if (usernameInput) {

src/Autoload.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
declare(strict_types=1);
44

5-
namespace Pest\Browser;
6-
5+
use Pest\Browser\Browser;
76
use Pest\Browser\Playwright\Client;
87
use Pest\Browser\Playwright\Page;
98
use Pest\Browser\Playwright\Playwright;
9+
use Pest\Browser\ServerManager;
1010
use Pest\Plugin;
1111

1212
Plugin::uses(Browser::class);

0 commit comments

Comments
 (0)