Skip to content

Tests

Puppeteer (Automated Tests)

Install puppeteer. (Requires node.js to be installed first.)

Note

Run this command in the Git bash terminal, not the default Windows CMD.exe

cd "sgc_wordpress\wp-content\plugins\sgc-functions\puptest"
npm i puppeteer

In the sgc-functions\puptest folder are some node scripts for running puppeteer against the website and checking things like checkout, popup form submissions, etc.

Run the tests with this command: 

node tests.mjs

Playwright (for Safari testing)

To test a page in Webkit/Safari if you don't own an Apple device, follow this guide to install and use Playwright. Then 

npm run test:safari

https://sgcdev.abc/wp-content/plugins/sgc-functions/tests/tests.html is a PHP test that just checks status codes and CF cache status for now.

Performance Tests

Check worldwide speeds (requires a login) and a quick global TTFB test.

Check performance over time:

(We have to compare both, because we switched from www to non-www, so data is incomplete)

Use this site to compare 2 version of a website: https://pagespeed.compare/

Pagespeed Tests

There is a cron job in hPanel as follows:

0 0,12 * * * /usr/bin/php /home/u159938358/domains/shepherdsglobal.org/public_html/pagespeed/urkeadhiemad5.php

This is called daily to check the pagespeed and record the results into an sqlite database.

Use this JSON tree editor to easily find the data in the JSON response that you want to log.
Quickly preview the DB at: https://shepherdsglobal.org/pagespeed/database84.php

Use the following .htaccess file to make sure that db is not publicly accessible:

order allow,deny
deny from all
allow from 174.30.53.136