adyen-examples / adyen-testing-suite Goto Github PK
View Code? Open in Web Editor NEWEnd-to-end testing of Adyen sample applications
End-to-end testing of Adyen sample applications
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:
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)
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 ║
╚═════════════════════════════════════════════════════════════════════════╝
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
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
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', ...)
Current version: FROM mcr.microsoft.com/playwright:v1.16.2-focal
Acceptance Critiria
Description:
Expected string: "Je bestelling afronden"
Actual string: "Complete your purchase"
Proposed fix:
Use a selector that is language independent. @gcatanese
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.