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

1.3.2

Diff

Changelog

Source

1.3.2

  • Interactve Shell improvements for pause()
    • Added next command for step-by-step debug when using pause().
    • Use After(pause); in a to start interactive console after last step.
  • [Puppeteer] Updated to Puppeteer 1.6.0
    • Added waitForRequest to wait for network request.
    • Added waitForResponse to wait for network response.
  • Improved TypeScript definitions to support custom steps and page objects. By @xt1
  • Fixed XPath detection to accept XPath which starts with ./ by @BenoitZugmeyer
davert
published 1.3.1 •

Changelog

Source

1.3.1

  • BDD-Gherkin: Fixed running async steps.
  • [Puppeteer] Fixed process hanging for 30 seconds. Page loading timeout default via getPageTimeout set 0 seconds.
  • [Puppeteer] Improved displaying client-side console messages in debug mode.
  • [Puppeteer] Fixed closing sessions in restart:false mode for multi-session mode.
  • [Protractor] Fixed grabPopupText to not throw error popup is not opened.
  • [Protractor] Added info on using 'direct' Protractor driver to helper documentation by @xt1.
  • [WebDriverIO] Added a list of all special keys to WebDriverIO helper by @davertmik and @xt1.
  • Improved TypeScript definitions generator by @xt1
davert
published 1.3.0 •

Changelog

Source

1.3.0

  • Cucumber-style BDD. Introduced Gherkin support. Thanks to David Vins and Omedym for sponsoring this feature.

Basic feature file:

Feature: Business rules
  In order to achieve my goals
  As a persona
  I want to be able to interact with a system

  Scenario: do anything in my life
    Given I need to open Google

Step definition:

const I = actor();

Given('I need to open Google', () => {
  I.amOnPage('https://google.com');
});

Run it with --features --steps flag:

codeceptjs run --steps --features

  • Brekaing Chnage run command now uses relative path + test name to run exactly one test file.

Previous behavior (removed):

codeceptjs run basic_test.js

Current behavior (relative path to config + a test name)

codeceptjs run tests/basic_test.js

This change allows using auto-completion when running a specific test.


  • Nested steps output enabled for page objects.
    • to see high-level steps only run tests with --steps flag.
    • to see PageObjects implementation run tests with --debug.
  • PageObjects simplified to remove _init() extra method. Try updated generators and see updated guide.
  • [Puppeteer] Multiple sessions enabled. Requires Puppeteer >= 1.5
  • [Puppeteer] Stability improvement. Waits for for load event on page load. This strategy can be changed in config:
    • waitForNavigation config option introduced. Possible options: load, domcontentloaded, networkidle0, networkidle2. See Puppeteer API
    • getPageTimeout config option to set maximum navigation time in milliseconds. Default is 30 seconds.
    • waitForNavigation method added. Explicitly waits for navigation to be finished.
  • [WebDriverIO][Protractor][Puppeteer][Nightmare] Possible BC grabTextFrom unified. Return a text for single matched element and an array of texts for multiple elements.
  • [Puppeteer]Fixed resizeWindow by @sergejkaravajnij
  • [WebDriverIO][Protractor][Puppeteer][Nightmare] waitForFunction added. Waits for client-side JavaScript function to return true by @GREENpoint.
  • [Puppeteer] waitUntil deprecated in favor of waitForFunction.
  • Added filter function to DataTable.
  • Send non-nested array of files to custom parallel execution chunking by @mikecbrant.
  • Fixed invalid output directory path for run-multiple by @mikecbrant.
  • [WebDriverIO] waitUntil timeout accepts time in seconds (as all other wait* functions). Fix by @truesrc.
  • [Nightmare] Fixed grabNumberOfVisibleElements to work similarly to seeElement. Thx to @stefanschenk and Jinbo Jinboson.
  • [Protractor] Fixed alert handling error with message 'no such alert' by @truesrc.
davert
published 1.2.1 •

Changelog

Source

1.2.1

  • Fixed running I.retry() on multiple steps.
  • Fixed parallel execution wih chunks.
  • [Puppeteer] Fixed grabNumberOfVisibleElements to return 0 instead of throwing error if no elements are found.
davert
published 1.2.0 •

Changelog

Source

