Support » Localhost Installs » E2E Tests – Hello World fails : Timeout

  • Hello,
    I’m trying to run end-to-end tests following the few information I’ve read on Riad Benguella’s post: Introducing the WordPress e2e Tests

    But I’m having a timeout since the very first test. Error message is:

     Hello World › Should load properly
    
        : Timeout - Async callback was not invoked within the 100000ms timeout specified by jest.setTimeout.Timeout - Async callback was not invoked within the 100000ms timeout specified by jest.setTimeout.Error:

    And also:

    Error: Command failed: wp-scripts test-e2e --config tests/e2e/jest.config.js

    The steps were:

    – Clone the WordPress-Develop repository
    – Build the local docker environment: npm run env:start
    – Run the e2e test suite: npm run test:e2e

    My local environment (Ubuntu 18.04) includes:
    – Docker version 19.03.5, build 633a0ea838
    – Node.js v12.13.1
    – npm 6.13.4

    Any idea about what should be going wrong?

    • This topic was modified 7 months, 3 weeks ago by James Huff. Reason: moved to Locahost Installs forum
Viewing 2 replies - 1 through 2 (of 2 total)
  • Tyler

    (@tylerthedude)

    Hi there,

    The timeout needs to be shorter than the default timeout, which is 5000. The timeout can be specified inside the test by adding:

    jest.setTimeout(30000);

    However, this will be specific to this test. You can also set up a configuration file for the framework if you’d like:

    // jest.config.js
    module.exports = {
      // setupTestFrameworkScriptFile has been deprecated in
      // favor of setupFilesAfterEnv in jest 24
      setupFilesAfterEnv: ['./jest.setup.js']
    }
    
    // jest.setup.js
    jest.setTimeout(30000)

    Regards,
    Tyler

    Thank you for your answer @tylerthedude , I’m a bit confused though:

    The timeout needs to be shorter than the default timeout, which is 5000.

    You say “shorter” although your example displays a longer duration (30000 > 5000). Also, the default doesn’t seem to be 5000 but 100000 for me, as the PUPPETEER_TIMEOUT doesn’t seem to be defined and the value taken is the one hardcoded in config/bootstrap.js.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘E2E Tests – Hello World fails : Timeout’ is closed to new replies.