Skip to content
This repository has been archived by the owner on May 20, 2021. It is now read-only.

Sequence diagram #9

Open
aslakhellesoy opened this issue Apr 25, 2019 · 1 comment
Open

Sequence diagram #9

aslakhellesoy opened this issue Apr 25, 2019 · 1 comment

Comments

@aslakhellesoy
Copy link
Contributor

aslakhellesoy commented Apr 25, 2019

Cucumber engine offers a message-based API for front-ends and reporters.

In order to understand the design of this message protocol, it would be useful to have a sequence diagram illustrating what messages are exhanged, in what order, in what direction, and between what components.

This diagram should ideally be generated from source - living documentation. This can be done by annotating the messages.proto file, and generating a file that can be further processed by a diagramming tool, such as:

@charlierudolph
Copy link
Contributor

Put this together:

diagram

Source:

@startuml

group command flow

  Caller -> Engine : CommandStart
  note left: this is the first message

  group
    Engine -> Caller : CommandRunBeforeTestRunHooks
    Caller -> Engine : CommandActionComplete
  end

  loop for each test case
    Engine -> Caller : CommandInitializeTestCase
    Caller -> Engine : CommandActionComplete

    loop for each before test case hook
      Engine -> Caller : CommandRunBeforeTestCaseHook
      Caller -> Engine : CommandActionComplete
    end

    loop for each test step
      alt with step definition
        Engine -> Caller : CommandRunTestStep
        Caller -> Engine : CommandActionComplete
      else without step definition
        Engine -> Caller : CommandGenerateSnippet
        Caller -> Engine : CommandActionComplete
      end
    end

    loop for each after test case hook
      Engine -> Caller : CommandRunAfterTestCaseHook
      Caller -> Engine : CommandActionComplete
    end
  end

  group
    Engine -> Caller : CommandRunAfterTestRunHooks
    Caller -> Engine : CommandActionComplete
  end
end

group events (sent through out the command flow)
  Engine -> Caller: TestRunStarted
  Engine -> Caller: Source
  Engine -> Caller: GherkinDocument
  Engine -> Caller: Pickle
  Engine -> Caller: PickleAccepted
  Engine -> Caller: PickleRejected
  Engine -> Caller: Attachment
  Engine -> Caller: TestCasePrepared
  Engine -> Caller: TestCaseStarted
  Engine -> Caller: TestStepStarted
  Engine -> Caller: TestStepFinished
  Engine -> Caller: TestCaseFinished
  Engine -> Caller: TestRunFinished
  note right: this is the last message
end

@enduml

Diagram generated from inserting the source here: http://www.plantuml.com/plantuml

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants