Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency codeceptjs to v3.7.1 #1144

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Dec 11, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
codeceptjs (source) 3.6.7 -> 3.7.1 age adoption passing confidence

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


Release Notes

Codeception/codeceptjs (codeceptjs)

v3.7.1

Compare Source

  • Fixed reading charAt error in asyncWrapper.js

v3.7.0

Compare Source

This release introduces major new features and internal refactoring. It is an important step toward the 4.0 release planned soon, which will remove all deprecations introduced in 3.7.

🛩️ Features

🔥 Native Element Functions

A new Els API for direct element interactions has been introduced. This API provides low-level element manipulation functions for more granular control over element interactions and assertions:

  • element() - perform custom operations on first matching element
  • eachElement() - iterate and perform operations on each matching element
  • expectElement() - assert condition on first matching element
  • expectAnyElement() - assert condition matches at least one element
  • expectAllElements() - assert condition matches all elements

Example using all element functions:

const { element, eachElement, expectElement, expectAnyElement, expectAllElements } = require('codeceptjs/els')

// ...

Scenario('element functions demo', async ({ I }) => {
  // Get attribute of first button
  const attr = await element('.button', async el => await el.getAttribute('data-test'))

  // Log text of each list item
  await eachElement('.list-item', async (el, idx) => {
    console.log(`Item ${idx}: ${await el.getText()}`)
  })

  // Assert first submit button is enabled
  await expectElement('.submit', async el => await el.isEnabled())

  // Assert at least one product is in stock
  await expectAnyElement('.product', async el => {
    return (await el.getAttribute('data-status')) === 'in-stock'
  })

  // Assert all required fields have required attribute
  await expectAllElements('.required', async el => {
    return (await el.getAttribute('required')) !== null
  })
})

Els functions expose the native API of Playwright, WebDriver, and Puppeteer helpers. The actual el API will differ depending on which helper is used, which affects test code interoperability.

🔮 Effects introduced

Effects is a new concept that encompasses all functions that can modify scenario flow. These functions are now part of a single module. Previously, they were used via plugins like tryTo and retryTo. Now, it is recommended to import them directly:

const { tryTo, retryTo } = require('codeceptjs/effects')

Scenario(..., ({ I }) => {
  I.amOnPage('/')
  // tryTo returns boolean if code in function fails
  // use it to execute actions that may fail but not affect the test flow
  // for instance, for accepting cookie banners
  const isItWorking = tryTo(() => I.see('It works'))

  // run multiple steps and retry on failure
  retryTo(() => {
    I.click('Start Working!');
    I.see('It works')
  }, 5);
})

Previously tryTo and retryTo were available globally via plugins. This behavior is deprecated as of 3.7 and will be removed in 4.0. Import these functions via effects instead. Similarly, within will be moved to effects in 4.0.

check command added
npx codeceptjs check

This command can be executed locally or in CI environments to verify that tests can be executed correctly.

It checks:

  • configuration
  • tests
  • helpers

And will attempt to open and close a browser if a corresponding helper is enabled. If something goes wrong, the command will fail with a message. Run npx codeceptjs check on CI before actual tests to ensure everything is set up correctly and all services and browsers are accessible.

For GitHub Actions, add this command:

steps:

v3.6.10

Compare Source

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

🐛 Bug Fixes
fix(cli): missing failure counts when there is failedHooks (#​4633) - by @​kobenguyent

v3.6.9

Compare Source

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

🐛 Hot Fixes
fix: could not run tests due to missing invisi-data lib - by @​kobenguyent

v3.6.8

Compare Source

❤️ 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

> codeceptjs dry-run --steps --grep "(?=.*Checkout process)"
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


Configuration

📅 Schedule: Branch creation - "after 7am and before 11am every weekday" in timezone Europe/London, Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot added the dependencies Pull requests that update a dependency file label Dec 11, 2024
@renovate renovate bot force-pushed the renovate/codeceptjs-3.x branch from 5c9af8b to b9b17f9 Compare December 11, 2024 15:27
@renovate renovate bot changed the title chore(deps): update dependency codeceptjs to v3.6.9 chore(deps): update dependency codeceptjs to v3.6.10 Dec 11, 2024
@renovate renovate bot force-pushed the renovate/codeceptjs-3.x branch from b9b17f9 to 974bd37 Compare January 23, 2025 19:34
@renovate renovate bot force-pushed the renovate/codeceptjs-3.x branch from 974bd37 to 0c8ac92 Compare February 10, 2025 06:42
@renovate renovate bot changed the title chore(deps): update dependency codeceptjs to v3.6.10 chore(deps): update dependency codeceptjs to v3.7.0 Feb 10, 2025
@renovate renovate bot force-pushed the renovate/codeceptjs-3.x branch from 0c8ac92 to 89c3969 Compare February 11, 2025 02:30
@renovate renovate bot changed the title chore(deps): update dependency codeceptjs to v3.7.0 chore(deps): update dependency codeceptjs to v3.7.1 Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file ns:em prd:em rel:em-media-viewer-pr-1144
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants