File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,11 +30,7 @@ protected function upload_media($path) {
3030 $ file_input ->setFileDetector (new UselessFileDetector ());
3131 $ file_input ->sendKeys ($ path );
3232 self ::$ driver ->findElement (WebDriverBy::xpath ('//input[@value="Upload"] ' ))->click ();
33- $ path_elements = explode ('/ ' , $ path );
34- $ file_name = array_pop ($ path_elements );
35- $ media_elements = explode ('. ' , $ file_name );
36- $ media_name = $ media_elements [0 ];
37- self ::$ driver ->wait (2 )->until (WebDriverExpectedCondition::presenceOfElementLocated (WebDriverBy::xpath ('//img[contains(@alt, " ' . $ media_name . '")] ' )));
33+ self ::$ driver ->wait (2 )->until (WebDriverExpectedCondition::presenceOfElementLocated (WebDriverBy::xpath ('//h1[contains(text(),"Media Library")] ' )));
3834 }
3935
4036 protected function set_api_key ($ api_key ) {
You can’t perform that action at this time.
0 commit comments