-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add mobile UI regression test suite (#15)
Add mobile UI regression test suite and generic group param e.g. ./pixel.js reference --group mobile ./pixel.js reference --group desktop A new set of tests is added for the mobile group with - basic test for anon - basic test for logged in - test for sidebar Co-authored-by: Nicholas Ray <[email protected]>
- Loading branch information
Showing
7 changed files
with
109 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
const config = require( './config.js' ); | ||
|
||
const BASE_URL = process.env.MW_SERVER; | ||
const tests = [ | ||
{ | ||
label: 'Tree (#minerva #mobile)', | ||
path: '/wiki/Tree?useskin=minerva&useformat=mobile' | ||
}, | ||
{ | ||
label: 'Test (#minerva #mobile)', | ||
path: '/wiki/Test?useskin=minerva&useformat=mobile' | ||
}, | ||
{ | ||
label: 'Test (#minerva #mobile #logged-in)', | ||
path: '/wiki/Test?useskin=minerva&useformat=mobile' | ||
}, | ||
{ | ||
label: 'Test (#minerva #mobile #mainmenu-open)', | ||
path: '/wiki/Test?useskin=minerva&useformat=mobile' | ||
}, | ||
{ | ||
label: 'Test (#minerva #mobile #logged-in #mainmenu-open)', | ||
path: '/wiki/Test?useskin=minerva&useformat=mobile' | ||
} | ||
]; | ||
|
||
const scenarios = tests.map( ( test ) => { | ||
return Object.assign( { | ||
selectors: [ 'viewport' ] | ||
}, test, { | ||
url: `${BASE_URL}${test.path}` | ||
} ); | ||
} ); | ||
|
||
module.exports = Object.assign( {}, config, { | ||
scenarios, | ||
paths: Object.assign( {}, config.paths, { | ||
// eslint-disable-next-line camelcase | ||
bitmaps_reference: 'report/reference-screenshots-mobile', | ||
// eslint-disable-next-line camelcase | ||
bitmaps_test: 'report/test-screenshots', | ||
// eslint-disable-next-line camelcase | ||
html_report: 'report/mobile' | ||
} ) | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const menuState = require( '../menuState' ); | ||
|
||
/** | ||
* Open or close Vector-2022's sidebar. | ||
* | ||
* @param {import('puppeteer').Page} page | ||
* @param {string[]} hashtags | ||
*/ | ||
module.exports = async ( page, hashtags ) => { | ||
const isOpen = hashtags.includes( '#mainmenu-open' ); | ||
const isClosed = hashtags.includes( '#mainmenu-closed' ); | ||
|
||
if ( !isOpen && !isClosed ) { | ||
return; | ||
} | ||
|
||
await menuState( page, '#mw-mf-main-menu-button', isClosed ); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters