CodeceptJS v3.3.0 Release Notes

  • πŸ›©οΈ Features:

    • βœ… API Testing introduced
      • Introduced JSONResponse helper which connects to REST, GraphQL or Playwright helper
      • [REST] Added amBearerAuthenticated method
      • [REST] Added haveRequestHeaders method
      • Added dependency on joi and chai
    • 0️⃣ [Playwright] Added timeout option to set timeout for all Playwright actions. If an action fails, Playwright keeps retrying it for a time set by timeout.
    • [Playwright] Possible breaking change. By default timeout is set to 1000ms. Previous default was set by Playwright internally to 30s. This was causing contradiction to CodeceptJS retries, so triggered up to 3 retries for 30s of time. This timeout option was lowered so retryFailedStep plugin would not cause long delays.
    • ⚑️ [Playwright] Updated restart config option to include 3 restart strategies:
      • 'context' or false - restarts browser context but keeps running browser. Recommended by Playwright team to keep tests isolated.
      • 'browser' or true - closes browser and opens it again between tests.
      • 'session' or 'keep' - keeps browser context and session, but cleans up cookies and localStorage between tests. The fastest option when running tests in windowed mode. Works with keepCookies and keepBrowserState options. This behavior was default prior CodeceptJS 3.1
    • ⚑️ [Playwright] Extended methods to provide more options from engine. These methods were updated so additional options can be be passed as the last argument:
    // use Playwright click options as 3rd argument
    I.click('canvas', '.model', { position: { x: 20, y: 40 } })
    // check option also has options
    I.checkOption('Agree', '.signup', { position: { x: 5, y: 5 } })
    
    • πŸ”Œ eachElement plugin introduced. It allows you to iterate over elements and perform some action on them using direct engines API
    await eachElement('click all links in .list', '.list a', (el) => {
      await el.click();
    })
    
    • πŸ‘€ [Playwright] Added support to playwright-core package if playwright is not installed. See #3190, fixes #2663.
    • [Playwright] Added makeApiRequest action to perform API requests. Requires Playwright >= 1.18
    • βž• Added support to codecept.config.js for name consistency across other JS tools. See motivation at #3195 by @JiLiZART
    • πŸ‘€ [ApiDataFactory] Added options arg to have method. See #3197 by @JJlokidoki
    • πŸ‘Œ Improved pt-br translations to include keywords: 'Funcionalidade', 'CenΓ‘rio', 'Antes', 'Depois', 'AntesDaSuite', 'DepoisDaSuite'. See #3206 by @danilolutz
    • πŸ‘€ [allure plugin] Introduced addStep method to add comments and attachments. See #3104 by @EgorBodnar

    πŸ›  πŸ› Bugfixes:

    • πŸ›  Fixed #3212: using Regex flags for Cucumber steps. See #3214 by @anils92

    πŸ“š πŸ“– Documentation

    • βž• Added Testomat.io reporter
    • βž• Added api testing guides
    • βž• Added internal api guides
    • πŸ“š [Appium] Fixed documentation for performSwipe
    • ⚑️ [Playwright] update docs for usePlaywrightTo method by @dbudzins