Skip to content

Releases: codeceptjs/CodeceptJS

3.7.4

19 Aug 12:16
Compare
Choose a tag to compare

3.7.4

❤️ Thanks all to those who contributed to make this release! ❤️

🛩️ Features

  • Test Suite Shuffling: Randomize test execution order to discover test dependencies and improve test isolation (#5051) - by @NivYarmus

    # Shuffle tests to find order-dependent failures using lodash.shuffle algorithm
    npx codeceptjs run --shuffle
    
    # Combined with grep and other options
    npx codeceptjs run --shuffle --grep "@smoke" --steps
  • Enhanced Interactive Debugging: Better logging for I.grab* methods in live interactive mode for clearer debugging output (#4986) - by @owenizedd

    // Interactive pause() now shows detailed grab results with JSON formatting
    I.amOnPage('/checkout')
    pause()  // Interactive shell started
    > I.grabTextFrom('.price')
    Result $res= "Grabbed text: $29.99"  // Pretty-printed JSON output
    > I.grabValueFrom('input[name="email"]')
    {"value":"[email protected]"}  // Structured JSON response

    🐛 Bug Fixes

  • Playwright Session Traces: Fixed trace file naming convention and improved error handling for multi-session test scenarios (#5073) - by @julien-ft-64 @kobenguyent

    // Example outputs:
    // - a1b2c3d4-e5f6_checkout_login_test.failed.zip
    // - b2c3d4e5-f6g7_admin_dashboard_test.failed.zip

    Trace files use UUID prefixes with sessionName_testTitle.status.zip format

  • Worker Data Injection: Resolved proxy object serialization preventing data sharing between parallel test workers (#5072) - by @kobenguyent

    // Fixed: Complex objects can now be properly shared and injected between workers
    // Bootstrap data sharing in codecept.conf.js:
    exports.config = {
      bootstrap() {
        share({
          userData: { id: 123, preferences: { theme: 'dark' } },
          apiConfig: { baseUrl: 'https://api.test.com', timeout: 5000 },
        })
      },
    }
    
    // In tests across different workers:
    const testData = inject()
    console.log(testData.userData.preferences.theme) // 'dark' - deep nesting works
    console.log(Object.keys(testData)) // ['userData', 'apiConfig'] - key enumeration works
    
    // Dynamic sharing during test execution:
    share({ newData: 'shared across workers' })
  • Hook Exit Codes: Fixed improper exit codes when test hooks fail, ensuring CI/CD pipelines properly detect failures (#5058) - by @kobenguyent

    # Before: Exit code 0 even when beforeEach/afterEach failed
    # After: Exit code 1 when any hook fails, properly failing CI builds
  • TypeScript Effects Support: Added complete TypeScript definitions for effects functionality (#5027) - by @kobenguyent

    // Import effects with full TypeScript type definitions
    import { tryTo, retryTo, within } from 'codeceptjs/effects'
    
    // tryTo returns Promise<boolean> for conditional actions
    const success: boolean = await tryTo(async () => {
      await I.see('Cookie banner')
      await I.click('Accept')
    })
    
    // retryTo with typed parameters for reliability
    await retryTo(() => {
      I.click('Submit')
      I.see('Success')
    }, 3) // retry up to 3 times

    Note: Replaces deprecated global plugins - import from 'codeceptjs/effects' module

  • Mochawesome Screenshot Uniqueness: Fixed screenshot naming to prevent test failures from being overwritten when multiple tests run at the same time (#4959) - by @Lando1n

    // Problem: When tests run in parallel, screenshots had identical names
    // This caused later test screenshots to overwrite earlier ones
    
    // Before: All failed tests saved as "screenshot.png"
    // Result: Only the last failure screenshot was kept
    
    // After: Each screenshot gets a unique name with timestamp
    // Examples:
    // - "login_test_1645123456.failed.png"
    // - "checkout_test_1645123789.failed.png"
    // - "profile_test_1645124012.failed.png"
    
    // Configuration in codecept.conf.js:
    helpers: {
      Mochawesome: {
        uniqueScreenshotNames: true // Enable unique naming
      }
    }

    Ensures every failed test keeps its own screenshot for easier debugging

📖 Documentation

  • Fixed Docker build issues and improved container deployment process (#4980) - by @thomashohn
  • Updated dependency versions to maintain security and compatibility (#4957, #4950, #4943) - by @thomashohn
  • Fixed automatic documentation generation system for custom plugins (#4973) - by @Lando1n

New Contributors

Full Changelog: 3.7.3...3.7.4

3.7.3

19 Mar 10:06
233838e
Compare
Choose a tag to compare

3.7.3

❤️ Thanks all to those who contributed to make this release! ❤️

🛩️ Features

  • feat(cli): improve info command to return installed browsers (#4890) - by @kobenguyent
➜  helloworld npx codeceptjs info
Environment information:

codeceptVersion:  "3.7.2"
nodeInfo:  18.19.0
osInfo:  macOS 14.4
cpuInfo:  (8) x64 Apple M1 Pro
osBrowsers:  "chrome: 133.0.6943.143, edge: 133.0.3065.92, firefox: not installed, safari: 17.4"
playwrightBrowsers:  "chromium: 133.0.6943.16, firefox: 134.0, webkit: 18.2"
helpers:  {
"Playwright": {
"url": "http://localhost",
...

🐛 Bug Fixes

  • fix: resolving path inconsistency in container.js and appium.js (#4866) - by @mjalav
  • fix: broken screenshot links in mochawesome reports (#4889) - by @kobenguyent
  • some internal fixes to make UTs more stable by @thomashohn
  • dependencies upgrades by @thomashohn

New Contributors

Full Changelog: 3.7.2...3.7.3

3.7.2

12 Feb 08:09
52b6e74
Compare
Choose a tag to compare

3.7.2

❤️ Thanks all to those who contributed to make this release! ❤️

🛩️ Features

  • feat(playwright): Clear cookie by name (#4693) - by @ngraf

🐛 Bug Fixes

  • fix(stepByStepReport): no records html is generated when running with run-workers (#4638)
  • fix(webdriver): bidi error in log with webdriver (#4850)
  • fix(types): TS types of methods (Feature|Scenario)Config.config (#4851)
  • fix: redundant popup log (#4830)
  • fix(webdriver): grab browser logs using bidi protocol (#4754)
  • fix(webdriver): screenshots for sessions (#4748)

📖 Documentation

3.6.10

11 Dec 09:50
5abda10
Compare
Choose a tag to compare

What's Changed

  • fix(cli): missing failure counts when there is failedHooks by @kobenguyent in #4633

Full Changelog: 3.6.9...3.6.10

3.6.9

10 Dec 13:52
Compare
Choose a tag to compare

What's Changed

3.6.8

❤️ Thanks all to those who contributed to make this release! ❤️

🛩️ Features

export const config: CodeceptJS.MainConfig = {
  tests:  '**/*.e2e.test.ts',
  retry: 4,
  output: './output',
  maskSensitiveData: true,
  emptyOutputFolder: true,
...

    I login {"username":"[email protected]","password": "****"}
      I send post request "https://localhost:8000/login", {"username":"[email protected]","password": "****"}
      › [Request] {"baseURL":"https://localhost:8000/login","method":"POST","data":{"username":"[email protected]","password": "****"},"headers":{}}
      › [Response] {"access-token": "****"}
I.sendDeleteRequestWithPayload('/api/users/1', { author: 'john' });

🐛 Bug Fixes

  • fix(playwright): Different behavior of see* and waitFor* when used in within (#4557) - by @kobenguyent
  • fix(cli): dry run returns no tests when using a regex grep (#4608) - by @kobenguyent
> codeceptjs dry-run --steps --grep "(?=.*Checkout process)"
  • fix: Replace deprecated faker.name with faker.person (#4581) - by @thomashohn
  • fix(wdio): Remove dependency to devtools (#4563) - by @thomashohn
  • fix(typings): wrong defineParameterType (#4548) - by @kobenguyent
  • fix(typing): Locator.build complains the empty locator (#4543) - by @kobenguyent
  • fix: add hint to I.seeEmailAttachment treats parameter as regular expression (#4629) - by @ngraf
Add hint to "I.seeEmailAttachment" that under the hood parameter is treated as RegExp. 
When you don't know it, it can cause a lot of pain, wondering why your test fails with I.seeEmailAttachment('Attachment(1).pdf') although it looks just fine, but actually I.seeEmailAttachment('Attachment\\(1\\).pdf is required to make the test green, in case the attachment is called "Attachment(1).pdf" with special character in it.

📖 Documentation

New Contributors

Full Changelog: 3.6.6...3.6.9

3.6.8

10 Dec 12:56
ec40b1e
Compare
Choose a tag to compare

What's Changed

3.6.8

❤️ Thanks all to those who contributed to make this release! ❤️

🛩️ Features

export const config: CodeceptJS.MainConfig = {
  tests:  '**/*.e2e.test.ts',
  retry: 4,
  output: './output',
  maskSensitiveData: true,
  emptyOutputFolder: true,
...

    I login {"username":"[email protected]","password": "****"}
      I send post request "https://localhost:8000/login", {"username":"[email protected]","password": "****"}
      › [Request] {"baseURL":"https://localhost:8000/login","method":"POST","data":{"username":"[email protected]","password": "****"},"headers":{}}
      › [Response] {"access-token": "****"}
I.sendDeleteRequestWithPayload('/api/users/1', { author: 'john' });

🐛 Bug Fixes

  • fix(playwright): Different behavior of see* and waitFor* when used in within (#4557) - by @kobenguyent
  • fix(cli): dry run returns no tests when using a regex grep (#4608) - by @kobenguyent
> codeceptjs dry-run --steps --grep "(?=.*Checkout process)"
  • fix: Replace deprecated faker.name with faker.person (#4581) - by @thomashohn
  • fix(wdio): Remove dependency to devtools (#4563) - by @thomashohn
  • fix(typings): wrong defineParameterType (#4548) - by @kobenguyent
  • fix(typing): Locator.build complains the empty locator (#4543) - by @kobenguyent
  • fix: add hint to I.seeEmailAttachment treats parameter as regular expression (#4629) - by @ngraf
Add hint to "I.seeEmailAttachment" that under the hood parameter is treated as RegExp. 
When you don't know it, it can cause a lot of pain, wondering why your test fails with I.seeEmailAttachment('Attachment(1).pdf') although it looks just fine, but actually I.seeEmailAttachment('Attachment\\(1\\).pdf is required to make the test green, in case the attachment is called "Attachment(1).pdf" with special character in it.

📖 Documentation

New Contributors

Full Changelog: 3.6.6...3.6.8

3.6.6

17 Sep 14:54
63b1d50
Compare
Choose a tag to compare

What's Changed

3.6.6

❤️ Thanks all to those who contributed to make this release! ❤️

🛩️ Features

Zero-configuration when paired with other helpers like REST, Playwright:

// inside codecept.conf.js
{
  helpers: {
    Playwright: {...},
    SoftExpectHelper: {},
  }
}
// in scenario
I.softExpectEqual('a', 'b')
I.flushSoftAssertions() // Throws an error if any soft assertions have failed. The error message contains all the accumulated failures.
  • feat(cli): print failed hooks (#4476) - by @kobenguyent
    • run command
      Screenshot 2024-09-02 at 15 25 20

    • run workers command
      Screenshot 2024-09-02 at 15 24 53

🐛 Bug Fixes

// fix the validation of httpAgent config. we could now pass ca, instead of key/cert.
{
  helpers: {
    REST: {
      endpoint: 'http://site.com/api',
      prettyPrintJson: true,
      httpAgent: {
         ca: fs.readFileSync(__dirname + '/path/to/ca.pem'),
         rejectUnauthorized: false,
         keepAlive: true
      }
    }
  }
}

📖 Documentation

New Contributors

Full Changelog: 3.6.5...3.6.6

3.6.5

31 Jul 10:06
dd826d0
Compare
Choose a tag to compare

3.6.5

❤️ Thanks all to those who contributed to make this release! ❤️

🛩️ Features

it('should wait for input text field to be disabled', () =>
      I.amOnPage('/form/wait_disabled').then(() => I.waitForDisabled('#text', 1)))
    it('should wait for input text field to be enabled by xpath', () =>
      I.amOnPage('/form/wait_disabled').then(() => I.waitForDisabled("//*[@name = 'test']", 1)))
    it('should wait for a button to be disabled', () =>
      I.amOnPage('/form/wait_disabled').then(() => I.waitForDisabled('#text', 1)))
Waits for element to become disabled (by default waits for 1sec).
Element can be located by CSS or XPath.
@param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
@param {number} [sec=1] (optional) time in seconds to wait, 1 by default.
@returns {void} automatically synchronized promise through #recorder

🐛 Bug Fixes

📖 Documentation

Full Changelog: 3.6.4...3.6.5

3.6.4

19 Jun 08:11
cac208c
Compare
Choose a tag to compare

What's Changed

❤️ Thanks all to those who contributed to make this release! ❤️

🛩️ Features

Config:

...
REST: {
 ...
 printCurl: true,
 ...
}
... 

› [CURL Request] curl --location --request POST https://httpbin.org/post -H ...
  • feat(AI): Generate PageObject, added types, shell improvement (#4319) - by @DavertMik
    • added askForPageObject method to generate PageObjects on the fly
    • improved AI types
    • interactive shell improved to restore history

Screenshot from 2024-06-17 02-47-37

🐛 Bug Fixes

📖 Documentation

  • AI docs improvements

Full Changelog: 3.6.3...3.6.4

3.6.3

10 Jun 07:56
26dccb3
Compare
Choose a tag to compare

What's Changed

❤️ Thanks all to those who contributed to make this release! ❤️

🛩️ Features

🐛 Bug Fixes

📖 Documentation

New Contributors

Full Changelog: 3.6.2...3.6.3