We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Front-end testing with Python

Formale Metadaten

Titel
Front-end testing with Python
Serientitel
Anzahl der Teile
160
Autor
Lizenz
CC-Namensnennung - keine kommerzielle Nutzung - Weitergabe unter gleichen Bedingungen 3.0 Unported:
Sie dürfen das Werk bzw. den Inhalt zu jedem legalen und nicht-kommerziellen Zweck nutzen, verändern und in unveränderter oder veränderter Form vervielfältigen, verbreiten und öffentlich zugänglich machen, sofern Sie den Namen des Autors/Rechteinhabers in der von ihm festgelegten Weise nennen und das Werk bzw. diesen Inhalt auch in veränderter Form nur unter den Bedingungen dieser Lizenz weitergeben
Identifikatoren
Herausgeber
Erscheinungsjahr
Sprache

Inhaltliche Metadaten

Fachgebiet
Genre
Abstract
Front-end testing with Python [EuroPython 2017 - Talk - 2017-07-10 - PyCharm Room] [Rimini, Italy] Web-developers use Python to develop web-applications, serving HTML or JSON content to user's browsers which render it. We test our applications to check that they serve content right and that they respond to HTTP requests in an expected way. However, this is not all that happens in a modern web application. There are lots of moving parts which are executed not on the server, but directly in user's browser, and they need to be tested too. The best way to check that our app works well in a browser is to test it in a browser, and Python gives you tools to do that conveniently. With a Selenium tool and Python package, you can control the browsers, making them open web pages and interacting with them. I will show how to install Selenium and needed drivers, and tell about best practices for writing Selenium tests, such as Page Object pattern Put browser interactions in the page object, not the test Put assertions in the test, not the page object Never use time.sleep() Always make pages wait for actions to complete Wait for JavaScript to load To test the visual look of your application there is a Needle tool, which lets you compare screenshots with baseline set, and highlight the differences. I will talk about how to incorporate that functionality into your tests. As browser testing can get quite slow, I will also show how to set up running them concurrently