katamariBall wrote a comment+100 XP
3mos ago
Hey thanks for helping!
I've put debug() in-between as suggested but the fail still persists. I did put it before press() and I saw that it did fill out the form but its like the page refreshes and then that's the fail. I did have a shot at changed the buttons name to something random and it just timed out.
So it does fill out the form but refreshes? or seems like it refreshes and stays on the same /register path, instead of going to /ideas after press().
Unsure if any of that is of any help of my problem..
katamariBall liked a comment+100 XP
3mos ago
Hey @katamariBall, maybe you could place a debug() after the assertPathIs() so that you can see where you are at that point?
Something like this:
->press('@register-button')
->debug()
->assertPathIs('/idea');
If you're still on the same page, then the press didn't work correctly.
Bear in mind that even if you try to do something like this:
<a ... disabled="true">Register</a>
The test will effectively behave the same. It won't skip the disabled button, it will click on it, which won't do anything.
My main culprits:
- There's a typo in either
->press('@register-button')ordata-test="register-button". - Maybe you've accidentally placed the
data-test="register-button"in the navbar's registration button instead of on the form.
If you still require assistance, I'd be happy to help. Happy coding!
katamariBall wrote a comment+100 XP
3mos ago
this is my first introduction to pest and its pretty fun I've played with it for a good day lol
although Having trouble with getting the redirect to work though ->assertPathis(/ideas') its never seems to actually work. I did put debug in-between to see if it was actually inputting the information and it was! but as soon as it gets to the assetPathis()..it will with me a fail. I get a fail like :
Actual path [/register] does not equal expected path [/ideas]. Failed asserting that '/register' matches PCRE pattern "/^/ideas$/u".
I have even disabled the first register button just to be on the safe side but it still persists.