chore: init

This commit is contained in:
2025-11-04 18:39:56 +01:00
commit e69016e4e3
13 changed files with 1645 additions and 0 deletions

41
examples/interact-form.js Normal file
View File

@@ -0,0 +1,41 @@
// Form Interaction Example
// Fills out and interacts with forms on the page
console.log('📝 Interacting with forms...');
// Find and fill input fields
await page.evaluate(() => {
// Fill text inputs
const textInputs = document.querySelectorAll('input[type="text"], input[type="email"]');
textInputs.forEach((input, index) => {
if (input.placeholder.toLowerCase().includes('email')) {
input.value = 'demo@example.com';
} else if (input.placeholder.toLowerCase().includes('name')) {
input.value = 'John Doe';
} else {
input.value = `Demo Text ${index + 1}`;
}
input.dispatchEvent(new Event('input', { bubbles: true }));
});
// Select first option in dropdowns
const selects = document.querySelectorAll('select');
selects.forEach(select => {
if (select.options.length > 1) {
select.selectedIndex = 1;
select.dispatchEvent(new Event('change', { bubbles: true }));
}
});
// Check checkboxes
const checkboxes = document.querySelectorAll('input[type="checkbox"]');
checkboxes.forEach(checkbox => {
checkbox.checked = true;
checkbox.dispatchEvent(new Event('change', { bubbles: true }));
});
});
console.log('✓ Forms filled');
// Wait for any animations
await new Promise(resolve => setTimeout(resolve, 500));