I asked the same to the Stripe Support team. They suggested the following:
"In general, we do not support or recommend automated testing of Elements by pre-filling details. The internal structure of the iframe(class names, DOM structure) is subject to change at any time so it's not generally safe to write code that accesses this.
The recommendation instead is to test by using Stripe's test tokens[0] — so essentially, in testing, you would stub out the payment form itself, and call your function that proceeds with the rest of payment using a string value like "tok_visa" directly. These test strings can be passed to the API to complete charges, so they can be used to mock the result of interacting with the Elements form.
[0] - https://stripe.com/docs/testing#cards "