Skip to content

Commit

Permalink
Add a browser test for mobile page issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jdlrobson committed Jul 27, 2023
1 parent 77e52c6 commit dfa37a0
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.database
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
5 changes: 4 additions & 1 deletion LocalSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions configMobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
];

Expand Down
2 changes: 1 addition & 1 deletion src/engine-scripts/puppet/minerva/clickBtn.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
};
21 changes: 21 additions & 0 deletions src/makeReportIndex.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const fs = require( 'fs' );

function makeReport( directory, html ) {
const docHTML = `<!DOCTYPE HTML>
<html>
<head>
<title>UI regression reports</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes, minimum-scale=0.25, maximum-scale=5.0"/>
</head>
<body>
<h1>UI regression reports</h1>
<ul>
${html}
</ul>
</body>
</html>
`;
fs.writeFileSync( directory, docHTML );
}

module.exports = makeReport;

0 comments on commit dfa37a0

Please sign in to comment.