CLI Tools

Overview

Playwright Bingo provides a set of command-line tools to help you manage your test project, create new pages, and handle sensitive data.

Available Commands

Initialize Project

bingo init

Creates a new Playwright Bingo project with the recommended directory structure and configuration files.

Add New Page

bingo add page "login"

Creates a new page object with associated locators and actions files.

Mask Data

bingo mask "sensitive-data"

Masks sensitive data and provides the masked value for use in your environment files or properties files.

# Example usage:
bingo mask "test@example.com"
# Output:
# 🔒 Masked Value:
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Original: test@example.com
# Masked:  BINGO_MASK_e2b9d415
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Unmask Data

bingo unmask "BINGO_MASK_"

Decrypts a masked value to show its original value. Useful for debugging or verifying masked values.

# Example usage:
bingo unmask "BINGO_MASK_e2b9d415"
# Output:
# 🔓 Unmasked Value:
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Masked:   BINGO_MASK_e2b9d415
# Original: test@example.com
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Update Page

bingo update page "oldName" "newName"

Renames a page object and updates all related files and references.

Delete Page

bingo delete page "pageName"

Removes a page object and its associated files from the project.

Generated Files

When using the CLI tools, the following files are generated:

  • Page locator files in `pages/locators/`
  • Page action files in `pages/actions/`
  • Step definition files in `step-definitions/`
  • Feature files in `features/`

Best Practices

  • Use descriptive names for pages and components
  • Keep sensitive data masked in version control
  • Use the mask command before committing sensitive data
  • Verify masked values using the unmask command when needed
  • Follow a consistent naming convention for your pages