I think you should use cy.get() for the field you ...
# e2e-testing
m
I think you should use cy.get() for the field you would like to pass input to.
t
hey, thanks for the help. I did manage to get inside of the iframe. However im facing another strange issue now. using cy.get("input") i get an error that there are multiple inputs (which is expected, there are 4). However if I try to get a more specific input ('input[type="tel"]', 'input.classname' || first( 'input') cy does not find it. Any Ideas? Hope you can help again πŸ˜‰
to me it feels like the DOM elements are present, their attributes however are not (concealed mby?)
m
hey again! In case you get multiple inputs maybe try combining cy.get("input").first() or cy.get("input").eq(number)?
This is what I do when I have multiple objects with the same id/div/class etc.
t
ofc! tyvm
and sry for the thread, i thought discord would treat them like slack
m
I don't mind threads, I see them as a nice way to organise comms without clattering the whole channel πŸ˜‰
t
my thoughts exactly, can other people see them however?
m
I think others can see and decide to join
t
Well on with it then πŸ˜‰ ur Idea "works" in the sense cy seems to finds them. However .type does not wrk even with {force:true}
m
@polite-lunch-8069
This is my workpal
Maybe he can help as well
Can you share updated code again?
t
welcome, and sure gimme a sec
rly dislike using the eq 0,1 on an html element. Only used cuz i was unable to query selectors with cy (It does work in the browser πŸ€·β€β™‚οΈ )
p
What is the error?
t
the type does not work
the test passes put there is no input in the input πŸ˜…
e
if the input contains any text, you could use
cy.contains('input', text)
p
Maybe object that Cypress gets is not the input it can use to execute .type
t
ic, like a radio button
hmm i did only find 4 inputs 1 "tel", 3 text. When i just go for input, cy only detects 4 inputs as well
p
Or, what happened to me a few times, you need to click this object first in order to execute β€œ.type”
t
hmm good idea, ill try
p
If click doesn’t help just try anything to set focus on this element before using .type (for example you can use .focus)
I think it’s a good practice overall
t
ok, so click doesnt seem to find it, focus yields a no input pass again
ill take a break for now will work on it again tomorrow. Thanks for the help, alas this beast might not be slain today πŸ€–
m
Hey @thankful-insurance-51131 , Any luck? πŸ™‚
t
Hmm not yet. Ty for asking. I'm investigating a shadow root right now. From what I understand it might be the solution
m
Interesting!
I am performing many PRD tests lately so can't spare much time to dig deeper into that.
But am curious of the solution.
t
Ok by the looks of it, this might have to do with a security measure provided by the 2 iframe or its implementation in the first one. My guess is the solution to this lies outside of the CY-testing scope.
Will lets you know how it turns out in the end
4 Views