docs: issues técnicas para nuevas funcionalidades
Agrega 19 issues técnicas documentando funcionalidades implementadas y pendientes. Issues completadas (movidas a dev/issues/completed/): - 001-conversor-web-markdown.md - 002-accessibility-tree.md - 003-gestion-cookies-perfil.md - 004-gestion-extensiones-chrome.md - 005-eliminar-timeouts-innecesarios.md Issues implementadas: - 006-manejo-tabs-ventanas.md - 016-manejo-iframes.md - 017-actions-api.md - 018-file-uploads.md - 019-expected-conditions-mejoradas.md Issues pendientes (media prioridad): - 007-alert-prompt-confirm-handling.md - 008-screenshot-elementos-especificos.md - 009-pdf-generation.md - 010-device-emulation-completo.md - 011-downloads-handling.md Issues pendientes (baja prioridad / avanzado): - 012-browser-contexts-multi-sesion.md - 013-video-recording.md - 014-network-mocking-avanzado.md - 015-geolocation-permissions.md Incluye también dev/NUEVAS_FUNCIONALIDADES.md con resumen completo. Directorio: dev/
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
# Issue #016: Manejo de iFrames
|
||||
|
||||
**Tipo**: Enhancement
|
||||
**Prioridad**: Alta
|
||||
**Estado**: En progreso
|
||||
|
||||
## Descripción
|
||||
|
||||
Implementar capacidad para trabajar con elementos dentro de iframes.
|
||||
|
||||
## Funcionalidad deseada
|
||||
|
||||
- Cambiar contexto a un iframe específico
|
||||
- Volver al contexto principal (main frame)
|
||||
- Listar todos los iframes de la página
|
||||
- Detectar cuando iframe carga
|
||||
- Ejecutar JavaScript dentro de iframe
|
||||
- Click/Type en elementos dentro de iframe
|
||||
- Navegación en cascada (frame -> subframe -> subsubframe)
|
||||
|
||||
## API propuesta
|
||||
|
||||
```go
|
||||
// Frame representa un iframe
|
||||
type Frame struct {
|
||||
ID string
|
||||
ParentID string
|
||||
URL string
|
||||
Name string
|
||||
FrameTree []*Frame // Sub-frames
|
||||
}
|
||||
|
||||
// SwitchToFrame cambia contexto a un iframe
|
||||
func (b *Browser) SwitchToFrame(ctx context.Context, selector string) error
|
||||
|
||||
// SwitchToFrameByName cambia a iframe por atributo name
|
||||
func (b *Browser) SwitchToFrameByName(ctx context.Context, name string) error
|
||||
|
||||
// SwitchToMainFrame vuelve al contexto principal
|
||||
func (b *Browser) SwitchToMainFrame(ctx context.Context) error
|
||||
|
||||
// GetFrames obtiene todos los frames de la página
|
||||
func (b *Browser) GetFrames(ctx context.Context) ([]*Frame, error)
|
||||
|
||||
// WaitForFrame espera a que un frame cargue
|
||||
func (b *Browser) WaitForFrame(ctx context.Context, selector string) error
|
||||
|
||||
// EvaluateInFrame ejecuta JS en un frame específico
|
||||
func (b *Browser) EvaluateInFrame(ctx context.Context, frameID string, script string) (*EvaluateResult, error)
|
||||
```
|
||||
|
||||
## Uso
|
||||
|
||||
```go
|
||||
// Cambiar a iframe
|
||||
b.SwitchToFrame(ctx, "#payment-iframe")
|
||||
|
||||
// Interactuar dentro del iframe
|
||||
b.Type(ctx, "#card-number", "1234567890123456", nil)
|
||||
b.Click(ctx, "#submit-payment")
|
||||
|
||||
// Volver al frame principal
|
||||
b.SwitchToMainFrame(ctx)
|
||||
|
||||
// Listar frames
|
||||
frames, _ := b.GetFrames(ctx)
|
||||
for _, frame := range frames {
|
||||
log.Printf("Frame: %s - %s", frame.Name, frame.URL)
|
||||
}
|
||||
```
|
||||
|
||||
## CDP Methods
|
||||
|
||||
- `Page.getFrameTree` - Árbol de frames
|
||||
- `DOM.describeNode` - Info de frame node
|
||||
- `Runtime.evaluate` con `contextId` específico
|
||||
|
||||
## Referencias
|
||||
|
||||
- CDP Page.getFrameTree: https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-getFrameTree
|
||||
- Selenium frames: https://www.selenium.dev/documentation/webdriver/interactions/frames/
|
||||
- Playwright frames: https://playwright.dev/docs/frames
|
||||
Reference in New Issue
Block a user