Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/juliandavidmr/cocora
Allows expected software behaviors to be specified in a logical language that customers can understand
https://github.com/juliandavidmr/cocora
bdd cucumber library-automation typescript
Last synced: about 2 months ago
JSON representation
Allows expected software behaviors to be specified in a logical language that customers can understand
- Host: GitHub
- URL: https://github.com/juliandavidmr/cocora
- Owner: juliandavidmr
- License: mit
- Created: 2020-03-01T06:17:16.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-02-11T01:34:00.000Z (almost 3 years ago)
- Last Synced: 2024-10-12T06:22:26.430Z (3 months ago)
- Topics: bdd, cucumber, library-automation, typescript
- Language: TypeScript
- Size: 49.8 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cocora
> _In progress._ The first version will be released once Float, Int and Hooks are supported.
Cocora is a lightweight tool written in Typescript that supports [Behavior Based Development (BDD)](https://en.wikipedia.org/wiki/Behavior-driven_development), a software development process that aims to improve software quality and reduce maintenance costs.
Cocora is a modular system that allows you to declare and execute multiple scenarios with configurable steps.
## FAQ
- How does Cocora relate to [Cucumber](https://cucumber.io/)?
Cocora is inspired by Cucumber, has similarities in the definition format of Scenarios and Steps. Cocora incorporates extra functionalities and brings with it a new execution architecture. [See examples section](#).
## Examples
**Steps definitions:**
```yml
# steps.yml- Feature:
Name: Feature 1
Scenarios:
- Name: Scenario 1
Steps:
- Given: that I have gone to the Google page
- When: 'I add "cats" to the search box'
- And: click the Search Button
- Then: '"cats" should be mentioned in the results'
data: []
```**Steps declarations:**
```ts
// declarations.steps.tsimport { Then, Given } from "../src";
const GooglePage = Given('that I have gone to the Google page', {}, async () => {
console.log('Go to Google page');
await wait(1000);
})const SearchBox = Then('I add {string} to the search box', {}, async (search: string) => {
console.log(`Type ${search} in the search box`);
})const ClickSearchButton = Then('click the Search Button', {}, async () => {
console.log('Click on the search button');
})const Metioned = Then('{string} should be mentioned in the results', {}, async (search: string) => {
console.log(`The word ${search} appears`);
})export { GooglePage, SearchBox, ClickSearchButton, Metioned }
```**Module referencing**
```ts
// main.tsimport { Module } from "cocora";
import { GooglePage, ClickSearchButton, SearchBox, Metioned } from "./declarations.steps.ts";Module({
name: 'Module A',
declarations: [ GooglePage, SearchBox, ClickSearchButton, Metioned ],
stepsPath: './steps.yml'
}).run();
```**Running the module**
```bash
$ ts-node main.tsGo to Google page
Type cats in the search box
Click on the search button
The word cats appearsReport
- State: Success
- Scenarios executed: 1
- Steps executed: 4 / 4
```## API
## TODO
- [x] Process custom input data (Examples)
- [ ] Support for Float and regular expressions
- [ ] Support condditions
- [x] Generate report
- [ ] Hooks support
- [ ] Create CLI