the script depends on the packages:
- Install Python3 & pip
- The commands to install through terminal
python3 -m venv venvsource venv/bin/activateyou also need to install libraries gspread before running the script.
you can install by these commands:
pip install gspread oauth2clientyou also need to install a tool lighthouse before running the script.
you can install by these commands:
brew install nodenpm install -g lighthouselighthouse 'url'- Make sure to log in througyh the service account
- The Spreadsheet has 3 sheets for the test results of the priority pages (Homepgage, Participation Page, and Report Page)
- https://docs.google.com/spreadsheets/d/1JXuXckkMHYdU8BmTRpWBOVHUKv5YQC5Wg6dBjtkJmLY/edit?usp=sharing
- Go to Google Cloud Console
- Enable the Google Sheets API (default: it's always on)
- Download the credentials.json file from IAM Page
- In
upload2googlesheets.py, there are 3 config you need to set before running the script CREDENTIALS_FILE: The path to the json file downloaded from Google Cloud Console (IAM page)SHEET_ID: copy it from the url to the Google sheet you are writing toCSV_PATH: the path to the output ofconvert2CSV.py
python3 upload2googlesheets.pycrontab -e0 2 * * * /path/to/venv/bin/python3 /path/to/upload2googlesheets.pyThe test has already been automated to run by 2 AM every day
- Open the Google Sheet to check the uploaded data.