Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UI tests for galleries to Minerva and Vector 2022 #226

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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-11-17_12-14-53-0800(PST).tar.gz"
ARG database="database_2023-12-01_12-22-34-0800(PST).tar.gz"

RUN apt-get update && apt-get install -y \
curl \
Expand Down
5 changes: 5 additions & 0 deletions configDesktop.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ const tests = [
VIEWPORT_DESKTOP_WIDEST
]
},
{
// Gallery JS causes reflows so restricted to JS disabled (T242143)
label: 'Galleries (#vector-2022 #js-disabled)',
path: '/wiki/Gallery_test_page'
},
//
// Legacy Vector
//
Expand Down
5 changes: 5 additions & 0 deletions configMobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ const tests = [
{
label: 'Switch to mobile (#minerva #mobile #logged-in #click[id=mw-mf-display-toggle])',
path: '/wiki/User:Echo100'
},
{
// Gallery JS causes reflows so restricted to JS disabled (T242143)
label: 'Galleries (#minerva #mobile #js-disabled)',
path: '/wiki/Gallery_test_page'
}
];

Expand Down
3 changes: 3 additions & 0 deletions src/engine-scripts/puppet/onBefore.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ module.exports = async ( page, scenario ) => {
if ( requireLogin ) {
await require( './loadCookies' )( page, getUsernameFromHashtags( hashtags ) );
}
if ( hashtags.includes( '#js-disabled' ) ) {
await page.setJavaScriptEnabled( false );
}
};
5 changes: 5 additions & 0 deletions src/engine-scripts/puppet/onReady.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ module.exports = async ( page, scenario ) => {
const label = scenario.label;
const hashtags = label.match( /(#[^ ,)]*)/g ) || [];

// Cannot do any further checks if js is disabled.
if ( hashtags.includes( '#js-disabled' ) ) {
return;
}

// Make sure the main skin JavaScript module has loaded.
await require( './jsReady' )( page, hashtags );

Expand Down
Loading