Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

codeceptjs

Package Overview
Dependencies
Maintainers
1
Versions
235
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

codeceptjs - npm Package Versions

1
24

3.6.2-beta.2

Diff

thanh.nguyen
published 3.6.2-beta.1 •

davert
published 3.6.1 •

Changelog

Source

3.6.1

  • Fixed regression in interactive pause.
thanh.nguyen
published 3.6.0 •

Changelog

Source

3.6.0

🛩️ Features

  • Introduced healers to improve stability of failed tests. Write functions that can perform actions to fix a failing test:
heal.addRecipe('reloadPageIfModalIsNotVisisble', {
  steps: [
    'click',
  ],
  fn: async ({ error, step }) => {
    // this function will be executed only if test failed with
    // "model is not visible" message
    if (error.message.include('modal is not visible')) return;

    // we return a function that will refresh a page
    // and tries to perform last step again
    return async ({ I }) => {
      I.reloadPage();
      I.wait(1);
      await step.run();
    };
    // if a function succeeds, test continues without an error
  },
});
  • Breaking Change AI features refactored. Read updated AI guide:

    • removed dependency on openai
    • added support for Azure OpenAI, Claude, Mistal, or any AI via custom request function
    • --ai option added to explicitly enable AI features
    • heal plugin decoupled from AI to run custom heal recipes
    • improved healing for async/await scenarios
    • token limits added
    • token calculation introduced
    • OpenAI helper renamed to AI
  • feat(puppeteer): network traffic manipulation. See #4263 by @KobeNguyenT

    • startRecordingTraffic
    • grabRecordedNetworkTraffics
    • flushNetworkTraffics
    • stopRecordingTraffic
    • seeTraffic
    • dontSeeTraffic
  • feat(Puppeteer): recording WS messages. See #4264 by @KobeNguyenT

Recording WS messages:

      I.startRecordingWebSocketMessages();
      I.amOnPage('https://websocketstest.com/');
      I.waitForText('Work for You!');
      const wsMessages = I.grabWebSocketMessages();
      expect(wsMessages.length).to.greaterThan(0);

flushing WS messages:

      I.startRecordingWebSocketMessages();
      I.amOnPage('https://websocketstest.com/');
      I.waitForText('Work for You!');
      I.flushWebSocketMessages();
      const wsMessages = I.grabWebSocketMessages();
      expect(wsMessages.length).to.equal(0);

Examples:

// recording traffics and verify the traffic
  I.startRecordingTraffic();
  I.amOnPage('https://codecept.io/');
  I.seeTraffic({ name: 'traffics', url: 'https://codecept.io/img/companies/BC_LogoScreen_C.jpg' });
// check the traffic with advanced params
  I.amOnPage('https://openai.com/blog/chatgpt');
  I.startRecordingTraffic();
  I.seeTraffic({
    name: 'sentry event',
    url: 'https://images.openai.com/blob/cf717bdb-0c8c-428a-b82b-3c3add87a600',
    parameters: {
      width: '1919',
      height: '1138',
    },
  });
  • Introduce the playwright locator: _react, _vue, data-testid attribute. See #4255 by @KobeNguyenT
Scenario('using playwright locator @Playwright', () => {
  I.amOnPage('https://codecept.io/test-react-calculator/');
  I.click('7');
  I.click({ pw: '_react=t[name = "="]' });
  I.seeElement({ pw: '_react=t[value = "7"]' });
  I.click({ pw: '_react=t[name = "+"]' });
  I.click({ pw: '_react=t[name = "3"]' });
  I.click({ pw: '_react=t[name = "="]' });
  I.seeElement({ pw: '_react=t[value = "10"]' });
});
Scenario('using playwright data-testid attribute @Playwright', () => {
    I.amOnPage('/');
    const webElements = await I.grabWebElements({ pw: '[data-testid="welcome"]' });
    assert.equal(webElements[0]._selector, '[data-testid="welcome"] >> nth=0');
    assert.equal(webElements.length, 1);
});
  • feat(puppeteer): mockRoute support. See #4262 by @KobeNguyenT

Network requests & responses can be mocked and modified. Use mockRoute which strictly follows Puppeteer's setRequestInterception API.

I.mockRoute('https://reqres.in/api/comments/1', request => {
  request.respond({
    status: 200,
    headers: { 'Access-Control-Allow-Origin': '*' },
    contentType: 'application/json',
    body: '{"name": "this was mocked" }',
  });
})
I.mockRoute('**/*.{png,jpg,jpeg}', route => route.abort());

// To disable mocking for a route call `stopMockingRoute`
// for previously mocked URL
I.stopMockingRoute('**/*.{png,jpg,jpeg}');

To master request intercepting use HTTPRequest object passed into mock request handler.

🐛 Bug Fixes

  • Fixed double help message #4278 by @masiuchi
  • waitNumberOfVisibleElements always failed when passing num as 0. See #4274 by @KobeNguyenT
davert
published 3.6.0-beta.1.ai-healers •

thanh.nguyen
published 3.5.15 •

Changelog

Source

3.5.15

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

