Skip to content

Project to demonstrate my automated testing skills in Python. This code runs Selenium-based test cases against a local Wordpress test site. A port to Python of my wp-test-demo-java-selenium repo.

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.

wp-test-demo-python

Project to demonstrate my automated testing skills in Python.

This suite of test cases runs Selenium-based test cases against a test Wordpress site. It's a port to Python of my project in the wp-test-demo-java-selenium repo.

Prerequisites

As with the Java version of this project, I'm running these test cases against Docker containers that run a Wordpress test site, the MySQL database that powers it, and a Selenium grid. The Docker Compose yaml file I'm using to run these containers can be found in my misc-configs repo, along with an export of the test data I'm using for the Wordpress site.

The test data I'm using is a copy of one of my live Wordpress sites, which has provided me the items to fill in for my WPTestLib helper class. (Which is, in turn, a port of the properties file from the Java version of this project.)

The main tool I'm using to run the suite is PyCharm, and the version of Python I'm working with is 3.7. I'm using Nosetests as the test runner, as that's what I used in my prior experience on my last day job, and PyCharm supports it.

Overall, I'm setting up this suite in Python similarly to how I wrote similar test suites on my previous day job.

Skills and tech I'm demonstrating here

  • Use of a helper class to set test-specific strings like ID numbers, titles, and names
  • Using Nose functionality to run the test suite, and to annotate test methods
  • Use of the @property decorator for a method
  • Selenium webdriver click events in the Menu and Submenu test cases
  • Use of action chains to do hover events over specific elements in the Submenu test cases
  • Use of support classes to dictate page layout so I can shorten actual test cases
  • Testing against a site running as a Docker container

Why Nose?

I'm aware that the original version of Nose is in maintenance mode, and its docs do encourage people to use Nose2 instead. For the time being, though, I'm using Nose as that's what I'm most immediately familiar with. Time permitting, I'll be updating this suite to use Nose2.

Running the code on a Linux environment

This code has been successfully most recently run against PyCharm Community Edition 2020.1.2, on an Ubuntu Linux install (Ubuntu 20.04 LTS) with Python version 3.8 installed.

Reference links

About

Project to demonstrate my automated testing skills in Python. This code runs Selenium-based test cases against a local Wordpress test site. A port to Python of my wp-test-demo-java-selenium repo.

Resources

Releases

No releases published

Packages

No packages published

Languages