cypress-bootstrapper

1.0.17 • Public • Published

🚀 Cypress Project Scaffold CLI

A simple and interactive CLI tool to quickly bootstrap a UI + API Cypress test framework with optional Git and GitHub Actions support.


📦 Features

✅ Interactive CLI for easy setup
✅ Ready-made folder structure for UI & API testing
✅ Sample boilerplate tests and page objects
✅ Cypress plugins like XPath, API testing, and HTML reporter
✅ Optional Git and GitHub Actions integration
✅ Beginner-friendly, clean and modular codebase


📁 Folder Structure

your-project/
├── cypress/
│   ├── e2e/
│   │   ├── api/                   # API tests
│   │   └── ui/
│   │       ├── pages/            # Page Object Model files
│   │       └── tests/            # UI tests
│   ├── fixtures/                 # Test data
│   ├── reports/                  # Mochawesome reports
│   └── support/                  # Cypress support files
├── .github/workflows/            # GitHub CI (optional)
├── .gitignore
├── cypress.config.js             # Cypress configuration
├── package.json

🚀 Getting Started

⚠️ Important: For installation, use the following command:

npx cypress-bootstrapper
```bash
npx cypress-bootstrapper

Do NOT use npm i cypress-bootstrapper as it only installs the package and does not run the setup.

1. Clone this project or copy the files into a new folder

git clone <your-repo-url>
cd <your-folder-name>

Or simply download and extract the files.


2. Install the bootstrapper dependencies

npm install

3. Run the CLI

node ./bin/bootstrap.js

You will be prompted for:

  • Your application's base URL
  • Whether to initialize a Git repo
  • Whether to include GitHub Actions CI

4. Run Cypress Tests

# Opens the interactive test runner
npx cypress open

# Runs tests in headless mode
npx cypress run

🧪 Example Test Created

UI Test

describe('Login UI Test', () => {
  it('should login successfully', () => {
    loginPage.visit();
    loginPage.fillUsername('testuser');
    loginPage.fillPassword('password123');
    loginPage.submit();
    cy.url().should('include', '/dashboard');
  });
});

API Test

describe('Login API Test', () => {
  it('should return status 200', () => {
    cy.api({
      method: 'GET',
      url: 'api/productsList',
    }).then((response) => {
      expect(response.status).to.eq(200);
    });
  });
});

🔧 Cypress Plugins Included


🛠️ GitHub Actions (Optional)

If enabled during setup, a .github/workflows/ci.yml file will be created to automatically run Cypress tests on every push or pull request to main.


🧹 Clean Up

If needed, you can remove or customize:

  • Boilerplate tests in cypress/e2e/
  • Sample commands in support/commands.js
  • CI workflow under .github/workflows/

🙌 Contributing

Contributions are welcome! You can fork this tool, extend it with new prompts, or add more templates like TypeScript or Docker support.


📄 License

MIT – free for personal and commercial use.


💬 Questions?

Feel free to open an issue or reach out via the project's discussion tab!


Package Sidebar

Install

npm i cypress-bootstrapper

Weekly Downloads

105

Version

1.0.17

License

MIT

Unpacked Size

13.1 kB

Total Files

9

Last publish

Collaborators

  • nitpathak