Skip to content

Commit

Permalink
bruno collection updates
Browse files Browse the repository at this point in the history
  • Loading branch information
szczecha committed Aug 27, 2024
1 parent 1794d5b commit 836e895
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 22 deletions.
8 changes: 8 additions & 0 deletions apps/avatax/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,17 @@ After that, you have to prepare an environment for Bruno. Environments are a set
To use your own storefront user create `.env` file inside `bruno` folder with:

```
SALEOR_API_URL=
STOREFRONT_USER_EMAIL=
STOREFRONT_USER_PASSWORD=
STOREFRONT_USER_NAME=
STAFF_USER_EMAIL=
STAFF_USER_PASSWORD=
CHANNEL_SLUG=
PROMO_CODE=
```

The app has an example environment for `localhost` in `environments/localhost.bru`. You can copy it to bootstrap your own environment e.g `cloud.bru` (which will be ignored by git).
Expand Down
7 changes: 6 additions & 1 deletion apps/avatax/bruno/.env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
SALEOR_API_URL=

STOREFRONT_USER_EMAIL=
STOREFRONT_USER_PASSWORD=
STOREFRONT_USER_NAME=

STAFF_USER_EMAIL=
STAFF_USER_PASSWORD=
STAFF_USER_PASSWORD=

CHANNEL_SLUG=
PROMO_CODE=
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,5 @@ body:graphql:vars {

vars:post-response {
checkoutId: res.body.data.checkoutCreate.checkout.id
shippingMethodId: res.body.data.checkoutCreate.checkout.shippingMethods[1].id
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ body:graphql {
body:graphql:vars {
{
"checkoutId": "{{checkoutId}}",
"deliveryMethodId": "{{deliveryMethodId}}"
"deliveryMethodId": "{{shippingMethodId}}"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ body:graphql {
}
checkout {
id
voucherCode
lines {
variant {
name
Expand Down
File renamed without changes.
16 changes: 0 additions & 16 deletions apps/avatax/bruno/Draft Orders/01_Create_staff_token.bru
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,3 @@ body:graphql:vars {
vars:post-response {
staffToken: res.body.data.tokenCreate.token
}

script:pre-request {
const { faker } = require('@faker-js/faker');

const configuredEmail = bru.getProcessEnv("STAFF_USER_EMAIL");

if (configuredEmail) {
bru.setVar("staffUserEmail", configuredEmail);
}

const configuredPassword = bru.getProcessEnv("STAFF_USER_PASSWORD");

if (configuredPassword) {
bru.setVar("staffUserPassword", configuredPassword);
}
}
9 changes: 5 additions & 4 deletions apps/avatax/bruno/environments/staging.bru
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
vars {
API_URL: https://shopex-avatax-318.eu.saleor.cloud/graphql/
deliveryMethodId: U2hpcHBpbmdNZXRob2Q6MTQ=
channel_USD: channel-us
promoCode: ""
channel_USD: {{process.env.CHANNEL_SLUG}}
promoCode: {{process.env.PROMO_CODE}}
staffUserEmail: {{process.env.STAFF_USER_EMAIL}}
staffUserPassword: {{process.env.STAFF_USER_PASSWORD}}
API_URL: {{process.env.SALEOR_API_URL}}
}

0 comments on commit 836e895

Please sign in to comment.