From 236e90fc953aad8c871f501f36cf08d29d8b9634 Mon Sep 17 00:00:00 2001 From: Jacob Tobiasz Date: Mon, 16 Sep 2024 20:36:38 +0200 Subject: [PATCH] debug --- .github/workflows/ci.yaml | 21 ++++++++++++--- .github/workflows/ci__daily.yaml | 1 + .github/workflows/ci__pr.yaml | 1 + assets/shop/js/card_encoder.js | 27 +++++++++++++++++++ tests/Application/.env.test | 2 ++ tests/Application/package.json | 3 +++ .../E2E/Checkout/TpayPaymentCheckoutTest.php | 2 ++ 7 files changed, 53 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f33de4d2..235ff12d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -8,6 +8,19 @@ on: description: "Type of the build" required: true type: string + secrets: + TPAY_CLIENT_ID: + description: '' + required: true + TPAY_CLIENT_SECRET: + description: '' + required: true + TPAY_CARDS_API: + description: '' + required: true + PAYUM_CYPHER_KEY: + description: '' + required: true jobs: get-matrix: @@ -46,10 +59,10 @@ jobs: PANTHER_NO_SANDBOX: 1 PANTHER_CHROME_ARGUMENTS: '--disable-dev-shm-usage --window-size=1400,900' TPAY_API_URL: 'http://localhost:4000' - TPAY_CLIENT_ID: ${{ secrets.TPAY_CLIENT_ID }} - TPAY_CLIENT_SECRET: ${{ secrets.TPAY_CLIENT_SECRET }} - TPAY_CARDS_API: ${{ secrets.TPAY_CARDS_API }} - PAYUM_CYPHER_KEY: ${{ secrets.PAYUM_CYPHER_KEY }} + TPAY_CLIENT_ID: '${{ secrets.TPAY_CLIENT_ID }}' + TPAY_CLIENT_SECRET: '${{ secrets.TPAY_CLIENT_SECRET }}' + TPAY_CARDS_API: '${{ secrets.TPAY_CARDS_API }}' + PAYUM_CYPHER_KEY: '${{ secrets.PAYUM_CYPHER_KEY }}' steps: - diff --git a/.github/workflows/ci__daily.yaml b/.github/workflows/ci__daily.yaml index 0c108892..3441cbd9 100644 --- a/.github/workflows/ci__daily.yaml +++ b/.github/workflows/ci__daily.yaml @@ -16,3 +16,4 @@ jobs: uses: ./.github/workflows/ci.yaml with: type: "daily" + secrets: inherit diff --git a/.github/workflows/ci__pr.yaml b/.github/workflows/ci__pr.yaml index f5b65eb5..a154e9b6 100644 --- a/.github/workflows/ci__pr.yaml +++ b/.github/workflows/ci__pr.yaml @@ -20,3 +20,4 @@ jobs: uses: ./.github/workflows/ci.yaml with: type: "pr" + secrets: inherit diff --git a/assets/shop/js/card_encoder.js b/assets/shop/js/card_encoder.js index 787eb96c..6fb107f3 100644 --- a/assets/shop/js/card_encoder.js +++ b/assets/shop/js/card_encoder.js @@ -1,4 +1,31 @@ import * as JSEncrypt from './jsencrypt.min'; +import * as Sentry from "@sentry/browser"; + +Sentry.init({ + dsn: "https://b4aeb8f84d49fdbae7d336d446bf46b6@o4507962673725440.ingest.de.sentry.io/4507962677395536", + + // Alternatively, use `process.env.npm_package_version` for a dynamic release version + // if your build tool supports it. + release: "my-project-name@2.3.12", + integrations: [ + Sentry.browserTracingIntegration(), + Sentry.replayIntegration(), + Sentry.captureConsoleIntegration(), + ], + + // Set tracesSampleRate to 1.0 to capture 100% + // of transactions for tracing. + // We recommend adjusting this value in production + tracesSampleRate: 1.0, + + // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], + + // Capture Replay for 10% of all sessions, + // plus for 100% of sessions with an error + replaysSessionSampleRate: 0.1, + replaysOnErrorSampleRate: 1.0, +}); document.addEventListener('DOMContentLoaded', () => { const form = document.querySelector('[name="sylius_checkout_complete"]'); diff --git a/tests/Application/.env.test b/tests/Application/.env.test index 91bd192e..42688885 100644 --- a/tests/Application/.env.test +++ b/tests/Application/.env.test @@ -11,3 +11,5 @@ SYLIUS_MESSENGER_TRANSPORT_MAIN_FAILED_DSN=sync:// SYLIUS_MESSENGER_TRANSPORT_CATALOG_PROMOTION_REMOVAL_DSN=sync:// SYLIUS_MESSENGER_TRANSPORT_CATALOG_PROMOTION_REMOVAL_FAILED_DSN=sync:// ###< symfony/messenger ### + +TPAY_CARDS_API=LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0NCk1JR2ZNQTBHQ1NxR1NJYjNEUUVCQVFVQUE0R05BRENCaVFLQmdRQ3ZQc2lCOWZuR0FMd1ZKSnpaM2tOdEw1MVcNCjRGcm1zOXcyWS9vRTY0VmRNM1NFaC83d1orRWZCWlltYUdtcEJkelpOTzZXMDhxd0NkT0Jwa3YxR2k5UnlKQTANCkRsMk5oSURlbnRSSWd2VXR5UllJdVZza3BrcDh3M1pmYTh2akJWdlJYZTRHUERjeEMvVXc4S29heU5oVlhKZnENCnlJZHhEYTRMRHdjRWtJWlE1UUlEQVFBQg0KLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0t diff --git a/tests/Application/package.json b/tests/Application/package.json index b428c24b..8e6a53c8 100644 --- a/tests/Application/package.json +++ b/tests/Application/package.json @@ -9,5 +9,8 @@ }, "devDependencies": { "@sylius-ui/frontend": "^1.0" + }, + "dependencies": { + "@sentry/browser": "^8.30.0" } } diff --git a/tests/E2E/Checkout/TpayPaymentCheckoutTest.php b/tests/E2E/Checkout/TpayPaymentCheckoutTest.php index 1e2cd745..49d44c6a 100644 --- a/tests/E2E/Checkout/TpayPaymentCheckoutTest.php +++ b/tests/E2E/Checkout/TpayPaymentCheckoutTest.php @@ -49,7 +49,9 @@ public function test_it_completes_the_checkout(): void public function test_it_completes_the_checkout_using_credit_card(): void { $this->processWithPaymentMethod('tpay_card'); + file_put_contents(dirname(__DIR__, 3) . '/tests/Application/var/log/one.html', $this->client->getPageSource()); $this->fillCardData('John Doe', self::CARD_NUMBER, '123', '01', '2029'); + file_put_contents(dirname(__DIR__, 3) . '/tests/Application/var/log/two.html', $this->client->getPageSource()); $this->placeOrder(); $this->assertPageTitleContains('Thank you!');