From be1bb520a0cdc6f44d10834f1f15b6c76f73254a Mon Sep 17 00:00:00 2001 From: liyasthomas Date: Tue, 22 Feb 2022 12:29:17 +0530 Subject: [PATCH] feat: add new variables to globals or create new environment --- .../components/environments/Add.vue | 13 +++- .../components/http/TestResult.vue | 60 ++++++++++++++++++- .../hoppscotch-app/helpers/testSnippets.js | 5 ++ 3 files changed, 74 insertions(+), 4 deletions(-) diff --git a/packages/hoppscotch-app/components/environments/Add.vue b/packages/hoppscotch-app/components/environments/Add.vue index 2188289e7..f8da6289e 100644 --- a/packages/hoppscotch-app/components/environments/Add.vue +++ b/packages/hoppscotch-app/components/environments/Add.vue @@ -38,12 +38,18 @@ diff --git a/packages/hoppscotch-app/helpers/testSnippets.js b/packages/hoppscotch-app/helpers/testSnippets.js index 594caef19..002d39578 100644 --- a/packages/hoppscotch-app/helpers/testSnippets.js +++ b/packages/hoppscotch-app/helpers/testSnippets.js @@ -1,4 +1,9 @@ export default [ + { + name: "Environment: Set an environment variable", + script: `\n\n// Set an environment variable +pw.env.set("variable", "value");`, + }, { name: "Response: Status code is 200", script: `\n\n// Check status code is 200