my application is about making payments.
when i enter the details of a creditcard it will redirect me to a processing page and give a confirmation number which is working fine when i test. but when i give an invalid card number it will still redirect to processing page stay for a sec and coms back to home page with a popup saying invalid details but i was unable to catch that. i tried navigating but didn't help what should i do
my code looks like
step definitions:
Then(/^The confirmation number is visible$/, async () => {
await client.url(${client.launch_url}/confirmation)
await paymentFormPage.waitForElementVisible('@oneTimePaymentSuccess')
})
Then(/^The confirmation number is not visible$/, async (oldVal, newVal, browser) => {
await client.url(${client.launch_url}/confirmation)
await paymentFormPage.waitForElementVisible('@invalidCreditCard')
})
Given I launch mysite
And I enter
Then I submit the payment
Then The confirmation number is visible
Given I launch mysite
And I enter
Then I submit the payment
Then The confirmation number is not visible
my application is about making payments. when i enter the details of a creditcard it will redirect me to a processing page and give a confirmation number which is working fine when i test. but when i give an invalid card number it will still redirect to processing page stay for a sec and coms back to home page with a popup saying invalid details but i was unable to catch that. i tried navigating but didn't help what should i do
my code looks like step definitions:
Then(/^The confirmation number is visible$/, async () => { await client.url(
${client.launch_url}/confirmation
) await paymentFormPage.waitForElementVisible('@oneTimePaymentSuccess') })Then(/^The confirmation number is not visible$/, async (oldVal, newVal, browser) => { await client.url(
${client.launch_url}/confirmation
) await paymentFormPage.waitForElementVisible('@invalidCreditCard') })Given I launch mysite And I enter
Then I submit the payment
Then The confirmation number is visible
Given I launch mysite And I enter
Then I submit the payment
Then The confirmation number is not visible