Skip to content

Latest commit

 

History

History
63 lines (45 loc) · 3.44 KB

course_python_for_testing.md

File metadata and controls

63 lines (45 loc) · 3.44 KB

Python for Testing

Length: 2 days, in four half-day chunks spread over 2 months

Script things of value for testing purposes or write test automation in python. Focus on practical knowledge and learning by doing. Set up a programming environment, work with logs, programmatically drive interfaces, set up reusable structures for your tests and generate test data.

There are many python courses out there that teach language constructs and problem solving. What testers need though is applying that programming knowledge on problems in the testing domain. For growing programming skills, testing is a brilliant domain for a learner. You can do basic things of value by solidifying basic understanding, and there is no limit to how far you can grow in applying programming to build test systems of the future. For this course, we build that solid foundation of basic valuable things, in context of doing. We will do hands-on learning with code along, pair programming and ensemble programming to create and solidify understanding on python for testing problems. Since this course teaches you Python, we start with a minimal number of frameworks on top of it and grow tools as libraries of the ecosystem as we move along.

You don't have to know how to program before. It does not hurt if you know how to program before. This course runs with the idea that after you have written a line of code, you are a programmer. Saying that only means there is a lifetime of more learning ahead of you, and we can pick up a common learning path wherever you are on yours now.

This course runs as four half-day (3.5 hours) sessions, with two weeks between sessions. We need participants to commit to the series of four, the session will stand on the previous session's lessons. Between sessions, we will have homework of reflections/actions - small things to apply lessons in your work.

Teaching is done with code along, taking turns on sharing screens in remote setup. This is to ensure all participants get to a place where they can do the actions on their own computers.

Four Half-Day sessions are:

  • Getting Started with Testing in Python
  • Use of Python to Test on APIs
  • Web Testing and Structure of Tests
  • Extending your Python Testing Capability

Keywords

  • Git, Visual Studio Code, plugins, Pytest, Fixtures, Refactoring, Requests, Selenium, Playwright, Page Objects, Soft Asserts, Approvals, Hypothesis, JSON and CSV data, file and string manipulation, Allure, Docker, PR reviews, Github pipelines, PyTest-BDD, Robot Framework, tox 

Session 1: Getting started with testing in Python

  • Python 3, Visual Studio Code, PyTest, minimal anatomy of a function vs. test function
  • Installing dependencies with pip + requirements.txt
  • Git, fork/clone, commit and merge requests
  • Log manipulation for errors
  • Requests GET 200 OK
  • Assert for success and for exception
  • Operating system differences in code

Session 2: Use of Python to test on APIs

  • Requests GET, basic authentication and POST
  • Return codes
  • Fixtures
  • Asserts, Approvals, Soft Asserts
  • Parametrized tests
  • JSON and CSV data
  • Tox and Python versions

Session 3: Web testing and structure of tests

  • WebUI Testing with Selenium / Playwright
  • More fixtures
  • Selectors
  • Refactoring to Page Object Model
  • Generating test data
  • Run in container in pipeline

Session 4: Extending your python testing capability

  • PyTest-BDD
  • Hypothesis
  • Windows drivers: flaui
  • Reporting framework: Allure
  • aXe
  • Pipenv and poetry
  • Robot Framework