2 getTestString( prefix
= '' ) {
3 return prefix
+ Math
.random().toString() + '-Iñtërnâtiônàlizætiøn';
7 * Wait for a given module to reach a specific state
8 * @param {string} moduleName The name of the module to wait for
9 * @param {string} moduleStatus 'registered', 'loaded', 'loading', 'ready', 'error', 'missing'
10 * @param {int} timeout The wait time in milliseconds before the wait fails
12 waitForModuleState( moduleName
, moduleStatus
= 'ready', timeout
= 2000 ) {
13 browser
.waitUntil( () => {
14 const result
= browser
.execute( ( module
) => {
15 return typeof mw
!== 'undefined' &&
16 mw
.loader
.getState( module
.name
) === module
.status
;
17 }, { status
: moduleStatus
, name
: moduleName
} );
19 }, timeout
, 'Failed to wait for ' + moduleName
+ ' to be ' + moduleStatus
+ ' after ' + timeout
+ ' ms.' );