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

Added compatibility with new Docker (compose) version and improved haveOrder helper. #36

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env-default
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ K6_HTTP_DEBUG=
# This variable is the path to the script file that K6 will execute during the test.
# The test script is a JavaScript file that contains the test scenarios and configuration for the test.
# This variable should be set to the path of the script file that should be run.
K6_SCRIPT=tests/example-scenario.js
K6_SCRIPT=tests/abstract-scenario.js

###################################
# Spryker Test Framework Settings #
Expand Down
12 changes: 11 additions & 1 deletion shell/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,17 @@ build_k6_docker_command() {
return 1;
fi

command="docker-compose run --rm \
if docker compose version >/dev/null 2>&1; then
DOCKER_COMPOSE="docker compose"
# Check if 'docker-compose' is available
elif docker-compose --version >/dev/null 2>&1; then
DOCKER_COMPOSE="docker-compose"
else
echo "Neither 'docker compose' nor 'docker-compose' is available. Please install one of them."
exit 1
fi

command="$DOCKER_COMPOSE run --rm \
-v $(pwd):/scripts \
-u $(id -u):$(id -g) \
-e 'SPRYKER_TEST_RUN_ID=$testRunId' \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class SharedCheckoutScenario extends AbstractScenario {
}

const checkoutResponse = this.http.sendPostRequest(
this.http.url`${this.getStorefrontApiBaseUrl()}/checkout?include=orders`,
this.http.url`${this.getStorefrontApiBaseUrl()}/checkout`,
JSON.stringify(this._getCheckoutData(cartId, customerEmail, isMpPaymentProvider)),
requestParams,
false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ export function execute(data) {
const checkoutResponseJson = sharedCheckoutScenario.haveOrder(customerEmail, quoteIds[quoteIndex], false);

// Reorder
sharedCartReorderScenario.execute(customerEmail, checkoutResponseJson.data.relationships.orders.data[0].id, thresholdTag);
sharedCartReorderScenario.execute(customerEmail, checkoutResponseJson.data.attributes.orderReference, thresholdTag);
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ export function execute(data) {
const checkoutResponseJson = sharedCheckoutScenario.haveOrder(customerEmail, quoteIds[quoteIndex], false);

// Reorder
sharedCartReorderScenario.execute(customerEmail, checkoutResponseJson.data.relationships.orders.data[0].id, thresholdTag);
sharedCartReorderScenario.execute(customerEmail, checkoutResponseJson.data.attributes.orderReference, thresholdTag);
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ export function execute(data) {
const checkoutResponseJson = sharedCheckoutScenario.haveOrder(customerEmail, quoteIds[quoteIndex], false);

// Reorder
sharedCartReorderScenario.execute(customerEmail, checkoutResponseJson.data.relationships.orders.data[0].id, thresholdTag);
sharedCartReorderScenario.execute(customerEmail, checkoutResponseJson.data.attributes.orderReference, thresholdTag);
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ export function execute(data) {
const checkoutResponseJson = sharedCheckoutScenario.haveOrder(customerEmail, quoteIds[quoteIndex], false);

// Reorder
sharedCartReorderScenario.execute(customerEmail, checkoutResponseJson.data.relationships.orders.data[0].id, thresholdTag);
sharedCartReorderScenario.execute(customerEmail, checkoutResponseJson.data.attributes.orderReference, thresholdTag);
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ export function execute(data) {
const checkoutResponseJson = sharedCheckoutScenario.haveOrder(customerEmail, quoteIds[quoteIndex], false);

// Edit an order
sharedOrderAmendmentScenario.execute(customerEmail, checkoutResponseJson.data.relationships.orders.data[0].id, thresholdTag);
sharedOrderAmendmentScenario.execute(customerEmail, checkoutResponseJson.data.attributes.orderReference, thresholdTag);
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function execute(data) {
// Edit an order
const cartReorderResponseJson = sharedOrderAmendmentScenario.haveOrderAmendment(
customerEmail,
checkoutResponseJson.data.relationships.orders.data[0].id
checkoutResponseJson.data.attributes.orderReference
);

// Place an updated order
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ export function execute(data) {
const checkoutResponseJson = sharedCheckoutScenario.haveOrder(customerEmail, quoteIds[quoteIndex], false);

// Edit an order
sharedOrderAmendmentScenario.execute(customerEmail, checkoutResponseJson.data.relationships.orders.data[0].id, thresholdTag);
sharedOrderAmendmentScenario.execute(customerEmail, checkoutResponseJson.data.attributes.orderReference, thresholdTag);
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function execute(data) {
// Edit an order
const cartReorderResponseJson = sharedOrderAmendmentScenario.haveOrderAmendment(
customerEmail,
checkoutResponseJson.data.relationships.orders.data[0].id
checkoutResponseJson.data.attributes.orderReference
);

// Place an updated order
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ export function execute(data) {
const checkoutResponseJson = sharedCheckoutScenario.haveOrder(customerEmail, quoteIds[quoteIndex], false);

// Edit an order
sharedOrderAmendmentScenario.execute(customerEmail, checkoutResponseJson.data.relationships.orders.data[0].id, thresholdTag);
sharedOrderAmendmentScenario.execute(customerEmail, checkoutResponseJson.data.attributes.orderReference, thresholdTag);
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function execute(data) {
// Edit an order
const cartReorderResponseJson = sharedOrderAmendmentScenario.haveOrderAmendment(
customerEmail,
checkoutResponseJson.data.relationships.orders.data[0].id
checkoutResponseJson.data.attributes.orderReference
);

// Place an updated order
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ export function execute(data) {
const checkoutResponseJson = sharedCheckoutScenario.haveOrder(customerEmail, quoteIds[quoteIndex], false);

// Edit an order
sharedOrderAmendmentScenario.execute(customerEmail, checkoutResponseJson.data.relationships.orders.data[0].id, thresholdTag);
sharedOrderAmendmentScenario.execute(customerEmail, checkoutResponseJson.data.attributes.orderReference, thresholdTag);
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function execute(data) {
// Edit an order
const cartReorderResponseJson = sharedOrderAmendmentScenario.haveOrderAmendment(
customerEmail,
checkoutResponseJson.data.relationships.orders.data[0].id
checkoutResponseJson.data.attributes.orderReference
);

// Place an updated order
Expand Down
Loading