0

I am using Codeception(with PHP Browser) on a Phalcon2 project and writing acceptance tests.

  • We have a form to create new users
  • Form contain a file field to upload profile image
  • If form successfully submitted, it getting redirected to /user/edit/n (n = user id)

When writing acceptance tests I used

  • fillField() : for text fields
  • attachFile('input[name=image]', 'sample.jpg') : for file field

The issue is without attachFile(), test works and can see the submitted data. But when using attachFile(), test fails because form is not getting redirected, can see the submitted data but no uploaded file.

Anybody know

  1. How we can fix this?
  2. Can we use http://codeception.com/docs/modules/PhpBrowser#submitForm with file uploads?

Thanks

0 Answers0