🛩️ Features

  • feat: improve code coverage plugin (#4252) - by @KobeNguyenT We revamp the coverage plugin to make it easier to use

Once all the tests are completed, codecept will create and store coverage in output/coverage folder, as shown below.

Open index.html in your browser to view the full interactive coverage report.

🐛 Bug Fixes

  • fix: bump puppeteer to v22.x (#4249) - by @KobeNguyenT
  • fix: improve dry-run command (#4225) - by @KobeNguyenT

dry-run command now supports test level grep.

Tests from /Users/t/Desktop/projects/codeceptjs-rest-demo:@jaja

GET tests -- /Users/t/Desktop/projects/codeceptjs-rest-demo/src/GET_test.ts -- 4 tests
  ☐ Verify getting a single user @jaja
  ☐ Verify getting list of users @jaja
PUT tests -- /Users/t/Desktop/projects/codeceptjs-rest-demo/src/PUT_test.ts -- 4 tests
  ☐ Verify creating new user @Jaja


  Total: 2 suites | 3 tests  

--- DRY MODE: No tests were executed ---
➜  codeceptjs-rest-demo git:(master) ✗ npx codeceptjs dry-run             
Tests from /Users/t/Desktop/projects/codeceptjs-rest-demo:

DELETE tests -- /Users/t/Desktop/projects/codeceptjs-rest-demo/src/DELETE_test.ts -- 4 tests
  ☐ Verify deleting a user
GET tests -- /Users/t/Desktop/projects/codeceptjs-rest-demo/src/GET_test.ts -- 4 tests
  ☐ Verify a successful call
  ☐ Verify a not found call
  ☐ Verify getting a single user @jaja
  ☐ Verify getting list of users @jaja
POST tests -- /Users/tDesktop/projects/codeceptjs-rest-demo/src/POST_test.ts -- 4 tests
  ☐ Verify creating new user
  ☐ Verify uploading a file
PUT tests -- /Users/tDesktop/projects/codeceptjs-rest-demo/src/PUT_test.ts -- 4 tests
  ☐ Verify creating new user @Jaja


  Total: 4 suites | 8 tests  

--- DRY MODE: No tests were executed ---
  • Several internal fixes and improvements for github workflows
thanh.nguyen
published 3.5.14 •

Changelog

Source

3.5.14

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

🐛 Bug Fixes

  • Hotfix Fixed missing joi package - by @KobeNguyenT
thanh.nguyen
published 3.5.13 •

Changelog

Source

3.5.13

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

🛩️ Features

  • feat: mock server helper (#4155) - by @KobeNguyenT Screenshot 2024-01-25 at 13 47 59
  • feat(webdriver): network traffics manipulation (#4166) - by @KobeNguyenT [Webdriver] Added commands to check network traffics - supported only with devtoolsProtocol
    • startRecordingTraffic
    • grabRecordedNetworkTraffics
    • flushNetworkTraffics
    • stopRecordingTraffic
    • seeTraffic
    • dontSeeTraffic

Examples:

// recording traffics and verify the traffic
  I.startRecordingTraffic();
  I.amOnPage('https://codecept.io/');
  I.seeTraffic({ name: 'traffics', url: 'https://codecept.io/img/companies/BC_LogoScreen_C.jpg' });
// check the traffic with advanced params
  I.amOnPage('https://openai.com/blog/chatgpt');
  I.startRecordingTraffic();
  I.seeTraffic({
    name: 'sentry event',
    url: 'https://images.openai.com/blob/cf717bdb-0c8c-428a-b82b-3c3add87a600',
    parameters: {
      width: '1919',
      height: '1138',
    },
  });
  • feat(webapi): add waitForCookie (#4169) - by @KobeNguyenT Waits for the specified cookie in the cookies.
I.waitForCookie("token");

🐛 Bug Fixes

  • fix(appium): update performSwipe with w3c protocol v2 (#4181) - by @MykaLev
  • fix(webapi): selectOption method (#4157) - by @dyaroman
  • fix: waitForText doesnt throw error when text doesnt exist (#4195) - by @KobeNguyenT
  • fix: use this.options instead of this.config (#4186) - by @KobeNguyenT
  • fix: config path without selenium (#4184) - by @KobeNguyenT
  • fix: bring to front condition in _setPage (#4173) - by @KobeNguyenT
  • fix: complicated locator (#4170) - by @KobeNguyenT Adding of ':nth-child' into the array

const limitation = [':nth-of-type', ':first-of-type', ':last-of-type', ':nth-last-child', ':nth-last-of-type', ':checked', ':disabled', ':enabled', ':required', ':lang']; fixes the issue. Then an old conversion way over css-to-xpath is used.

📖 Documentation

  • fix(docs): missing docs for codecept UI (#4175) - by @KobeNguyenT
  • fix(docs): Appium documentation sidebar menu links (#4188) - by @mirao

🛩️ Several bugfixes and improvements for Codecept-UI

  • Several internal improvements
  • fix: title is not showing when visiting a test
  • fix: handle erros nicely
thanh.nguyen
published 3.5.13-beta.3 •

thanh.nguyen
published 3.5.13-beta.2 •

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc