diff --git a/core/modules/media_library/tests/src/FunctionalJavascript/UploadFail.php b/core/modules/media_library/tests/src/FunctionalJavascript/UploadFail.php index 2d39d91d3f..6992a03624 100644 --- a/core/modules/media_library/tests/src/FunctionalJavascript/UploadFail.php +++ b/core/modules/media_library/tests/src/FunctionalJavascript/UploadFail.php @@ -58,7 +58,6 @@ public function testManyConsecutiveUploads() { // Visit a node create page and open the media library. $this->drupalGet('node/add/basic_page'); - $count = 0; // Upload then remove an image 100x to see if/when it fails. while ($count < 100) { @@ -69,7 +68,6 @@ public function testManyConsecutiveUploads() { $new_filename = uniqid() . '.jpg'; $new_filepath = $file_system->realpath('public://') . '/' . $new_filename; copy($file_system->realpath($jpg_image->uri), $new_filepath); - $jpg_uri_2 = $this->copiedFileUri($jpg_image->uri); $this->waitForFieldExists('Add files', 10000, "Did not find 'Add files' on iteration $count"); $page->attachFileToField('Add files', $new_filepath); $this->waitForText('Alternative text', 10000, "Alternative text field not found on iteration $count"); @@ -80,8 +78,8 @@ public function testManyConsecutiveUploads() { $hidden_field = $page->find('css', $hidden_field_locator); $this->assertNotEmpty($hidden_field, "Width field not found on iteration $count"); $this->assertNotEmpty($hidden_field->getAttribute('value'), "Width field empty on iteration $count"); - $this->assertElementExistsAfterWait('css', '.ui-dialog-buttonpane', 10000, "Save and select button not found on iteration $count")->pressButton('Save and select'); - $this->waitForNoText('Save and select', 10000, "Save and select visible when it shouldn't be on iteration $count"); + $this->assertElementExistsAfterWait('css', '.ui-dialog-buttonpane', 10000, "Save and select button not found on iteration $count")->pressButton('Save'); + $this->waitForNoText('Save', 10000, "Save button visible when it shouldn't be on iteration $count"); $this->assertElementExistsAfterWait('css', '.ui-dialog-buttonpane', 10000, "Insert selected button not found on iteration $count")->pressButton('Insert selected'); $this->waitForText($new_filename, 10000, "$new_filename not found on iteration $count"); $this->waitForText('One media item remaining', 10000, "'One media item remaining' not found on iteration $count");