Skip to content

Commit

Permalink
feat: add nx-plugin setup and basic test
Browse files Browse the repository at this point in the history
  • Loading branch information
BioPhoton committed Jun 7, 2023
1 parent 5521b09 commit 4e86008
Show file tree
Hide file tree
Showing 12 changed files with 67 additions and 381 deletions.
1 change: 0 additions & 1 deletion .github/workflows/user-flow-gh-action-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ jobs:
- name: run:user-flow-action
uses: push-based/[email protected]
with:
customScript: npm run nx -- user-flow user-flow-ci-integration
rcPath: packages/user-flow-ci-integration/.user-flowrc.json
2 changes: 1 addition & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}
},
"extends": "nx/presets/core.json",
"npmScope": "user-flow",
"npmScope": "@push-based",
"affected": {
"defaultBase": "origin/main"
},
Expand Down
10 changes: 5 additions & 5 deletions packages/cli/docs/writing-basic-user-flows.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ This results in the following file:
}
```

2. Create a `order-coffee.uf.ts` file.
2. Create a `basic-navigation.uf.ts` file.

**./user-flows/order-coffee.uf.ts**
**./user-flows/basic-navigation.uf.ts**
```typescript
import {
UserFlowInteractionsFn,
Expand Down Expand Up @@ -113,7 +113,7 @@ Let's start by filling in our interaction logic:

1. Copy and paste the new lines into your flow.

**./user-flows/order-coffee.uf.ts**
**./user-flows/basic-navigation.uf.ts**
```typescript
const interactions: UserFlowInteractionsFn = async (ctx: UserFlowContext): Promise<any> => {
// ...
Expand Down Expand Up @@ -150,7 +150,7 @@ const interactions: UserFlowInteractionsFn = async (ctx: UserFlowContext): Promi

2. Wrap the sections interesting for a timespan measure with `await flow.startTimespan({ stepName: 'Select coffee' });` and `await flow.stopTimespan();`.

**./user-flows/order-coffee.uf.ts**
**./user-flows/basic-navigation.uf.ts**
```typescript
const interactions: UserFlowInteractionsFn = async (ctx: UserFlowContext): Promise<any> => {
// ...
Expand Down Expand Up @@ -182,7 +182,7 @@ const interactions: UserFlowInteractionsFn = async (ctx: UserFlowContext): Promi

2. Wrap the sections interesting for a snapshot measure with `await flow.snapshot({ stepName: 'step name' });`.

**./user-flows/order-coffee.uf.ts**
**./user-flows/basic-navigation.uf.ts**
```typescript
// Your custom interactions with the page
const interactions: UserFlowInteractionsFn = async (ctx: UserFlowContext): Promise<any> => {
Expand Down
1 change: 1 addition & 0 deletions packages/nx-plugin-integration/.user-flowrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
20 changes: 19 additions & 1 deletion packages/nx-plugin-integration/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
"serve": {
"executor": "@nx/webpack:dev-server",
"options": {
"buildTarget": "nx-plugin-integration:build"
"buildTarget": "nx-plugin-integration:build",
"port": 4010
},
"configurations": {
"production": {
Expand Down Expand Up @@ -82,6 +83,23 @@
"codeCoverage": true
}
}
},
"user-flow": {
"executor": "@push-based/user-flow-nx-plugin:user-flow",
"outputs": [
"{options.outputPath}"
],
"options": {
"url": "http://localhost:4010",
"rcPath": "packages/nx-plugin-integration/.user-flowrc.json",
"ufPath": "packages/nx-plugin-integration/user-flows",
"outputPath": "dist/user-flow/packages/nx-plugin-integration",
"format": [
"md"
],
"serveCommand": "npx run nx -- serve nx-plugin-integration",
"awaitServeStdout": "NX Web Development Server is listening at http://localhost:4010"
}
}
}
}
Loading

0 comments on commit 4e86008

Please sign in to comment.