Commit 9276dfe8 authored by Jesse Schettler's avatar Jesse Schettler Committed by Commit Bot

Add new test for manufacturer dialog

Add a new test to verify that the Add button of the manufacturer dialog
is disabled after clicking it.

Bug: 990755
Test: browser_tests --gtest_filter=OSSettingsPrintingPageTest*
Change-Id: Id7cb8014595ae1a6c6abd1dd1cbd3dcbb403c79e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1749823Reviewed-by: default avatarBailey Berro <baileyberro@chromium.org>
Commit-Queue: Jesse Schettler <jschettler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#686223}
parent b9814458
......@@ -576,6 +576,47 @@ suite('CupsAddPrinterDialogTests', function() {
assertFalse(urlElement.hidden);
});
});
/**
* Test that the add button of the manufacturer dialog is disabled after
* clicking it.
*/
test('AddButtonDisabledAfterClicking', function() {
// Starting in the discovery dialog, select the add manually button.
const discoveryDialog = dialog.$$('add-printer-discovery-dialog');
assertTrue(!!discoveryDialog);
discoveryDialog.$.manuallyAddPrinterButton.click();
Polymer.dom.flush();
// From the add manually dialog, click the add button to advance to the
// manufacturer dialog.
const addDialog = dialog.$$('add-printer-manually-dialog');
assertTrue(!!addDialog);
fillAddManuallyDialog(addDialog);
clickAddButton(addDialog);
Polymer.dom.flush();
// Click the add button on the manufacturer dialog and then verify it is
// disabled.
return cupsPrintersBrowserProxy
.whenCalled('getCupsPrinterManufacturersList')
.then(function() {
const manufacturerDialog =
dialog.$$('add-printer-manufacturer-model-dialog');
assertTrue(!!manufacturerDialog);
// Populate the manufacturer and model fields to enable the add
// button.
manufacturerDialog.$$('#manufacturerDropdown').value = 'make';
manufacturerDialog.$$('#modelDropdown').value = 'model';
const addButton = manufacturerDialog.$$('#addPrinterButton');
assertTrue(!!addButton);
assertFalse(addButton.disabled);
addButton.click();
assertTrue(addButton.disabled);
});
});
});
suite('EditPrinterDialog', function() {
......
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