From dfa37a097a13cf5e03c9af97e33f9126cd7cba4a Mon Sep 17 00:00:00 2001 From: Jon Robson Date: Thu, 27 Jul 2023 12:54:13 -0700 Subject: [PATCH] Add a browser test for mobile page issues --- Dockerfile.database | 2 +- LocalSettings.php | 5 ++++- configMobile.js | 4 ++++ src/engine-scripts/puppet/minerva/clickBtn.js | 2 +- src/makeReportIndex.js | 21 +++++++++++++++++++ 5 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 src/makeReportIndex.js diff --git a/Dockerfile.database b/Dockerfile.database index 4615097e..5782df3f 100644 --- a/Dockerfile.database +++ b/Dockerfile.database @@ -2,7 +2,7 @@ FROM mariadb:10.6.7 COPY src/seedDb.sh /docker-entrypoint-initdb.d/ -ARG database="database_2023-02-03_17-35-51-0600(CST).tar.gz" +ARG database="database_2023-07-27_12-02-01-0700(PDT).tar.gz" RUN apt-get update && apt-get install -y \ curl \ diff --git a/LocalSettings.php b/LocalSettings.php index 2ea85463..1bf9b642 100644 --- a/LocalSettings.php +++ b/LocalSettings.php @@ -88,7 +88,7 @@ $wgImageMagickConvertCommand = "/usr/bin/convert"; # InstantCommons allows wiki to use images from https://commons.wikimedia.org -$wgUseInstantCommons = false; +$wgUseInstantCommons = true; # Periodically send a pingback to https://www.mediawiki.org/ with basic data # about this MediaWiki instance. The Wikimedia Foundation shares this data @@ -179,6 +179,9 @@ 'manualRecache' => false, ]; +// Shortcut for thanking. +$wgThanksSendToBots = true; + # Content Provider used to show articles from enwiki. Can be helpful when trying to see how # production articles look locally, but be aware that there are some gotchas # with using this that don't perfectly match the production environment. Use at diff --git a/configMobile.js b/configMobile.js index 58a0be2c..202ba78a 100644 --- a/configMobile.js +++ b/configMobile.js @@ -54,6 +54,10 @@ const tests = [ { label: 'Diff page logged in (#minerva #mobile #logged-in)', path: '/wiki/Special:MobileDiff/335' + }, + { + label: 'Page issues (#minerva #mobile)', + path: '/wiki/Page_issue' } ]; diff --git a/src/engine-scripts/puppet/minerva/clickBtn.js b/src/engine-scripts/puppet/minerva/clickBtn.js index e3ad5352..0242f415 100644 --- a/src/engine-scripts/puppet/minerva/clickBtn.js +++ b/src/engine-scripts/puppet/minerva/clickBtn.js @@ -7,7 +7,7 @@ module.exports = async ( page, selector ) => { await page.evaluate( async ( s ) => { const btn = document.querySelector( s ); - await btn.click(); + btn.click(); }, selector ); await page.waitForSelector( '.drawer,.overlay' ); }; diff --git a/src/makeReportIndex.js b/src/makeReportIndex.js new file mode 100644 index 00000000..68b69eaf --- /dev/null +++ b/src/makeReportIndex.js @@ -0,0 +1,21 @@ +const fs = require( 'fs' ); + +function makeReport( directory, html ) { + const docHTML = ` + + + UI regression reports + + + +

UI regression reports

+ + + +`; + fs.writeFileSync( directory, docHTML ); +} + +module.exports = makeReport;