Giter VIP home page Giter VIP logo

adyen-testing-suite's People

Contributors

ayodejidev avatar dependabot[bot] avatar gcatanese avatar jlengrand avatar kwok-he-chu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

adyen-testing-suite's Issues

Add E2E tests for subscriptions

Extend/release a new version of the testing-suite to include E2E-testing for subscriptions in adyen-examples/adyen-dotnet-online-payments#47

E2E tests are added for subscriptions, scope: card-only:

  • Webhook fail scenario when hmac is not valid
  • Initial tokenization (payment request with 0 amount) success scenario
  • Initial tokenization (payment request with 0 amount) fail scenario
    Initialize payment request success scenario
    Initialize payment request failure scenario
    Initialize payment disable success scenario
    Initialize payment disable failure scenario

Credit Card test scenario

The Credit Card payment test scenario currently verifies the Credit Card form is filled. Extend the test case to include an actual payment.

Note: Credit Card number text field and CVC are included within an iframe (security reasons)

Following the README leads to an error

When following the READMe, it looks like some dependencies are not installed when trying to run the test suite :



  3) [chromium] › ideal.spec.js:4:1 › iDEAL ========================================================

    browserType.launch: Executable doesn't exist at /Users/julien/Library/Caches/ms-playwright/chromium-939194/chrome-mac/Chromium.app/Contents/MacOS/Chromium
    ╔═════════════════════════════════════════════════════════════════════════╗
    ║ Looks like Playwright Test or Playwright was just installed or updated. ║
    ║ Please run the following command to download new browsers:              ║
    ║                                                                         ║
    ║     npx playwright install                                              ║
    ║                                                                         ║
    ║ <3 Playwright Team                                                      ║
    ╚═════════════════════════════════════════════════════════════════════════╝


Structure folders in preparation for more E2E testing-suites

Description
To make room for additional tests, we would like to add support for subscription-e2e tests (and more) in the near future. For this change to happen, we need to be able to run specific tests within folder using npx playwright test FOLDERNAME

Acceptance Criteria

  • We allow the developer to run different tests when spinning up the Docker image (by specifying which subfolder of tests to run in its parameters)
  • When no parameter is provided to the image, the default should run the checkout e2e tests (aka. card, dropin, ideal, webhook - This ensures that existing repositories with e2e-tests wont' fail).
  • We use one dockerized image for the testing-suite

E2E test for pre-authorisation flows

As pointed out in #52 we don't have E2E tests that validate the possible flows.

Extend the E2E testing for the subscription use case to cover the following:

  • Verify that the admin view is visible after sending the webhook containing the merchantReference (AUTHORISATION eventcode)

  • Add adjustment test

  • Mock the AUTHORISATION_ADJUSTMENT webhook and verify that the admin view has changed
    - [x] Add extension test (it's similar to adjustment, unless we want to test this specifically, I'd leave this one out)

  • Add capture test (verify that the next screen is green)

  • Mock CAPTURE webhook

  • Add reversal test (verify that the next screen is green)

  • Mock the CANCEL_OR_REFUND webhook

  • Mock CAPTURE_FAILED (or CAPTURE, success=false) webhook and verify that we have a reversed item in the admin view

Unify test to only support Adyen-Web Dropin 5.33.x or higher when clicking on button

Description
In Adyen-Web Dropin 5.33.x or higher (Adyen/adyen-web#1868), we added a role "radio" to the buttons (and removed the aria-label). To make the changes backwards compatible with earlier versions we had to modify the tests to cover both cases.

const radioButton = await page.getByRole('radio', { name: 'Credit or debit card' });
    if (await radioButton.count() === 0) {
        // Click normal button for < Adyen-Web 5.32.x or lower
        await page.getByRole('button', { name: 'Credit or debit card' }).click();
    }
    else {
        // Click radio button for > Adyen-Web 5.33.x or higher
        await radioButton.click();
    }

Once we've upgraded all samples to 5.33.x or higher, we can remove these checks:

https://github.com/adyen-examples/adyen-testing-suite/blob/main/tests/subscription/dropin-card.spec.js#L20-L27
https://github.com/adyen-examples/adyen-testing-suite/blob/main/tests/checkout/dropin-card.spec.js#L20-L27

Food for thought:
This means that those who use the E2E playwright framework and use the getByRole('button', ...) function to test their drop-in integration will have to change it to getByRole('radio', ...)

Fix klarna E2E test

Description:
Expected string: "Je bestelling afronden"
Actual string: "Complete your purchase"

image

Proposed fix:
Use a selector that is language independent. @gcatanese

E2E testing webhook with successful HMAC validation

The E2E Testing Suite includes a test to verify the webhook receives the payload and returns 401 (as HMAC Validation fails).

Create a new test that can verify the HMAC signature is valid and the payload can be processed

Note: we need to identify a way to create a valid HMAC signature for running the E2E testing suite

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.