-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a7fd00f
commit f82b14f
Showing
30 changed files
with
337 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
import { Card } from './card'; | ||
import { Locator, Page } from '@playwright/test'; | ||
import { Page } from '@playwright/test'; | ||
import { Address } from './address'; | ||
|
||
class CardWithAvs extends Card { | ||
readonly billingAddress: Address; | ||
|
||
constructor(page: Page, rootElementSelector: string = '.adyen-checkout__card-input') { | ||
constructor(page: Page, rootElementSelector: string) { | ||
super(page, rootElementSelector); | ||
this.billingAddress = new Address(page, `${rootElementSelector} .adyen-checkout__fieldset--billingAddress`); | ||
} | ||
|
||
async fillInPostCode(postCode: string) { | ||
await this.billingAddress.fillInPostCode(postCode); | ||
} | ||
} | ||
|
||
export { CardWithAvs }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Locator, Page } from '@playwright/test'; | ||
|
||
class Result { | ||
readonly result: Locator; | ||
|
||
constructor(page: Page) { | ||
this.result = page.getByTestId('result-message'); | ||
} | ||
|
||
get paymentResult() { | ||
return this.result.textContent(); | ||
} | ||
} | ||
|
||
export { Result }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import { expect, test } from '../../pages/cards/card.fixture'; | ||
|
||
test.describe('Card payments with address lookup', () => {}); | ||
|
||
test.describe('Card payments with partial avs', () => { | ||
test.describe('When fill in a valid the post code', () => { | ||
test.only('should make a successful card payment', async ({ cardPartialAvsPage }) => { | ||
const { cardWithAvs, payButton, paymentResult } = cardPartialAvsPage; | ||
await cardWithAvs.isComponentVisible(); | ||
/* await cardWithAvs.typeCardNumber(REGULAR_TEST_CARD); | ||
await cardWithAvs.typeCvc(TEST_CVC_VALUE); | ||
await cardWithAvs.typeExpiryDate(TEST_DATE_VALUE); | ||
await cardWithAvs.fillInPostCode(TEST_POSTCODE); | ||
await payButton.click();*/ | ||
await expect(payButton).toBeVisible(); | ||
}); | ||
}); | ||
|
||
test.describe('When fill in an invalid post code ', () => { | ||
// in the before hook, do not provide country code | ||
test('should not submit the payment', async ({ cardAvsPage }) => { | ||
// fill in card number | ||
// fill in expiry date | ||
// fill in cvc | ||
// fill in post code | ||
// click pay btn | ||
// expect to see error message under the post code field | ||
}); | ||
}); | ||
}); | ||
|
||
test.describe('Card payments with full avs', () => { | ||
test.describe('When fill in the valid address data', () => { | ||
test('should make a successful card payment', async ({ cardAvsPage }) => { | ||
// fill in card number | ||
// fill in expiry date | ||
// fill in cvc | ||
// fill in address ... | ||
// click pay btn | ||
// expect to see success result | ||
}); | ||
}); | ||
|
||
test.describe('When fill in the invalid address data', () => { | ||
test('should not submit the payment', async ({ cardAvsPage }) => { | ||
// fill in card number | ||
// fill in expiry date | ||
// fill in cvc | ||
// skip required fields in address section | ||
// click pay btn | ||
// expect to see error message | ||
}); | ||
}); | ||
|
||
test.describe('When switching to a different delivery country', () => { | ||
test('should make a successful card payment', async ({ cardAvsPage }) => { | ||
// prefilled wrong address | ||
// user sees error msg | ||
// change the country code | ||
// submit payment successfully | ||
}); | ||
test('should not submit the payment', async ({ cardAvsPage }) => { | ||
// prefilled correct address | ||
// change the country code | ||
// user sees error msg | ||
// user cannot submit payment | ||
}); | ||
}); | ||
}); |
92 changes: 92 additions & 0 deletions
92
packages/e2e-playwright/tests/card/bcmc/dualBranding.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import { test } from '../../../pages/cards/card.fixture'; | ||
|
||
test.describe('Bcmc payments with dual branding', () => { | ||
test.describe('Selecting the Bancontact brand', () => { | ||
test('should submit the bcmc payment', async () => { | ||
// should see the bcmc logo on init | ||
// fill in dual brand card maestro | ||
// expect to see 2 logos with correct order | ||
// select bcmc logo | ||
// expect to see the bcmc logo highlighted | ||
// click pay btn | ||
// expect to see success msg | ||
}); | ||
|
||
test('should not submit the bcmc payment with incomplete form data', async () => { | ||
// should see the bcmc logo on init | ||
// do not fill the expiry date | ||
// should see error msg | ||
}); | ||
|
||
test('should not submit the bcmc payment with invalid bcmc card number', async () => { | ||
// should see the bcmc logo on init | ||
// do not fill the expiry date | ||
// should see error msg | ||
}); | ||
}); | ||
|
||
test.describe('Selecting the maestro brand', () => { | ||
test('should submit the maestro payment', async () => { | ||
// should see the bcmc logo on init | ||
// fill in dual brand card maestro | ||
// expect to see 2 logos with correct order | ||
// select maestro logo | ||
// expect to see the maestro logo highlighted | ||
// click pay btn | ||
// expect to see success msg | ||
}); | ||
test('should not submit the maestro payment with incomplete form data', async () => { | ||
// should see the bcmc logo on init | ||
// do not fill the expiry date | ||
// should see error msg | ||
}); | ||
|
||
test('should not submit the maestro payment with invalid maestro card number', async () => { | ||
// should see the bcmc logo on init | ||
// wrong maestro card number | ||
// should see error msg | ||
}); | ||
}); | ||
|
||
test.describe('Selecting the visa brand', () => { | ||
test('should submit the visa payment', async () => { | ||
// should see the bcmc logo on init | ||
// fill in dual brand card visa | ||
// expect to see 2 logos with correct order | ||
// select visa logo | ||
// expect to see the visa logo highlighted | ||
// fill in the rest required fields | ||
// click pay btn | ||
// expect to see success msg | ||
}); | ||
|
||
test('should not submit the visa payment with incomplete form data', async () => { | ||
// should see the bcmc logo on init | ||
// do not fill the expiry date | ||
// should see error msg | ||
}); | ||
|
||
test('should not submit the visa payment with invalid visa card number', async () => { | ||
// should see the bcmc logo on init | ||
// wrong maestro card number | ||
// should see error msg | ||
}); | ||
}); | ||
|
||
test.describe('Selecting the mc brand', () => { | ||
test('should submit the mc payment', async () => { | ||
// should see the bcmc logo on init | ||
// fill in dual brand card mc | ||
// expect to see 2 logos with correct order | ||
// select mc logo | ||
// expect to see the mc logo highlighted | ||
// fill in the rest required fields | ||
// click pay btn | ||
// expect to see success msg | ||
}); | ||
|
||
test('should not submit the mc payment with incomplete form data', async () => {}); | ||
|
||
test('should not submit the mc payment with invalid mc card number', async () => {}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.