Select Page
Automation Testing

Acceptance Testing with CodeceptJS

Being a leading QA Company, we write blogs on all prominent software testing topics and tools using our real-world experience. So stay sharp by subscribing to our Newsletter.

Acceptance Testing with CodeceptJS - Blog
Listen to this blog

If you google the definition of Acceptance Testing, you will get different definitions. Without knowing what acceptance testing is, it is impossible for your team to conclude user stories development.

acceptance testing

What is acceptance testing?

Acceptance tests validate that a story has been developed with the functionality the customer team had in mind when they wrote the story.-By Mike Cohn

Why developers can’t write acceptance tests?

Developers can think about acceptance tests for a user story but should not write since they are not part of Customer team (testers, product manager, real users and other stakeholders).

Write acceptance tests before starting a story development

Acceptance tests should be written before coding. It helps a developer to remain focused on a story during coding and concludes a user story development.

Why CodeceptJS?

Automating acceptance tests is good. However, the written automated acceptance tests should be understood by a business person. CodeceptJS helps you to write acceptance tests from user’s perspective, every command is described as an action of a user visiting a site, and supports WebDriverIO, Protractor, Selenium WebDriver JS, NightmareJS or others…

How to create a script
  • Install
    npm install -g codeceptjs  
  • After installing codeceptjs, run the below command. You will be asked for tests location and the helpers.
    codeceptjs init  

    Once the setup is done, you can see the below configurations in codecept.json

    {
      "tests": "./tests/*_test.js",
      "timeout": 10000,
      "output": "./output",
      "helpers": {
        "WebDriverIO": {
          "url": "https://codoid.com",
          "browser": "chrome"
        }
      },
      "include": {},
      "bootstrap": false,
      "mocha": {},
      "name": "codeceptjs-demo"
    }  
  • Depending on a helper you’ve chosen you will be asked to install corresponding package manually in the end of init.
    npm install -g webdriverio  
  • Tests can be easily created by running
    codeceptjs gt  

    The simplest test will look like this:

    Feature('codoid');
    Scenario('test something', (I) => {
        I.amOnPage('/');
        I.click("Contact us")
    });
      
  • That’s it. The above-listed steps are just a reference. However, the following link CodeceptJS Quickstart provides all the details to configure CodeceptJS.

Comments(0)

Submit a Comment

Your email address will not be published. Required fields are marked *

Talk to our Experts

Amazing clients who
trust us


poloatto
ABB
polaris
ooredo
stryker
mobility