Benedikt Bauer
+ Full-Stack Engineer at Ambient for 3 years
+ Total experience as a developer: ~10 years
+ Currently working with a Team of 5 Devs and using
Django(-Rest-Framework) and ReactJS
+ Ambient is a web agency from Cologne, Germany
building custom webapplications specific to their
customers needs
+ We‘re ~90 employees with the option to work fully remote
+ We‘re hiring, check out our website or get in touch:
https://ambient.digital/menschen/talente/
+ Browser-Testing tool
+ Built by Microsoft
+ Similar to Selenium, Cypress
+ Can run browser tests in Chrome, WebKit
(Safari) and Firefox across all computer
platforms
+ Language bindings for Node, Python, C# and
Java
+ Fast and modern
+ Asynchronous
+ Automated waiting
+ Industry Standard selectors (jest-style)
+ Wide range of browsers supported
+ Can run headless or headed
+ Codegen
+ Batteries included
How does this actually work?
+ Playwright runs in the browser
+ The SDK connects to the browser and tells it what to do
+ Accesses the Browser Console and Network logs
+ Takes Screenshots / Videos
+ Most of the addon features actually run electron apps
Install Playwright (Python)
+ pip install playwright (install the playwright SDK)
+ playwright install (install playwright dependencies – i.e.: Browsers)
(env) C:UsersbenediktDropboxdevelunversionedrealworld [main ≡ +0 ~3 -0 !]> playwright install
Downloading Playwright build of chromium v1000 - 104.6 Mb [====================] 100% 0.0s
Playwright build of chromium v1000 downloaded to C:UsersbenediktAppDataLocalms-playwrightchromium-1000
Downloading Playwright build of firefox v1322 - 75.7 Mb [====================] 100% 0.0s
Playwright build of firefox v1322 downloaded to C:UsersbenediktAppDataLocalms-playwrightfirefox-1322
Downloading Playwright build of webkit v1630 - 56.5 Mb [====================] 100% 0.0s
Playwright build of webkit v1630 downloaded to C:UsersbenediktAppDataLocalms-playwrightwebkit-1630
+ (optional) pip install pytest-playwright (install pytest extension for playwright)
Useful tools for creating tests
+ Test Generator
+ Can record click paths
+ Recording can be paused
+ Can output all supported SDKs
+ Cannot output pytest compatible code
+ Cannot record assertions
Useful Tools for debugging Tests
+ Trace-Viewer
+ Shows all interactions
+ Step-By-Step
+ Full-DOM at time of execution
+ Console, Network, Actions, DOM-Inspector
+ Demo
x
+ Playwright codegen => Generate clickpaths through your application by clicking around in a browser
+ Playwright trace viewer => Playwright can generate a trace of your clickpath (and browser states) and replay that in a local
browser
+ Test reports => Playwright by default generates interactive reports running on a local dev server, but can be configured to
generate plaintext or static HTML reports and many other report types useful for automated evaluation
+ They ship docker images for use in CI Environments
+ By default all Playwright tests run in parallel and async (in Node, async is optional for Python)
+ Documentation is very extensive and expands quickly
+ The built-in Test-Runner is pretty new
Oskar-Jäger-Straße 173
Gebäude K4
50825 Köln
Ambient Innovation: GmbH
Geschäftsführer: Dennis Gilliam, Felix Schul
HR-Nummer: HRB71401 Amtsgericht Köln
USt. ID: DE276570812
benedikt.bauer@ambient.digital

No drama here - E2E-testing django with playwright

  • 2.
    Benedikt Bauer + Full-StackEngineer at Ambient for 3 years + Total experience as a developer: ~10 years + Currently working with a Team of 5 Devs and using Django(-Rest-Framework) and ReactJS + Ambient is a web agency from Cologne, Germany building custom webapplications specific to their customers needs + We‘re ~90 employees with the option to work fully remote + We‘re hiring, check out our website or get in touch: https://ambient.digital/menschen/talente/
  • 3.
    + Browser-Testing tool +Built by Microsoft + Similar to Selenium, Cypress + Can run browser tests in Chrome, WebKit (Safari) and Firefox across all computer platforms + Language bindings for Node, Python, C# and Java
  • 4.
    + Fast andmodern + Asynchronous + Automated waiting + Industry Standard selectors (jest-style) + Wide range of browsers supported + Can run headless or headed + Codegen + Batteries included
  • 5.
    How does thisactually work? + Playwright runs in the browser + The SDK connects to the browser and tells it what to do + Accesses the Browser Console and Network logs + Takes Screenshots / Videos + Most of the addon features actually run electron apps
  • 6.
    Install Playwright (Python) +pip install playwright (install the playwright SDK) + playwright install (install playwright dependencies – i.e.: Browsers) (env) C:UsersbenediktDropboxdevelunversionedrealworld [main ≡ +0 ~3 -0 !]> playwright install Downloading Playwright build of chromium v1000 - 104.6 Mb [====================] 100% 0.0s Playwright build of chromium v1000 downloaded to C:UsersbenediktAppDataLocalms-playwrightchromium-1000 Downloading Playwright build of firefox v1322 - 75.7 Mb [====================] 100% 0.0s Playwright build of firefox v1322 downloaded to C:UsersbenediktAppDataLocalms-playwrightfirefox-1322 Downloading Playwright build of webkit v1630 - 56.5 Mb [====================] 100% 0.0s Playwright build of webkit v1630 downloaded to C:UsersbenediktAppDataLocalms-playwrightwebkit-1630 + (optional) pip install pytest-playwright (install pytest extension for playwright)
  • 8.
    Useful tools forcreating tests + Test Generator + Can record click paths + Recording can be paused + Can output all supported SDKs + Cannot output pytest compatible code + Cannot record assertions
  • 9.
    Useful Tools fordebugging Tests + Trace-Viewer + Shows all interactions + Step-By-Step + Full-DOM at time of execution + Console, Network, Actions, DOM-Inspector + Demo
  • 10.
    x + Playwright codegen=> Generate clickpaths through your application by clicking around in a browser + Playwright trace viewer => Playwright can generate a trace of your clickpath (and browser states) and replay that in a local browser + Test reports => Playwright by default generates interactive reports running on a local dev server, but can be configured to generate plaintext or static HTML reports and many other report types useful for automated evaluation + They ship docker images for use in CI Environments + By default all Playwright tests run in parallel and async (in Node, async is optional for Python) + Documentation is very extensive and expands quickly + The built-in Test-Runner is pretty new
  • 11.
    Oskar-Jäger-Straße 173 Gebäude K4 50825Köln Ambient Innovation: GmbH Geschäftsführer: Dennis Gilliam, Felix Schul HR-Nummer: HRB71401 Amtsgericht Köln USt. ID: DE276570812 benedikt.bauer@ambient.digital