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

Commits on Mar 13, 2024

  1. Add referencing steps as components

    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
    ```
    kwalter94 committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    3662036 View commit details
    Browse the repository at this point in the history
  2. Typo fix

    kwalter94 committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    3e1d96b View commit details
    Browse the repository at this point in the history