This is a front end workflow testing script. This relies on chrome webdriver & Splinter
It runs several ingestion tests that create a variety of submissions while inputting a random assortment of fields from a random array of options. In other words it's testing as many combinations as it can to test if something will break the stack. The extended_test folder has an assortment of PDFs in a variety of PDF Color Space and Resolutions.
Add 2 users to islandora
- Username: userA
- Password: userA
- Username: userB
- Password: userB
Required: chrome-driver, splinter, lorem
WINDOWS 10 install Video Tutorial Chrome-Driver
- Create a folder
c:\webdrivers
- System Properties > Advanced System Settings > Environment Variables > System Variables > Path > Edit > New
- c:\webdrivers
- Click OK/OK/OK
- Go to and download "Latest Release" > chromedriver_win32.zip
- Zip will extract to a single executable file 'chromedriver'
- Extract file to "c:\webdrivers/chromedriver"
- To test install open a command terminal and type
chromedriver
and it should start and pressctrl c
to quit test.
Chrome WebDriver is provided by Selenium2. To use it, you need to install Selenium2 via pip
$ [sudo] pip install selenium
It’s important to note that you also need to have Google Chrome installed in your machine.
$ brew cask install chromedriver
ChromeDriver install for macOS
ChromeDriver install for FreeBSD
ChromeDriver install for Windows 10
ChromeDriver install for Ubuntu
Please note that if you prefer to use Firefox you will need to install Gekodriver
How to setup Splinter
$ pip install splinter
$ pip install lorem
$ pip install pipenv
# this installs the modules
$ pipenv sync
Using `pipenv install` instead or `pipenv update` if you've already run this once as alternatives. Sometime deleting the Pipfile.lock in this directory will help to reset pipenv.
# this starts the python environment (optional and not suggested)
$ pipenv shell
# To start the script
$ pipenv run python submit.py
To exit pipenv just type (for using with pipenv shell)
$ exit
Use the 'SET config section'
########### SET config section ###########
# Set IMAGE: File path(s) need to be absolute
supplimental_file = dir_path + '/Example_ETD.jpg'
# Set PDF: Folder to look for pdfs (this current folder for PDFs)
path_to_PDFs = (dir_path)
# Set URL: (this works for islandora_vagrant)
url = "http://localhost:8000/user/"
# Set number of submissions to test: (anything under 3 will default to 3)
how_many_submissions_to_submit = 0
username = 'userB'
password = 'userB'
str1 = ''
########### END SET config section ########
supplimental_file
Set to current directory image file
path_to_PDFs
This will randomly select any one of the PDFs in this directory and use it to submit.
url
This is the URL for a page to trigger logging in. Using the 'user' page is ideal.
how_many_submissions_to_submit
This is how many times you want the script to submit an ETD.
Just restart the script and it will work.