CodeceptJS
  • 23 Apr 2025
  • 1 Minute to read
  • Dark
    Light

CodeceptJS

  • Dark
    Light

Article summary

Overview

This guide helps you set up and run automated tests using CodeceptJS with Pcloudy on real devices and browsers (including Playwright and Selenium support). Whether you're testing native, hybrid, or web apps, this sample project provides a ready-to-use framework.

Project Repository:

GitHub - CodeceptJS Sample Project

Prerequisites

  • Ensure Node.js version 16+ is installed.

  • User should be registered on pcloudy platform

Installation

  1. Clone or download the project.

  2. Open a terminal in the root directory of the project.

  3. Run the following command to install dependencies:

    npm install

  4. Update the configuration as needed in: config/pcloudy.config.js

Configuration Options

  1. For Device Native/Hybrid App

Update the necessary capabilities in the pcloudy.config.js file under the capabilities section for your native or hybrid app.

CodeceptJS configuration file showing native app capabilities for Android and iOS testing on Pcloudy

  1. For Device Browser (iOS/Android)

Set the appropriate configuration for mobile browser testing (Chrome for Android, Safari for iOS).

CodeceptJS configuration for mobile browser testing on Chrome and Safari using Pcloudy

  1. For Playwright

Ensure browser context and platform details are correctly configured in the Playwright section of the config file.

Playwright configuration in CodeceptJS for automated browser testing on Pcloudy

  1. For Selenium Browser

Add Selenium WebDriver details and browser settings as required.

CodeceptJS setup for Selenium browser testing with WebDriver on Pcloudy infrastructure

Running the Tests

  1. For Real Devices (Native/Hybrid/Browser)

  • iOS: npm run ios

  • Android: npm run android

  1. For Playwright / Selenium

npm run test


Was this article helpful?

What's Next