Testare il frontend di un'app web basata sui contenuti
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
I test sono fondamentali per garantire funzionalità, qualità, accessibilità, sicurezza e prestazioni della tua applicazione web basata sui contenuti. I test consentono di valutare l'esperienza utente e determinare se è necessario un ulteriore sviluppo. L'applicazione web deve soddisfare gli standard di qualità e funzionare come previsto.
Fornisce indicazioni di base sui test da prendere in considerazione per rendere la tua applicazione web accessibile e facile da usare.
Componenti |
Contrasto di colore |
Assicura che il rapporto di contrasto sia ottimizzato per la leggibilità. È necessario eseguire i controlli relativi ai vari tipi di daltonismo e ai colori forzati ad alto contrasto definiti dall'utente.
|
Tipografia |
Determina se l'applicazione è compatibile con dispositivi e impostazioni diversi. Utilizzando le dimensioni relative del carattere e il ridimensionamento non lineare, è comunque possibile utilizzare la tipografia con la dimensione massima.
|
Immagini |
Garantisce che le immagini siano di alta qualità e possano essere caricate rapidamente. È importante verificare la presenza di elementi di riserva corretti senza rete e asset ottimizzati per risoluzioni più elevate.
|
Navigazione |
Garantisce che la navigazione sia chiara e utilizzabile con il mouse, il tocco e la navigazione da tastiera.
Il controllo dell'API cronologia garantisce che anche la navigazione avanti e indietro venga conservata correttamente.
|
Cerca |
Verifica la bassa latenza nei tempi di risposta alle query nei parametri di ricerca dell'URL e nel campo di ricerca.
|
Modulo |
Assicura che tutti i moduli siano facili da compilare e inviare. Se esegui l'override dell'invio del modulo predefinito, gli eventi corretti devono essere ascoltati e controllati per la reimpostazione del modulo e la protezione da input utente dannosi.
|
Esibizione |
Garantisce che l'applicazione sia efficiente, reattiva e con tempi di caricamento rapidi. Anche questa dovrebbe essere una parte importante dei test di regressione.
|
Ci sono molti strumenti che puoi
utilizzare per controllare l'accessibilità web. È importante usare più metodi per coprire
la gamma di componenti di accessibilità. Assicurati di verificare la presenza di etichette ARIA, a11y di elementi DOM, navigazione da tastiera e utilizzo dello screen reader.
I framework di test di frontend, come Jest, Vitest, Cypress, Mocha o Jasmine, ti aiutano a scrivere test in modo efficiente e a supportare lo sviluppo basato sul comportamento e basato sui test. Con le integrazioni nelle pipeline CI/CD puoi anche automatizzare i test e prevenire i bug di regressione nei commit.
I framework di esecuzione, come Web Test
Runner,
Playwright, Web
Driver o Esecutore di test in
Node.js, consentono di eseguire questi test in modo efficiente e supportare i test in più ambienti e
piattaforme. Questo non è un elenco completo e, a seconda del framework che stai utilizzando, potrebbero essere dei test integrati.
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-25 UTC.
[null,null,["Ultimo aggiornamento 2025-07-25 UTC."],[[["\u003cp\u003eTesting is essential for ensuring the functionality, quality, accessibility, security, and performance of your web application, ultimately enhancing user experience.\u003c/p\u003e\n"],["\u003cp\u003eKey components of web application testing include color contrast, typography, images, navigation, search, forms, and performance.\u003c/p\u003e\n"],["\u003cp\u003eUtilize a variety of accessibility testing tools and methods to cover a comprehensive range of components like ARIA labels, keyboard navigation, and screen reader compatibility.\u003c/p\u003e\n"],["\u003cp\u003eLeverage front-end testing frameworks such as Jest, Vitest, Cypress, Mocha, or Jasmine to efficiently write and automate tests, supporting both behavior-driven and test-driven development.\u003c/p\u003e\n"],["\u003cp\u003eEmploy runner frameworks like Web Test Runner, Playwright, Web Driver, or Node.js's Test Runner for executing tests across multiple environments and platforms.\u003c/p\u003e\n"]]],["Testing should evaluate web application accessibility, functionality, and performance. Key actions include checking color contrast for readability, ensuring relative typography scaling, and verifying image quality and load times. Navigation should be usable via mouse, touch, and keyboard. Search response times should be fast, and forms must be user-friendly with appropriate event handling. Performance, including fast load times, is vital. Multiple tools and front-end frameworks (e.g., Jest, Cypress) can aid in this process, and automation via CI/CD pipelines is recommended.\n"],null,["# Testing a content-driven web app frontend\n\nTesting is crucial to ensuring the functionality, quality, accessibility,\nsecurity, and performance of your content driven web application. Testing lets\nyou assess the user experience and determine if further development is\nnecessary. Your web application should meet quality standards and perform as\nexpected.\n\nThis provides basic testing guidance for you to consider to make your web\napplication accessible and user-friendly.\n\n| Components ||\n|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Color contrast | Ensures that the contrast ratio is optimized for readability. Checks need to be done for various types of color blindness and user defined high contrast forced colors. |\n| Typography | Determines if the application accommodates different devices and settings. By using relative font size and non linear scaling the typography can still be usable on the max size. |\n| Images | Ensures that the images are high quality and can load quickly. It is important to check for correct fallbacks with no network and optimized assets for higher resolutions. |\n| Navigation | Ensures that the navigation is clear and usable by mouse, touch and keyboard navigation. Checking the history api ensures the back and forward navigation is also preserved correctly. |\n| Search | Check for low latency in response times to queries in the URL query parameters and search field. |\n| Form | Ensures that all forms are user-friendly to complete and submit. If overriding the default form submission the correct events need to be listened to and checked for proper form reset and protection against malicious user input. |\n| Performance | Ensures that the application is efficient and responsive, with fast load times. This should be an important part of regression testing too. |\n\nThere are [many tools](https://www.w3.org/WAI/ER/tools/) you can\nuse to check web accessibility. It is important to use multiple methods in order\nto cover the range of accessibility components. Be sure to check for ARIA\nlabels, a11y on DOM elements, keyboard navigation, and screen reader use.\n\nFront end testing frameworks, such as [Jest](https://jestjs.io/),\n[Vitest](https://vitest.dev/),\n[Cypress](https://www.cypress.io/),\n[Mocha](https://mochajs.org/) or\n[Jasmine](https://jasmine.github.io/) help you write tests\nefficiently and support behavior-driven and test-driven development. With\nintegrations into CI/CD pipelines you can also automate your tests and help\nprevent regression bugs in commits.\n\nRunner frameworks, such as [Web Test\nRunner](https://modern-web.dev/docs/test-runner/overview/),\n[Playwright](https://playwright.dev/), [Web\nDriver](https://webdriver.io/) or the [Test Runner in\nNode.js](https://nodejs.org/api/test.html) let you execute these\ntests efficiently and support testing across multiple environments and\nplatforms. This is not an exhaustive list and depending on the framework you are\nusing there could be testing built-in."]]