2022-03-16 22:26:04 +00:00
|
|
|
// @ts-nocheck
|
2022-05-05 16:02:18 +00:00
|
|
|
const path = require( 'path' );
|
2022-04-07 20:13:17 +00:00
|
|
|
|
|
|
|
const testData = {
|
|
|
|
baseUrl: process.env.MW_SERVER,
|
2022-05-06 19:04:29 +00:00
|
|
|
pageUrl: '/wiki/Polar_bear?useskin=vector-2022&tableofcontents=1',
|
2022-04-07 20:13:17 +00:00
|
|
|
loginUser: process.env.MEDIAWIKI_USER,
|
|
|
|
loginPassword: process.env.MEDIAWIKI_PASSWORD
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = {
|
2022-05-05 16:02:18 +00:00
|
|
|
// LOG_DIR set in CI, used to make report files available in Jenkins
|
|
|
|
reportDir: process.env.LOG_DIR || path.join( process.cwd(), 'a11y/' ),
|
2022-03-16 22:26:04 +00:00
|
|
|
namespace: 'Vector',
|
|
|
|
defaults: {
|
|
|
|
viewport: {
|
|
|
|
width: 1200,
|
|
|
|
height: 1080
|
|
|
|
},
|
|
|
|
runners: [
|
|
|
|
'axe',
|
|
|
|
'htmlcs'
|
|
|
|
],
|
|
|
|
includeWarnings: true,
|
|
|
|
includeNotices: true,
|
2022-06-13 16:57:31 +00:00
|
|
|
hideElements: '#bodyContent, #siteNotice, #mwe-pt-toolbar, #centralnotice, #centralnotice_testbanner',
|
2022-04-07 16:20:42 +00:00
|
|
|
chromeLaunchConfig: {
|
2023-01-24 22:55:35 +00:00
|
|
|
headless: false,
|
2022-04-07 16:20:42 +00:00
|
|
|
args: [
|
|
|
|
'--no-sandbox',
|
|
|
|
'--disable-setuid-sandbox'
|
|
|
|
]
|
|
|
|
}
|
2022-03-16 22:26:04 +00:00
|
|
|
},
|
2022-04-07 20:13:17 +00:00
|
|
|
tests: [
|
|
|
|
{
|
|
|
|
name: 'default',
|
2022-04-15 17:03:21 +00:00
|
|
|
url: testData.baseUrl + testData.pageUrl,
|
2023-01-19 22:47:05 +00:00
|
|
|
actions: []
|
2022-04-07 20:13:17 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'logged_in',
|
2022-04-15 17:03:21 +00:00
|
|
|
url: testData.baseUrl + testData.pageUrl,
|
2022-04-07 20:13:17 +00:00
|
|
|
wait: '500',
|
|
|
|
actions: [
|
|
|
|
'click #p-personal-checkbox',
|
|
|
|
'wait for .vector-user-menu-login a to be visible',
|
|
|
|
'click .vector-user-menu-login a',
|
|
|
|
'wait for #wpName1 to be visible',
|
|
|
|
'set field #wpName1 to ' + testData.loginUser,
|
|
|
|
'set field #wpPassword1 to ' + testData.loginPassword,
|
|
|
|
'click #wpLoginAttempt',
|
2023-01-19 22:47:05 +00:00
|
|
|
'wait for #pt-userpage-2 to be visible' // Confirm login was successful
|
2022-04-07 20:13:17 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'search',
|
2022-04-15 17:03:21 +00:00
|
|
|
url: testData.baseUrl + testData.pageUrl,
|
2022-04-07 20:13:17 +00:00
|
|
|
rootElement: '#p-search',
|
|
|
|
wait: '500',
|
|
|
|
actions: [
|
|
|
|
'click #searchInput',
|
2022-02-01 20:52:16 +00:00
|
|
|
'wait for .cdx-text-input__input to be added',
|
|
|
|
'set field .cdx-text-input__input to Test'
|
2022-04-07 20:13:17 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|