robotframework / robotframework/SeleniumLibrary

Add "Wait for DOM inactivity" keyword which waits until page is fully loaded/rendered

Aperta
#1,764 4 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Python
Stelle
1.5k
Fork
787
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Prerequisites

For issues

Steps to reproduce the issue

N/A

Error messages and additional information

N/A

Expected behavior and actual behavior

N/A

Environment

N/A

Feature Request Background

In an effort to improve page performance, modern web apps load initial content, then load the rest of the data on the page via XHR requests. The page continues to mutate until all additional data is loaded. This is a major problem for old frameworks like Selenium, which simply wait until the initial page loads but do not wait until the content on the page fully loads.

Examples of this loading style can be found on sites like:
airbnb.com
amazon.com
buzzfeed.com
yahoo.com

A workaround we've found extremely useful at my company is to leverage the relatively new Mutation Observer api (docs here).

This mutation observer can be configured to fire a callback every time a node on the DOM is added or mutated. This can be used to detect when the page finally calms down and is ready for the automated test to continue.

Feature Request

My feature request, which I will implement, is to leverage this mutation observer in a new keyword "Wait for DOM Inactivity", which the user can call to wait on the XHR requests on dynamic pages (like those listed above) to finish.

Some key scenarios where this can be used are:

  • pretty much any automated test which tests against a single page app
  • whenever a button click opens & loads a modal
  • on highly performant, dynamic pages which heavily leverage XHR requests (like those listed above)

Let me know if this interests you, I would be more than happy to implement this. I have used SeleniumLibrary extensively and love the library, and would love to contribute to it in any way.

Thank you for reading my request!

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

La issue nomina la nuova keyword Wait for DOM Inactivity di SeleniumLibrary e la Mutation Observer API lato browser, ma non indica file del repository né test. Inizia individuando gli entry point esistenti delle keyword di attesa e i relativi test; il lavoro è completato quando la keyword è disponibile per le pagine dinamiche e il suo comportamento è coperto dai test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, python
Ambito
testing
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.