Commit 6d4b34f0 authored by Isabella Scalzi's avatar Isabella Scalzi Committed by Commit Bot

[quickview] add |openQuickViewClickDeleteButton| test

Tests that a deletable item can be deleted using the Quick View's
delete button.

No-try: true
Bug: 803259
Change-Id: Ic6c99da1aa7115b3a96abed07d6ca97a88ab19c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2044258Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Commit-Queue: Isabella Scalzi <isabellascalzi@google.com>
Cr-Commit-Position: refs/heads/master@{#740060}
parent 4d3a3d43
......@@ -495,7 +495,8 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
TestCase("closeQuickView"),
TestCase("openQuickViewFromDirectoryTree"),
TestCase("openQuickViewAndDeleteSingleSelection"),
TestCase("openQuickViewAndDeleteCheckSelection")));
TestCase("openQuickViewAndDeleteCheckSelection"),
TestCase("openQuickViewClickDeleteButton")));
WRAPPED_INSTANTIATE_TEST_SUITE_P(
DirectoryTree, /* directory_tree.js */
......
......@@ -2173,4 +2173,32 @@
const mimeType = await getQuickViewMetadataBoxField(appId, 'Type');
chrome.test.assertEq(mimeType, 'audio/ogg');
};
/**
* Tests that an item can be deleted using the Quick View delete button.
*/
testcase.openQuickViewClickDeleteButton = async () => {
// Open Files app on Downloads containing ENTRIES.hello.
const appId =
await setupAndWaitUntilReady(RootPath.DOWNLOADS, [ENTRIES.hello], []);
// Open the file in Quick View.
await openQuickView(appId, ENTRIES.hello.nameText);
// Click the Quick View delete button.
const quickViewDeleteButton =
['#quick-view', '#delete-button:not([hidden])'];
await remoteCall.waitAndClickElement(appId, quickViewDeleteButton);
// Click the delete confirm dialog OK button.
const deleteConfirm = ['#quick-view', '.cr-dialog-ok:not([hidden])'];
await remoteCall.waitAndClickElement(appId, deleteConfirm);
// Check: the file should have been deleted.
await remoteCall.waitForElementLost(
appId, '#file-list [file-name="hello.txt"]');
// Check: the Quick View dialog should close.
await waitQuickViewClose(appId);
};
})();
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment