MySQL (OPTIONAL)
(NOTE: If you don't plan on using the SeleniumBase MySQL DB feature, then you can skip this section.)
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE IF NOT EXISTS test_db;' -uroot -proot
wget https://raw.githubusercontent.com/seleniumbase/SeleniumBase/master/seleniumbase/core/create_db_tables.sql
sudo mysql -h 127.0.0.1 -uroot -proot test_db < create_db_tables.sql
sudo mysql -e 'ALTER USER "root"@"localhost" IDENTIFIED BY "test";' -uroot -proot
sudo service mysql restartHave SeleniumBase tests write to the MySQL DB:
pytest --with-db_reportingQuery MySQL DB Results:
mysql -e 'select test_address,browser,state,start_time,runtime from test_db.test_run_data;' -uroot -ptestsudo apt update
sudo apt install mysql-server
sudo mysql_secure_installation
sudo mysql -e 'CREATE DATABASE IF NOT EXISTS test_db;'
sudo mysql -h 127.0.0.1 -u root test_db < seleniumbase/core/create_db_tables.sql
sudo service mysql restartTo change the password from root to test:
mysqladmin -u root -p'root' password 'test'
sudo service mysql restartbrew install mysqlThen start the MySQL service:
brew services start mysql(Continue with additional steps below to set up your DB.)
Download MySQL here Follow the steps from the MySQL Downloads page.
(Continue with additional steps below to set up your DB.)
If you want a visual tool to help make your MySQL life easier, try MySQL Workbench.
Use the create_db_tables.sql file to create the necessary tables for storing test data.
Update your settings.py file with your MySQL DB credentials so that tests can write to the database when they run.
Add the --with-db_reporting argument on the command-line when you want tests to write to your MySQL database. Example:
pytest --with-db_reporting