Codeceptjs is an end-to-end BDD framework aiming at writing readable tests with the user’s perspective. It can be run along with Playwright, WebDriver, Puppeteer, TestCafe, Protractor, and Appium without changing the code.

In order to start a project we run this script:

npx create-codeceptjs .

Then we start our project with this command:

npx codeceptjs init

There is going to be a menu to configure the environment. Let’s say we chose Playwright. Then we can create a folder called tests and start with the first test:

Feature('My First Test');

Scenario('test add todo', ({ I }) => {
  I.amOnPage('https://todomvc.com/examples/react/#/');
  I.fillField('input[placeholder="What needs to be done"]', 'Cook soup');
  //I.fillField('user[email]','miles@davis.com');
  I.pressKey('Enter');
  within('.todo-list', () => {
    I.see('Cook soup')
  });
});


An these are the results on the command line: