项目作者: MaBlaGit

项目描述 :
Selenium Page Object Pattern example. For learning purposes https://letskodeit.teachable.com/ was used.
高级语言: Python
项目地址: git://github.com/MaBlaGit/SeleniumPageObjectPatternExample.git


Selenium Page Object Pattern Example.

Description:

The aims of this repo is learning Page Object Pattern with Selenium WebDriver and Python.
The implementation base on the https://letskodeit.teachable.com/ webpage.

Tests were implemented and run on:

  • System: Linux Ubuntu 16.04 LTS
  • Browsers: Firefox 54, Chrome 60.0.3112.90
  • Selenium WebDriver: 3.4.3
  • Python: 3.5.2

To Run Tests - Linux Ubuntu way:

1.Clone/Download project: https://github.com/MaBlaGit/SeleniumPageObjectPatternExample

2.Install virtualenvwrapper

  1. $ pip install virtualenvwrapper

3.Run virtualenvwrapper and create hermetic virtualenv for the project

  1. $ source /usr/local/bin/virtualenvwrapper.sh
  2. $ mkvirtualenv --python=/usr/bin.python3.5 name-of-virtualenv
  3. $ workon name-of-virtualenv

4.Go to SeleniumPageObjectPatternExample folder and project to the PYTHONPATH of current active virtualenv

  1. $ add2virtualenv .

5.Install requred modules

  1. $ make deps

6.Download drivers, unpack , make executable and copy to /usr/local/bin:

geckodriver: https://github.com/mozilla/geckodriver/releases

chromedriver: https://sites.google.com/a/chromium.org/chromedriver/

(example below shows how add to path geckodriver)

  1. tar -xvzf geckodriver-v0.11.1-linux64.tar.gz
  2. rm geckodriver-v0.11.1-linux64.tar.gz
  3. chmod +x geckodriver
  4. cp geckodriver /usr/local/bin/

Running tests

In order to run tests go to run_all_tests package, open Terminal and enter command
```
$ python3 run_all_tests.py