wdio-mediawiki 2.7.0 → 2.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -34,7 +34,7 @@ function filePath( title, extension ) {
34
34
  *
35
35
  * @since 1.0.0
36
36
  * @param {string} title Description (will be sanitised and used as file name)
37
- * @return {string} File path
37
+ * @return {Promise<string>} File path
38
38
  */
39
39
  async function saveScreenshot( title ) {
40
40
  // Create sensible file name for current test title
@@ -71,6 +71,9 @@ function startVideo( ffmpeg, title ) {
71
71
  '-pix_fmt', 'yuv420p', // QuickTime Player support, "Use -pix_fmt yuv420p for compatibility with outdated media players"
72
72
  videoPath // output file
73
73
  ] );
74
+ ffmpeg.on( 'error', () => {
75
+ console.log( 'Not recording a video because ffmpeg is not available' );
76
+ } );
74
77
  const logBuffer = function ( buffer, prefix ) {
75
78
  const lines = buffer.toString().trim().split( '\n' );
76
79
  lines.forEach( ( line ) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wdio-mediawiki",
3
- "version": "2.7.0",
3
+ "version": "2.7.1",
4
4
  "description": "WebdriverIO plugin for testing a MediaWiki site.",
5
5
  "homepage": "https://gerrit.wikimedia.org/g/mediawiki/core/+/master/tests/selenium/wdio-mediawiki",
6
6
  "license": "MIT",
@@ -22,6 +22,22 @@ if ( !process.env.MW_SERVER || !process.env.MW_SCRIPT_PATH ) {
22
22
  throw new Error( 'MW_SERVER or MW_SCRIPT_PATH not defined.\nSee https://www.mediawiki.org/wiki/Selenium/How-to/Set_environment_variables\n' );
23
23
  }
24
24
 
25
+ process.on( 'uncaughtException', ( error ) => {
26
+ console.error( 'Caught uncaughtException: ', error );
27
+ // eslint-disable-next-line n/no-process-exit
28
+ process.exit( 1 );
29
+ } );
30
+
31
+ process.on( 'unhandledRejection', ( reason, promise ) => {
32
+ console.log( 'Unhandled Rejection at:', promise, 'reason:', reason );
33
+ } );
34
+
35
+ [ 'SIGINT', 'SIGTERM' ].forEach( ( signal ) => process.on( signal, () => {
36
+ // eslint-disable-next-line no-underscore-dangle
37
+ console.log( `Received ${ signal }. Active handles:`, process._getActiveHandles() );
38
+ } )
39
+ );
40
+
25
41
  /**
26
42
  * For more details documentation and available options:
27
43
  * - https://webdriver.io/docs/configurationfile
@@ -65,8 +81,8 @@ exports.config = {
65
81
  // Dismissed Chrome's `Save password?` popup
66
82
  '--enable-automation',
67
83
  ...( process.env.DISPLAY ? [] : [ '--headless' ] ),
68
- // Chrome sandbox does not work in Docker
69
- ...( fs.existsSync( '/.dockerenv' ) ? [ '--no-sandbox' ] : [] ),
84
+ // Chrome sandbox does not work in Docker. Disable GPU to prevent crashes (T389536#10677201)
85
+ ...( fs.existsSync( '/.dockerenv' ) ? [ '--no-sandbox', '--disable-gpu' ] : [] ),
70
86
  // Workaround inputs not working consistently post-navigation on Chrome 90
71
87
  // https://issuetracker.google.com/issues/42322798
72
88
  '--allow-pre-commit-input'