Having an issue trying to upload a file via php unit through selenium. This is the code for my current attempt.
public function testFileUpload()
{
$filePath = '/Users/cdolan/Desktop/CamsodaTest/mern.png';
$this->flingLogIn();
$this->webDriver->findElement(WebDriverBy::cssSelector('.btn.btn-upgrade-nav.no-follow'))->click();
$this->webDriver->findElement(WebDriverBy::cssSelector('.add-pic'))->click();
sleep(3);
$file_input = $this->webDriver->findElement(WebDriverBy::cssSelector('#upload-button'))->click();
$file_input->setFileDetector(new LocalFileDetector());
$file_input->sendKeys($filePath)->submit();
The test seems to run and complete with no errors, however it will not upload a file! It seems to get stuck on this screen and then closes out without uploading anything.
Any advice would be appreciated.