Skip to content
This repository has been archived by the owner on Feb 4, 2020. It is now read-only.

Commit

Permalink
Merge pull request #33 from puneet0191/patch-2
Browse files Browse the repository at this point in the history
Fixing Duplicate Image Issue
  • Loading branch information
bembelimen authored Aug 9, 2019
2 parents 5a85ead + 025116a commit 341d8bf
Showing 1 changed file with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,21 @@ public function navigateUsingBreadcrumb(Media $I)
public function uploadSingleFileUsingToolbarButton(Media $I)
{
$testFileName = 'test-image-1.png';
$testFileItem = MediaListPage::item($testFileName);

$I->wantToTest('the upload of a single file using toolbar button.');
$I->amOnPage(MediaListPage::$url . $this->testDirectory);
$I->waitForJsOnPageLoad();
$I->uploadFile('com_media/' . $testFileName);
$I->seeSystemMessage('Item uploaded.');
$I->seeContents([$testFileName]);
$I->click($testFileItem);
$I->click(MediaListPage::$toolbarDeleteButton);
$I->waitForElement(MediaListPage::$toolbarModalDeleteButton);
$I->waitForJsOnPageLoad();
$I->click(MediaListPage::$toolbarModalDeleteButton);
$I->seeSystemMessage('Item deleted.');
$I->waitForElementNotVisible($testFileItem);
}

/**
Expand Down Expand Up @@ -437,16 +445,20 @@ public function deleteMultipleFiles(Media $I)
$testFileItem1 = MediaListPage::item($testFileName1);
$testFileItem2 = MediaListPage::item($testFileName2);

$I->wantToTest('that it is possible to delete a single file.');
$I->wantToTest('that it is possible to delete a Multiple file.');
$I->amOnPage(MediaListPage::$url . $this->testDirectory);
$I->uploadFile('com_media/' . $testFileName1);
$I->waitForText('Item uploaded.');
$I->wait(10);
$I->waitForElement($testFileItem1);
$I->waitForMediaLoaded();
$I->uploadFile('com_media/' . $testFileName2);
$I->waitForText('Item uploaded.');
$I->wait(10);
$I->waitForMediaLoaded();
$I->waitForElement($testFileItem2);
$I->click($testFileItem1);
$I->clickHoldingShiftkey($testFileItem2);
$I->waitForText('Item uploaded.');
$I->wait(10);
$I->click(MediaListPage::$toolbarDeleteButton);
$I->waitForElement(MediaListPage::$toolbarModalDeleteButton);
$I->click(MediaListPage::$toolbarModalDeleteButton);
Expand Down

0 comments on commit 341d8bf

Please sign in to comment.