1.2.0

  • [WebDriverIO][Protractor]Multiple Sessions. Run several browser sessions in one test. Introduced session command, which opens additional browser window and closes it after a test.
Scenario('run in different browsers', (I) => {
  I.amOnPage('/hello');
  I.see('Hello!');
  session('john', () => {
    I.amOnPage('/bye');
    I.dontSee('Hello');
    I.see('Bye');
  });
  I.see('Hello');
});
  • Parallel Execution by @sveneisenschmidt. Run tests in parallel specifying number of chunks:
"multiple": {
  "parallel": {
    // run in 2 processes
    "chunks": 2,
    // run all tests in chrome
    "browsers": ["chrome"]
  },
}
  • Locator Builder. Write complex locators with simplest API combining CSS and XPath:
// select 'Edit' link inside 2nd row of a table
locate('//table')
  .find('tr')
  .at(2)
  .find('a')
  .withText('Edit');
  • Dynamic configuration to update helpers config per test or per suite.
  • Added event.test.finished which fires synchronously for both failed and passed tests.
  • [WebDriverIO][Protractor][Nightmare][Puppeteer] Full page screenshots on failure disabled by default. See [issue#1600. You can enabled them with fullPageScreenshots: true, however they may work unstable in Selenium.
  • within blocks can return values. See updated documentation.
  • Removed doublt call to _init in helpers. Fixes issue #1036
  • Added scenario and feature configuration via fluent API:
Feature('checkout')
  .timeout(3000)
  .retry(2);

Scenario('user can order in firefox', (I) => {
  // see dynamic configuration
}).config({ browser: 'firefox' })
  .timeout(20000);

Scenario('this test should throw error', (I) => {
  // I.amOnPage
}).throws(new Error);
davert
published 1.1.8 •

Changelog

Source

1.1.8

  • Fixed generating TypeScript definitions with codeceptjs def.
  • Added Chinese translation ("zh-CN" and "zh-TW") by @TechQuery.
  • Fixed running tests from a different folder specified by -c option.
  • [Puppeteer] Added support for hash handling in URL by @gavoja.
  • [Puppeteer] Fixed setting viewport size by @gavoja. See Puppeteer issue
davert
published 1.1.7 •

Changelog

Source

1.1.7

  • Docker Image updateed. See updated reference:
    • codeceptjs package is mounted as /codecept insde container
    • tests directory is expected to be mounted as /tests
    • codeceptjs global runner added (symlink to /codecept/bin/codecept.js)
  • [Protractor] Functions added by @reubenmiller:
    • _locateCheckable (only available from other helpers)
    • _locateClickable (only available from other helpers)
    • _locateFields (only available from other helpers)
    • acceptPopup
    • cancelPopup
    • dragAndDrop
    • grabBrowserLogs
    • grabCssPropertyFrom
    • grabHTMLFrom
    • grabNumberOfVisibleElements
    • grabPageScrollPosition (new)
    • rightClick
    • scrollPageToBottom
    • scrollPageToTop
    • scrollTo
    • seeAttributesOnElements
    • seeCssPropertiesOnElements
    • seeInPopup
    • seeNumberOfVisibleElements
    • switchTo
    • waitForEnabled
    • waitForValue
    • waitInUrl
    • waitNumberOfVisibleElements
    • waitToHide
    • waitUntil
    • waitUrlEquals
  • [Nightmare] added:
    • grabPageScrollPosition (new)
    • seeNumberOfVisibleElements
    • waitToHide
  • [Puppeteer] added:
    • grabPageScrollPosition (new)
  • [WebDriverIO] added"
    • grabPageScrollPosition (new)
  • [Puppeteer] Fixed running wait* functions without setting sec parameter.
  • [Puppeteer][Protractor] Fixed bug with I.click when using an object selector with the xpath property. By @reubenmiller
  • [WebDriverIO][Protractor][Nightmare][Puppeteer] Fixed I.switchTo(0) and I.scrollTo(100, 100) api inconsistencies between helpers.
  • [Protractor] Fixing bug when seeAttributesOnElements and seeCssPropertiesOnElement were incorrectly passing when the attributes/properties did not match by @reubenmiller
  • [WebDriverIO] Use inbuilt dragAndDrop function (still doesn't work in Firefox). By @reubenmiller
  • Support for Nightmare 3.0
  • Enable glob patterns in config.test / Codecept.loadTests by @sveneisenschmidt
  • Enable overriding of config.tests for run-multiple by @sveneisenschmidt
davert
published 1.1.6 •

Changelog

Source

1.1.6

  • Added support for async I => functions syntax in Scenario by @APshenkin
  • [WebDriverIO][Protractor][Puppeteer][Nightmare] waitForInvisible waits for element to hide or to be removed from page. By @reubenmiller
  • [Protractor][Puppeteer][Nightmare] Added grabCurrentUrl function. By @reubenmiller
  • [WebDriverIO] grabBrowserUrl deprecated in favor of grabCurrentUrl to unify the API.
  • [Nightmare] Improved element visibility detection by @reubenmiller
  • [Puppeteer] Fixing function calls when clearing the cookies and localstorage. By @reubenmiller
  • [Puppeteer] Added waitForEnabled, waitForValue and waitNumberOfVisibleElements methods by @reubenmiller
  • [WebDriverIO] Fixed grabNumberOfVisibleElements to return 0 when no visible elements are on page. By @michaltrunek
  • Helpers API improvements (by @reubenmiller)
    • _passed hook runs after a test passed successfully
    • _failed hook runs on a failed test
  • Hooks API. New events added by @reubenmiller:
    • event.all.before - executed before all tests
    • event.all.after - executed after all tests
    • event.multiple.before - executed before all processes in run-multiple
    • event.multiple.after - executed after all processes in run-multiple
  • Multiple execution
  • Allow AfterSuite and After test hooks to be defined after the first Scenario. By @reubenmiller
  • [Nightmare] Prevent I.amOnpage navigation if the browser is already at the given url
  • Multiple-Run: Added new bootstrapAll and teardownAll hooks to be executed before and after all processes
  • codeceptjs def command accepts --config option. By @reubenmiller
davert
published 1.1.5 •

Changelog

Source

1.1.5

  • [Puppeteer] Rerun steps failed due to "Cannot find context with specified id" Error.
  • Added syntax to retry a single step:
// retry action once on failure
I.retry().see('Hello');

// retry action 3 times on failure
I.retry(3).see('Hello');

// retry action 3 times waiting for 0.1 second before next try
I.retry({ retries: 3, minTimeout: 100 }).see('Hello');

// retry action 3 times waiting no more than 3 seconds for last retry
I.retry({ retries: 3, maxTimeout: 3000 }).see('Hello');

// retry 2 times if error with message 'Node not visible' happens
I.retry({
  retries: 2,
  when: err => err.message === 'Node not visible'
}).seeElement('#user');
  • Scenario().injectDependencies added to dynamically add objects into DI container by @Apshenkin. See Dependency Injection section in PageObjects.
  • Fixed using async/await functions inside within
  • [WebDriverIO][Protractor][Puppeteer][Nightmare] waitUntilExists deprecated in favor of waitForElement
  • [WebDriverIO][Protractor] waitForStalenessOf deprecated in favor of waitForDetached
  • [WebDriverIO][Protractor][Puppeteer][Nightmare] waitForDetached added
  • [Nightmare] Added I.seeNumberOfElements() by @pmoncadaisla
  • [Nightmare] Load blank page when starting nightmare so that the .evaluate function will work if _failed/saveScreenshot is triggered by @reubenmiller
  • Fixed using plain arrays for data driven tests by @reubenmiller
  • [Puppeteer] Use default tab instead of opening a new tab when starting the browser by @reubenmiller
  • [Puppeteer] Added grabNumberOfTabs function by @reubenmiller
  • [Puppeteer] Add ability to set user-agent by @abidhahmed
  • [Puppeteer] Add keepCookies and keepBrowserState @abidhahmed
  • [Puppeteer] Clear value attribute instead of innerhtml for TEXTAREA by @reubenmiller
  • [REST] fixed sending string payload by @michaltrunek
  • Fixed unhandled rejection in async/await tests by @APshenkin
davert
published 1.1.4 •

Changelog

Source

1.1.4

  • Removed yarn call in package.json
  • Fixed console.log in Puppeteer by @othree
  • [Appium] runOnAndroid and runOnIOS can receive a function to check capabilities dynamically:
I.runOnAndroid(caps => caps.platformVersion >= 7, () => {
  // run code only on Android 7+
});
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