Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add referencing steps as components #10

Merged
merged 2 commits into from
Mar 18, 2024

Conversation

kwalter94
Copy link
Contributor

  1. A new field named components is introduced
  2. The components field takes a list of namespaces
  3. Each namespace takes a list of components
  4. Steps can reference components through a componentId

A sample configuration below:

url: http://localhost:7654
dial: "*1234*1234#"
phoneNumber: 265888123456
sessions:
  - id: check-balance
    phoneNumber: 265888123456
    description: "Should return a balance of 500 for Zikani"
    steps:
      # Component IDs can be namespaced (e.g. default.login),
      # "default" namespace can be omitted as below
      - componentId: "login"
      - userInput: "Zikani"
        componentId: "default.home"
      - userInput: "2"
        componentId: "check-balance.display-balance"
  - id: update-account-name:
    steps:
        - componentId: "login"
        - userInput: "Zikani"
          componentId: "home"
        - userInput: "2"
          componentId: "account-detail.home"
        - userInput: 1
          expect: Enter your new name:
  - id: request-account-statement:
    steps:
        - componentId: "login"
        - userInput: "Zikani"
          componentId: "home"
        - userInput: "2"
          componentId: "account-detail.home"
        - userInput: 2
          expect: "Your statement is being processed!"
components:
  - namespace: default
    items:
      - id: login
        expect: "What is your name?"
      - id: home
        expect: |-
          Welcome, Zikani
          Choose an item:
          1. Account detail
          2. Balance
          3. Something else
          # Exit
  - namespace: check-balance
    items:
      - id: display-balance
        expect: "You are broke!"
  - namespace: account-detail
    items:
      - id: home
        expect: |-
          1. Change name
          2. Statement

Partially addresses #8

1. A new field named `components` is introduced
2. The components field takes a list of namespaces
3. Each namespace takes a list of components
4. Steps can reference components through a `componentId`

A sample configuration below:

```yaml
url: http://localhost:7654
dial: "*1234*1234#"
phoneNumber: 265888123456
sessions:
  - id: check-balance
    phoneNumber: 265888123456
    description: "Should return a balance of 500 for Zikani"
    steps:
      # Component IDs can be namespaced (e.g. default.login),
      # "default" namespace can be omitted as below
      - componentId: "login"
      - userInput: "Zikani"
        componentId: "default.home"
      - userInput: "2"
        componentId: "check-balance.display-balance"
  - id: update-account-name:
    steps:
        - componentId: "login"
        - userInput: "Zikani"
          componentId: "home"
        - userInput: "2"
          componentId: "account-detail.home"
        - userInput: 1
          expect: Enter your new name:
  - id: request-account-statement:
    steps:
        - componentId: "login"
        - userInput: "Zikani"
          componentId: "home"
        - userInput: "2"
          componentId: "account-detail.home"
        - userInput: 2
          expect: "Your statement is being processed!"
components:
  - namespace: default
    items:
      - id: login
        expect: "What is your name?"
      - id: home
        expect: |-
          Welcome, Zikani
          Choose an item:
          1. Account detail
          2. Balance
          3. Something else
          # Exit
  - namespace: check-balance
    items:
      - id: display-balance
        expect: "You are broke!"
  - namespace: account-detail
    items:
      - id: home
        expect: |-
          1. Change name
          2. Statement
```
@zikani03
Copy link
Member

@kwalter94 this is looking great, awesome work!

@zikani03 zikani03 merged commit bf6f597 into nndi-oss:main Mar 18, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants