Skip to content

Conversation

@fabong
Copy link

@fabong fabong commented Apr 24, 2017

Hi,

In order to have a complete test, I needed to handle multi-responses with socketio on different channels. This pull-request adds the support of it.

Here is some examples of supported configurations :

2 responses sent on different channels :

scenarios:
  -
    engine: "socketio"
    flow:
      -
        emit:
          channel: "echo"
          data: "hello"
          response:
           - 
              channel: "echoed"
              data: "hello"
           -
              channel: "ack"
              data: "ack"

2 responses sent on the same channel and another one sent on different channel :

scenarios:
  -
    engine: "socketio"
    flow:
      -
        emit:
          channel: "echo"
          data: "hello"
          response:
           - 
              channel: "ack"
              data: "ack"
           -
              channel: "msg"
              data: "response1"
           -
              channel: "msg"
              data: "response2"

In that case, I assume that messages on the same channel should be sent in the same order as defined.

Because it is just an array support of the response existing parameters, it also works with the current configuration as :

scenarios:
  -
    engine: "socketio"
    flow:
      -
        emit:
          channel: "echo"
          data: "hello"
          response:
            channel: "ack"
            data: "ack"

What do you think about it ?

Thanks in advance,
Fabrice.

@fabong fabong force-pushed the feature/handleMultiResponseSocketio branch from f68e97e to 0c0f814 Compare April 24, 2017 12:51
@hassy
Copy link
Member

hassy commented Apr 27, 2017

Nice. Would it make sense to support a timeout option, which would abort the scenario with an error if the responses aren't received within a certain time window?

@fabong
Copy link
Author

fabong commented May 10, 2017

Yes, you're right, it should be a good feature. I'll implement it next week.

@fabong fabong force-pushed the feature/handleMultiResponseSocketio branch from 6e34ca0 to aa39e6c Compare May 10, 2017 15:29
@fabong fabong force-pushed the feature/handleMultiResponseSocketio branch from aa39e6c to 8acba11 Compare May 22, 2018 15:29
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