Closed bcecchinato closed 3 months ago
Hello !
Lots of our tests are time based, which forces us to add a lot of "sleep tests". For example, here is on of our test case :
- name: "SPDU 20-4008 - TC03 - State" steps: - name: "Assert Output ON_CHARGE" type: http method: GET url: "{{ .env.gateway }}/v2/pdu/{{ .params.address }}/status" headers: Content-Type: "application/json" Accept: "application/json" ignore_verify_ssl: true timeout: '{{ .env.timeout }}' assertions: - result.statuscode MustEqual 200 - result.bodyjson.board MustEqual "OK" - result.bodyjson.outputs.{{ .params.output }} MustEqual "ON_CHARGE" - name: "Assert Output Disable" type: http method: PUT url: "{{ .env.gateway }}/v2/pdu/{{ .params.address }}/status?output={{ .params.output }}" body: | {"enabled": false} headers: Content-Type: "application/json" Accept: "application/json" ignore_verify_ssl: true timeout: '{{ .env.timeout }}' assertions: - result.statuscode MustEqual 202 - name: "Assert Wait 5s" type: exec script: sleep 5 assertions: - result.code MustEqual 0 - name: "Assert Output OFF" type: http method: GET url: "{{ .env.gateway }}/v2/pdu/{{ .params.address }}/status" headers: Content-Type: "application/json" Accept: "application/json" ignore_verify_ssl: true timeout: '{{ .env.timeout }}' assertions: - result.statuscode MustEqual 200 - result.bodyjson.board MustEqual "OK" - result.bodyjson.outputs.{{ .params.output }} MustEqual "OFF" - name: "Assert Output Enable" type: http method: PUT url: "{{ .env.gateway }}/v2/pdu/{{ .params.address }}/status?output={{ .params.output }}" body: | {"enabled": true} headers: Content-Type: "application/json" Accept: "application/json" ignore_verify_ssl: true timeout: '{{ .env.timeout }}' assertions: - result.statuscode MustEqual 202 - name: "Assert Wait 5s" type: exec script: sleep 5 assertions: - result.code MustEqual 0 - name: "Assert Output ON_CHARGE" type: http method: GET url: "{{ .env.gateway }}/v2/pdu/{{ .params.address }}/status" headers: Content-Type: "application/json" Accept: "application/json" ignore_verify_ssl: true timeout: '{{ .env.timeout }}' assertions: - result.statuscode MustEqual 200 - result.bodyjson.board MustEqual "OK" - result.bodyjson.outputs.{{ .params.output }} MustEqual "ON_CHARGE"
The delay is only used in case of a retryable test. Would it be possible to use the delay in case of non-retryable test. It would then be possible to remove a lot of unecessary tests like our "Assert Wait Xs".
delay
"Assert Wait Xs"
Why closing this issue as it's not treated or fixed ?
Not planned, but you can use a user executor to factorize the http requestion with wait after. It will be much more readeable.
Hello !
Lots of our tests are time based, which forces us to add a lot of "sleep tests". For example, here is on of our test case :
The
delay
is only used in case of a retryable test. Would it be possible to use thedelay
in case of non-retryable test. It would then be possible to remove a lot of unecessary tests like our"Assert Wait Xs"
.