nightwatchjs / nightwatch

Integrated end-to-end testing framework written in Node.js and using W3C Webdriver API. Developed at @browserstack
https://nightwatchjs.org
MIT License
11.79k stars 1.31k forks source link

selenium/nightwatchJS unable to identify pop up #1744

Closed tejam1253 closed 6 years ago

tejam1253 commented 6 years ago

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

beatfactor commented 6 years ago

Please use the Mailing List or StackOverflow to ask for assistance. The GitHub Issues list is meant for submitting bugs and feature requests.