Skip to content

Commit df3b32d

Browse files
author
Jacob Middag
committed
Use h1 text to determine if image is uploaded instead of alt text of image
1 parent 9c274fc commit df3b32d

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

test/integration/IntegrationTestCase.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff 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) {

0 commit comments

Comments
 (0)