Skip to content
Draft
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
75 changes: 71 additions & 4 deletions .github/workflows/core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,75 @@ jobs:
with:
useLockFile: false

- name: Run server
run: ./.github/scripts/runServer.sh
- name: Functional Non-Snapshot Tests (legacy + v2)
run: |
set +e

- name: Functional Non-Snapshot Tests
run: npm run test:func:nosnaps
ensure_hosts() {
if ! grep -q "localhost.paypal.com" /etc/hosts; then
echo "127.0.0.1 localhost.paypal.com" | sudo tee -a /etc/hosts >/dev/null
fi
}

start_server() {
local mode="$1"
local logFile="$2"

lsof -t -nP -iTCP:8080 -sTCP:LISTEN | xargs -r kill || true

if [[ "$mode" == "v2" ]]; then
(npm run dev:ci -- --env RENDER_V2_MESSAGE=true 2>&1 | tee "$logFile") &
else
(npm run dev:ci 2>&1 | tee "$logFile") &
fi

SERVER_PID=$!
sleep 40

error_count=$(grep -iv 'errorboundary' "$logFile" | grep -i 'error' | wc -l)
echo "[$mode] server errors found: $error_count"
if [[ "$error_count" -gt 0 ]]; then
echo "[$mode] server boot errors:" >&2
grep -i 'error' "$logFile" >&2 || true
return 1
fi
return 0
}

stop_server() {
if [[ -n "${SERVER_PID:-}" ]]; then
kill "$SERVER_PID" >/dev/null 2>&1 || true
wait "$SERVER_PID" 2>/dev/null || true
SERVER_PID=""
fi
}

ensure_hosts

LEGACY_STATUS=0
V2_STATUS=0

echo "Running legacy non-snapshot suite..."
if start_server "legacy" "server-legacy.log"; then
npm run test:func:nosnaps
LEGACY_STATUS=$?
else
LEGACY_STATUS=1
fi
stop_server

echo "Running v2 non-snapshot suite..."
if start_server "v2" "server-v2.log"; then
npm run test:func:nosnaps:v2
V2_STATUS=$?
else
V2_STATUS=1
fi
stop_server

echo "legacy exit: $LEGACY_STATUS"
echo "v2 exit: $V2_STATUS"

