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

Can't tell if an assertion has been violated from CLI's output #215

Open
Pamplemousse opened this issue Apr 16, 2020 · 0 comments
Open

Can't tell if an assertion has been violated from CLI's output #215

Pamplemousse opened this issue Apr 16, 2020 · 0 comments

Comments

@Pamplemousse
Copy link

Pamplemousse commented Apr 16, 2020

When running from the CLI, it would be nice if:

  • The script returned an error when an assertion has been violated;
  • It would be possible for ZestAssertion to have an optional message field to have something to display if violated.

As of now, one can't tell if an ZestAssertion has been violated or not.

Here is a simple script.zst that I am using:

{
  "about": "This is a Zest script. For more details about Zest visit https://developer.mozilla.org/en-US/docs/Zest",
  "zestVersion": "0.8",
  "generatedBy": "OWASP ZAP Dev Build",
  "title": "Simple GET request",
  "description": "This Zest script is very humble.",
  "statements": [
    {
      "url": "http://juice-shop.herokuapp.com",
      "method": "GET",
      "assertions": [
        {
          "rootExpression": {
            "code": 200,
            "not": false,
            "elementType": "ZestExpressionStatusCode"
          },
          "elementType": "ZestAssertion"
        }
      ],
      "followRedirects": true,
      "index": 1,
      "enabled": true,
      "elementType": "ZestRequest"
    }
  ],
  "index": 0,
  "enabled": true,
  "elementType": "ZestScript"
}

When running this script with different values - true, and false - for the not field of the ZestAssertion, I always get the same result:

[nix-shell:~/Workspace/tools/zap/zest/zest]$ build/distributions/zest-0.15.0-SNAPSHOT/bin/zest -script examples/script.zst

[nix-shell:~/Workspace/tools/zap/zest/zest]$ echo $?
0
@thc202 thc202 added this to the 0.15.0 milestone Apr 16, 2020
@thc202 thc202 modified the milestones: 0.15.0, 0.16.0 Nov 24, 2020
@thc202 thc202 modified the milestones: 0.16.0, 0.17.0 Oct 6, 2022
@thc202 thc202 modified the milestones: 0.17.0, 0.18.0 Feb 17, 2023
@thc202 thc202 removed this from the 0.18.0 milestone Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants