Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

kobenguyent
Copy link
Collaborator

@kobenguyent kobenguyent commented Aug 19, 2025

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 (feat: shuffle test suite order in run command #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 (feat: better I.grab logging in live interactive mode #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 (fix: sessions playwright traces - naming convention and error handling #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 (5066 unable to inject data between workers because of proxy object #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 (fix: hook exit code #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 (fix: miss the effects types #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 (fix: mochawesome helper with unique screenshots #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

@kobenguyent kobenguyent merged commit a483106 into 3.x Aug 19, 2025
11 of 12 checks passed
@kobenguyent kobenguyent deleted the release-3.7.4 branch August 19, 2025 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant