Skip to content

Commit

Permalink
feat: mask sensitive data
Browse files Browse the repository at this point in the history
  • Loading branch information
gkushang committed Dec 11, 2024
1 parent 5abda10 commit 7dc2d6e
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .codegenie/customizations/test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# CodeceptJS Testing Cheat Sheet

## Testing Libraries and Frameworks
- Jest
- Chai
- Sinon
- Mocha

## Mocking and Stubbing
- Sinon is used for mocking and stubbing
- `sinon.spy()` for creating spies
- `sinon.mock()` for creating mocks
- `sinon.stub()` for creating stubs

## Assertions
- Chai assertions are used (`expect` syntax)
- Jest assertions are also used in some tests

## Test Structure
- `describe()` for grouping tests
- `it()` for individual test cases
- `before()`, `beforeEach()`, `after()`, `afterEach()` for setup and teardown

## CodeceptJS Specific
- `Feature()` for defining features
- `Scenario()` for defining scenarios
- `Given()`, `When()`, `Then()` for BDD-style steps
- `I` object for actor actions

## Helpers and Plugins
- Custom helpers can be created and used
- Plugins like `tryTo` and `subtitles` are available

## Configuration
- `codecept.conf.js` for main configuration
- Config can be manipulated programmatically using `config` module

## Events
- `event` module for handling test events
- Custom event listeners can be added

## Recorder
- `recorder` module for managing test execution flow

## Locators
- Custom locator strategies can be defined
- XPath and CSS selectors are supported

## Data Tables
- Gherkin-style data tables are supported in scenarios

## Retries
- `I.retry()` for retrying failed steps

## AI Assistant
- `AiAssistant` module for AI-powered testing assistance

## File Operations
- `fs` and `path` modules are used for file operations

## HTML Processing
- Functions for minifying and processing HTML for tests

## Artifacts
- Video recording and subtitle generation for failed tests

This cheat sheet covers the main testing practices and tools used in the CodeceptJS codebase. It includes information on testing frameworks, mocking, assertions, test structure, CodeceptJS-specific features, and various utilities and modules used throughout the tests.
1 change: 1 addition & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ After running `codeceptjs init` it should be saved in test root.
| `tests` | `string` | Pattern to locate CodeceptJS tests. Allows to enter glob pattern or an Array<string> of patterns to match tests / test file names. For tests in JavaScript: ```tests: 'tests/**.test.js' ``` For tests in TypeScript: ```tests: 'tests/**.test.ts' ``` |
| `timeout?` | `number` | Set default tests timeout in seconds. Tests will be killed on no response after timeout. ```timeout: 20, ``` |
| `translation?` | `string` | Enable [localized test commands](https://codecept.io/translation/) |
| `maskSensitiveData?` | `boolean` | Enable to mask Sensitive Data in console. |


## Require
Expand Down

0 comments on commit 7dc2d6e

Please sign in to comment.