-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #133 from FlowTestAI/update-cli-pkg
Add readme and license to cli package for publishing
- Loading branch information
Showing
18 changed files
with
674 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Sajal Jain | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# flowtestai-cli | ||
|
||
With FlowTestAI CLI, you can now run your end to end flows, constructed using FlowTestAI, directly from command line. | ||
|
||
This makes it easier to run your tests in different environments, automate your testing process, and integrate your tests with your continuous integration and deployment workflows. | ||
|
||
## Installation | ||
|
||
To install the FlowTestAI CLI, use the node package manager of your choice, such as NPM: | ||
|
||
```bash | ||
npm install -g flowtestai | ||
``` | ||
|
||
## Getting started | ||
|
||
Navigate to the root directory of your collection, and then run: | ||
|
||
```bash | ||
flow run help | ||
``` | ||
|
||
This command will give you various options you can use to run a flow. You can also run a single flow by specifying its filename with the `--file` or `-f` option: | ||
|
||
```bash | ||
flow run -f test.flow | ||
``` | ||
|
||
Or run a requests inside a subfolder: | ||
|
||
```bash | ||
flow run -f folder/subfolder/test.flow | ||
``` | ||
|
||
If you need to use an environment, you can specify it with the `--env` or `-e` option: | ||
|
||
```bash | ||
flow run -f test.flow -e environments/test.env | ||
``` | ||
|
||
If you need to publish the results of your flow runs for further analysis, you can specify the `-s` option. Request your access key pairs from https://flowtest-ai.vercel.app/ and then run export $FLOWTEST_ACCESS_ID and $FLOWTEST_ACCESS_KEY before publishing: | ||
|
||
```bash | ||
flow run -f test.flow -e environments/test.env -s | ||
``` | ||
|
||
## Demo | ||
|
||
 | ||
 | ||
|
||
## Support | ||
|
||
If you encounter any issues or have any feedback or suggestions, please raise them on our [GitHub repository](https://github.com/FlowTestAI/FlowTest) | ||
|
||
Thank you for using FlowTestAI CLI! | ||
|
||
## Changelog | ||
|
||
See [https://github.com/FlowTestAI/FlowTest/releases](https://github.com/FlowTestAI/FlowTest/releases) | ||
|
||
## License | ||
|
||
[MIT](LICENSE.md) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const { Node } = require('./Node'); | ||
|
||
class AssertNode extends Node { | ||
constructor() { | ||
super('assertNode'); | ||
} | ||
|
||
serialize(id, data, metadata) { | ||
return { | ||
id, | ||
type: this.type, | ||
data, | ||
...metadata, | ||
}; | ||
} | ||
|
||
deserialize(node) { | ||
const id = node.id; | ||
const data = node.data; | ||
delete node.id; | ||
delete node.data; | ||
const metadata = node; | ||
|
||
return { | ||
id, | ||
data, | ||
metadata, | ||
}; | ||
} | ||
} | ||
|
||
module.exports = { | ||
AssertNode, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const { Node } = require('./Node'); | ||
|
||
class AuthNode extends Node { | ||
constructor() { | ||
super('authNode'); | ||
} | ||
|
||
serialize(id, data, metadata) { | ||
return { | ||
id, | ||
type: this.type, | ||
data, | ||
...metadata, | ||
}; | ||
} | ||
|
||
deserialize(node) { | ||
const id = node.id; | ||
const data = node.data; | ||
delete node.id; | ||
delete node.data; | ||
const metadata = node; | ||
|
||
return { | ||
id, | ||
data, | ||
metadata, | ||
}; | ||
} | ||
} | ||
|
||
module.exports = { | ||
AuthNode, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const { Node } = require('./Node'); | ||
|
||
class DelayNode extends Node { | ||
constructor() { | ||
super('delayNode'); | ||
} | ||
|
||
serialize(id, data, metadata) { | ||
return { | ||
id, | ||
type: this.type, | ||
data, | ||
...metadata, | ||
}; | ||
} | ||
|
||
deserialize(node) { | ||
const id = node.id; | ||
const data = node.data; | ||
delete node.id; | ||
delete node.data; | ||
const metadata = node; | ||
|
||
return { | ||
id, | ||
data, | ||
metadata, | ||
}; | ||
} | ||
} | ||
|
||
module.exports = { | ||
DelayNode, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const { Node } = require('./Node'); | ||
|
||
class NestedFlowNode extends Node { | ||
constructor() { | ||
super('flowNode'); | ||
} | ||
|
||
serialize(id, data, metadata) { | ||
return { | ||
id, | ||
type: this.type, | ||
data, | ||
...metadata, | ||
}; | ||
} | ||
|
||
deserialize(node) { | ||
const id = node.id; | ||
const data = node.data; | ||
delete node.id; | ||
delete node.data; | ||
const metadata = node; | ||
|
||
return { | ||
id, | ||
data, | ||
metadata, | ||
}; | ||
} | ||
} | ||
|
||
module.exports = { | ||
NestedFlowNode, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class Node { | ||
constructor(type) { | ||
this.type = type; | ||
} | ||
|
||
serialize(id, data, metadata) { | ||
throw new Error('Serialize method must be implemented by subclasses'); | ||
} | ||
|
||
deserialize(node) { | ||
throw new Error('Deserialize method must be implemented by subclasses'); | ||
} | ||
} | ||
|
||
module.exports = { | ||
Node, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const { Node } = require('./Node'); | ||
|
||
class OutputNode extends Node { | ||
constructor() { | ||
super('outputNode'); | ||
} | ||
|
||
serialize(id, data, metadata) { | ||
return { | ||
id, | ||
type: this.type, | ||
data, | ||
...metadata, | ||
}; | ||
} | ||
|
||
deserialize(node) { | ||
const id = node.id; | ||
const { ['output']: _, ...data } = node.data; | ||
delete node.id; | ||
delete node.data; | ||
const metadata = node; | ||
|
||
return { | ||
id, | ||
data, | ||
metadata, | ||
}; | ||
} | ||
} | ||
|
||
module.exports = { | ||
OutputNode, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const { Node } = require('./Node'); | ||
|
||
class RequestNode extends Node { | ||
constructor() { | ||
super('requestNode'); | ||
} | ||
|
||
serialize(id, data, metadata) { | ||
return { | ||
id, | ||
type: this.type, | ||
data, | ||
...metadata, | ||
}; | ||
} | ||
|
||
deserialize(node) { | ||
const id = node.id; | ||
const data = node.data; | ||
delete node.id; | ||
delete node.data; | ||
const metadata = node; | ||
|
||
return { | ||
id, | ||
data, | ||
metadata, | ||
}; | ||
} | ||
} | ||
|
||
module.exports = { | ||
RequestNode, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const { Node } = require('./Node'); | ||
|
||
class SetVarNode extends Node { | ||
constructor() { | ||
super('setVarNode'); | ||
} | ||
|
||
serialize(id, data, metadata) { | ||
return { | ||
id, | ||
type: this.type, | ||
data, | ||
...metadata, | ||
}; | ||
} | ||
|
||
deserialize(node) { | ||
const id = node.id; | ||
const data = node.data; | ||
delete node.id; | ||
delete node.data; | ||
const metadata = node; | ||
|
||
return { | ||
id, | ||
data, | ||
metadata, | ||
}; | ||
} | ||
} | ||
|
||
module.exports = { | ||
SetVarNode, | ||
}; |
Oops, something went wrong.