Skip to content

Latest commit

 

History

History
40 lines (30 loc) · 1.35 KB

README.rst

File metadata and controls

40 lines (30 loc) · 1.35 KB

Unit testing

Requirements

Before running the test, install the dependencies:

pip install -r requirements-dev.txt

Unit Tests

Units tests are written by using the pytest framework. Unit test can be executed by running:

python utest/run.py

The utest directory contains everything needed to run SeleniumLibrary unit tests. This includes:

  • Unit test in test folder.
  • Unit test runner: run.py

Unit test are executed using the interpreter which starts the run.py script.

ApprovalTests

For unit test, it is possible to use ApprovalTests framework. ApprovalTests provides an easy and visual way to compare strings in unit tests. For more details, please read ApprovalTests documentation and ApprovalTests blog post.

The downside of ApprovalTests is that SeleniumLibrary is mainly developed in Linux and therefore unit tests using ApprovalTests are skipped in Windows OS. This needs to be done until ApprovalTests issue #41 is fixed. To skip tests, mark test as: @unittest.skipIf(WINDOWS, reason='ApprovalTest do not support different line feeds')