if [[ "$LEGACY_STATUS" -ne 0 || "$V2_STATUS" -ne 0 ]]; then
exit 1
fi
42 changes: 42 additions & 0 deletions content/messages/v2/AU/short-term_nq.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"id": "94a9d3d1-6f4f-4100-b83b-1b1fe5aec471",
"type": "PLST_NQ",
"offer_types": ["PAY_LATER_SHORT_TERM"],
"priority_rules": [
{
"type": "ELIGIBLE",
"priority_score": 3
}
],
"content": {
"main_items": [
{
"type": "IMAGE",
"name": "paypal_logo",
"source_url": "https://www.paypalobjects.com/upstream/assets/logos/v2/paypal_badge.svg",
"alternative_text": "PayPal"
},
{
"type": "TEXT",
"text": "Pay in "
},
{
"type": "TEXT_VARIABLE",
"name": "periodic_payment_count",
"text": "{PAY_LATER_SHORT_TERM.preferred_offer.periodic_payment_count}",
"text_path": "{PAY_LATER_SHORT_TERM.preferred_offer.financing_code}.periodic_payment_count"
},
{
"type": "TEXT",
"text": " interest-free payments on purchases under $2,000."
}
],
"action_items": [
{
"type": "LINK",
"text": "Learn more",
"click_url": "{click_url}"
}
]
}
}
52 changes: 52 additions & 0 deletions content/messages/v2/AU/short-term_q.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"id": "a5a8a34b-3fec-45da-9ad2-684c36502e61",
"type": "PLST_SQ",
"offer_types": ["PAY_LATER_SHORT_TERM"],
"priority_rules": [
{
"type": "QUALIFYING",
"priority_score": 6
}
],
"content": {
"main_items": [
{
"type": "IMAGE",
"name": "paypal_logo",
"source_url": "https://www.paypalobjects.com/upstream/assets/logos/v2/paypal_badge.svg",
"alternative_text": "PayPal"
},
{
"type": "TEXT",
"text": "Pay in "
},
{
"type": "TEXT_VARIABLE",
"name": "periodic_payment_count",
"text": "{PAY_LATER_SHORT_TERM.preferred_offer.periodic_payment_count}",
"text_path": "{PAY_LATER_SHORT_TERM.preferred_offer.financing_code}.periodic_payment_count"
},
{
"type": "TEXT",
"text": " interest-free payments of "
},
{
"type": "TEXT_VARIABLE",
"name": "periodic_payment",
"text": "{PAY_LATER_SHORT_TERM.preferred_offer.periodic_payment.formatted_value}",
"text_path": "{PAY_LATER_SHORT_TERM.preferred_offer.financing_code}.breakdown.periodic_payment.formatted_value"
},
{
"type": "TEXT",
"text": "."
}
],
"action_items": [
{
"type": "LINK",
"text": "Learn more",
"click_url": "{click_url}"
}
]
}
}
40 changes: 40 additions & 0 deletions content/messages/v2/DE/generic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"id": "fe7e77e9-5d1f-4745-9775-c3d26d303c18",
"type": "PL_GENERIC",
"offer_types": ["PAY_LATER_LONG_TERM", "PAY_LATER_PAY_IN_1"],
"priority_rules": [
{
"type": "ELIGIBLE",
"min_amount": "0.00",
"max_amount": "0.00",
"priority_score": 5
}
],
"content": {
"main_items": [
{
"type": "IMAGE",
"name": "paypal_logo",
"source_url": "https://www.paypalobjects.com/upstream/assets/logos/v2/paypal_badge.svg",
"alternative_text": "PayPal"
},
{
"type": "TEXT",
"text": "Jetzt kaufen, später bezahlen."
}
],
"disclaimer_items": [
{
"type": "TEXT",
"text": "Nur mit dt. PayPal Konto."
}
],
"action_items": [
{
"type": "LINK",
"text": "Mehr erfahren",
"click_url": "{click_url}"
}
]
}
}
50 changes: 50 additions & 0 deletions content/messages/v2/DE/long_term_multi_eqz.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"id": "c38c6d9d-4759-414b-8bca-e34138c972c1",
"type": "PLLT_MQ_EZ",
"offer_types": ["PAY_LATER_LONG_TERM"],
"priority_rules": [
{
"type": "QUALIFYING",
"multiple": true,
"apr": "0.00",
"priority_score": 8.1
}
],
"content": {
"main_items": [
{
"type": "IMAGE",
"name": "paypal_logo",
"source_url": "https://www.paypalobjects.com/upstream/assets/logos/v2/paypal_badge.svg",
"alternative_text": "PayPal"
},
{
"type": "TEXT",
"text": "0% eff. Jahreszins: ab "
},
{
"type": "TEXT_VARIABLE",
"name": "periodic_payment",
"text": "{PAY_LATER_LONG_TERM.periodic_payment.formatted_value}",
"text_path": "{PAY_LATER_LONG_TERM.preferred_offer.financing_code}.breakdown.periodic_payment.formatted_value"
},
{
"type": "TEXT",
"text": " pro Monat."
}
],
"disclaimer_items": [
{
"type": "TEXT",
"text": "Nur mit dt. PayPal Konto."
}
],
"action_items": [
{
"type": "LINK",
"text": "Mehr erfahren",
"click_url": "{click_url}"
}
]
}
}
49 changes: 49 additions & 0 deletions content/messages/v2/DE/long_term_multi_gtz.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"id": "7f38c610-7c72-461b-b926-865169fbb02a",
"type": "PLLT_MQ_GZ",
"offer_types": ["PAY_LATER_LONG_TERM"],
"priority_rules": [
{
"type": "QUALIFYING",
"multiple": true,
"priority_score": 8
}
],
"content": {
"main_items": [
{
"type": "IMAGE",
"name": "paypal_logo",
"source_url": "https://www.paypalobjects.com/upstream/assets/logos/v2/paypal_badge.svg",
"alternative_text": "PayPal"
},
{
"type": "TEXT",
"text": "Bezahlen Sie in bis zu "
},
{
"type": "TEXT_VARIABLE",
"name": "max_periodic_payment_count",
"text": "{PAY_LATER_LONG_TERM.max_periodic_payment_count}",
"text_path": "{PAY_LATER_LONG_TERM.preferred_offer.financing_code}.product.max_periodic_payment_count"
},
{
"type": "TEXT",
"text": " monatlichen Raten."
}
],
"disclaimer_items": [
{
"type": "TEXT",
"text": "Nur mit dt. PayPal Konto."
}
],
"action_items": [
{
"type": "LINK",
"text": "Mehr erfahren",
"click_url": "{click_url}"
}
]
}
}
75 changes: 75 additions & 0 deletions content/messages/v2/DE/long_term_nq_eqz.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"id": "a934c1c0-627c-4a44-8fd9-18e506a88ae7",
"type": "PLLT_NQ_EZ",
"offer_types": ["PAY_LATER_LONG_TERM"],
"priority_rules": [
{
"type": "ELIGIBLE",
"min_amount": "${ctx.PAY_LATER_LONG_TERM.max_amount.value}",
"apr": "0.00",
"priority_score": 4.1
},
{
"type": "ELIGIBLE",
"apr": "0.00",
"priority_score": 2.1
}
],
"content": {
"main_items": [
{
"type": "IMAGE",
"name": "paypal_logo",
"source_url": "https://www.paypalobjects.com/upstream/assets/logos/v2/paypal_badge.svg",
"alternative_text": "PayPal"
},
{
"type": "TEXT",
"text": "0% eff. Jahreszins: Bezahlen Sie in bis zu "
},
{
"type": "TEXT_VARIABLE",
"name": "max_periodic_payment_count",
"text": "{PAY_LATER_LONG_TERM.max_periodic_payment_count}",
"text_path": "{PAY_LATER_LONG_TERM.preferred_offer.financing_code}.product.max_periodic_payment_count"
},
{
"type": "TEXT",
"text": " monatlichen Raten bei Einkäufen i.H.v. "
},
{
"type": "TEXT_VARIABLE",
"name": "min_amount",
"text": "{PAY_LATER_LONG_TERM.min_amount.formatted_value}",
"text_path": "{PAY_LATER_LONG_TERM.preferred_offer.financing_code}.min_amount.formatted_value"
},
{
"type": "TEXT",
"text": "-"
},
{
"type": "TEXT_VARIABLE",
"name": "max_amount",
"text": "{PAY_LATER_LONG_TERM.max_amount.formatted_value}",
"text_path": "{PAY_LATER_LONG_TERM.preferred_offer.financing_code}.max_amount.formatted_value"
},
{
"type": "TEXT",
"text": "."
}
],
"disclaimer_items": [
{
"type": "TEXT",
"text": "Nur mit dt. PayPal Konto."
}
],
"action_items": [
{
"type": "LINK",
"text": "Mehr erfahren",
"click_url": "{click_url}"
}
]
}
}
Loading
Loading