Skip to content

Commit

Permalink
[ftr/dashboard] wait for importFile() to finish (#33723) (#33751)
Browse files Browse the repository at this point in the history
* [ftr/dashboard] wait for importFile() to finish

* move waitUntilLoadingHasFinished() into importFile() call

* remove unnecessary page object
  • Loading branch information
Spencer authored Mar 23, 2019
1 parent 8cb639f commit 2a65969
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
13 changes: 0 additions & 13 deletions test/functional/apps/management/_import_objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export default function ({ getService, getPageObjects }) {
it('should import saved objects', async function () {
await PageObjects.settings.clickKibanaSavedObjects();
await PageObjects.settings.importFile(path.join(__dirname, 'exports', '_import_objects.json'));
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.settings.clickImportDone();
await PageObjects.settings.waitUntilSavedObjectsTableIsNotLoading();
const objects = await PageObjects.settings.getSavedObjectsInTable();
Expand All @@ -52,7 +51,6 @@ export default function ({ getService, getPageObjects }) {
it('should provide dialog to allow the importing of saved objects with index pattern conflicts', async function () {
await PageObjects.settings.clickKibanaSavedObjects();
await PageObjects.settings.importFile(path.join(__dirname, 'exports', '_import_objects-conflicts.json'));
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.settings.associateIndexPattern('d1e4c910-a2e6-11e7-bb30-233be9be6a15', 'logstash-*');
await PageObjects.settings.clickConfirmChanges();
await PageObjects.header.waitUntilLoadingHasFinished();
Expand All @@ -70,7 +68,6 @@ export default function ({ getService, getPageObjects }) {
// so that we can override the existing visualization.
await PageObjects.settings.importFile(path.join(__dirname, 'exports', '_import_objects_exists.json'), false);

await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.settings.associateIndexPattern('logstash-*', 'logstash-*');
await PageObjects.settings.clickConfirmChanges();

Expand All @@ -88,7 +85,6 @@ export default function ({ getService, getPageObjects }) {
// so that we can be prompted to override the existing visualization.
await PageObjects.settings.importFile(path.join(__dirname, 'exports', '_import_objects_exists.json'), false);

await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.settings.associateIndexPattern('logstash-*', 'logstash-*');
await PageObjects.settings.clickConfirmChanges();

Expand All @@ -102,13 +98,11 @@ export default function ({ getService, getPageObjects }) {
it('should import saved objects linked to saved searches', async function () {
await PageObjects.settings.clickKibanaSavedObjects();
await PageObjects.settings.importFile(path.join(__dirname, 'exports', '_import_objects_saved_search.json'));
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.settings.clickImportDone();

await PageObjects.settings.navigateTo();
await PageObjects.settings.clickKibanaSavedObjects();
await PageObjects.settings.importFile(path.join(__dirname, 'exports', '_import_objects_connected_to_saved_search.json'));
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.settings.clickImportDone();
await PageObjects.settings.waitUntilSavedObjectsTableIsNotLoading();

Expand All @@ -121,7 +115,6 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.settings.navigateTo();
await PageObjects.settings.clickKibanaSavedObjects();
await PageObjects.settings.importFile(path.join(__dirname, 'exports', '_import_objects_connected_to_saved_search.json'));
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.settings.clickImportDone();
await PageObjects.settings.waitUntilSavedObjectsTableIsNotLoading();

Expand All @@ -134,8 +127,6 @@ export default function ({ getService, getPageObjects }) {
// First, import the saved search
await PageObjects.settings.clickKibanaSavedObjects();
await PageObjects.settings.importFile(path.join(__dirname, 'exports', '_import_objects_saved_search.json'));
// Wait for all the saves to happen
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.settings.clickImportDone();

// Second, we need to delete the index pattern
Expand All @@ -149,8 +140,6 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.settings.navigateTo();
await PageObjects.settings.clickKibanaSavedObjects();
await PageObjects.settings.importFile(path.join(__dirname, 'exports', '_import_objects_connected_to_saved_search.json'));
// Wait for all the saves to happen
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.settings.clickImportDone();
await PageObjects.settings.waitUntilSavedObjectsTableIsNotLoading();

Expand All @@ -163,7 +152,6 @@ export default function ({ getService, getPageObjects }) {
// First, import the objects
await PageObjects.settings.clickKibanaSavedObjects();
await PageObjects.settings.importFile(path.join(__dirname, 'exports', '_import_objects_with_index_patterns.json'));
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.settings.clickImportDone();
// Wait for all the saves to happen
await PageObjects.settings.waitUntilSavedObjectsTableIsNotLoading();
Expand All @@ -183,7 +171,6 @@ export default function ({ getService, getPageObjects }) {
// Then, import the objects
await PageObjects.settings.clickKibanaSavedObjects();
await PageObjects.settings.importFile(path.join(__dirname, 'exports', '_import_objects_with_index_patterns.json'));
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.settings.clickImportDone();
// Wait for all the saves to happen
await PageObjects.settings.waitUntilSavedObjectsTableIsNotLoading();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export default function ({ getService, getPageObjects }) {

await PageObjects.settings.clickKibanaSavedObjects();
await PageObjects.settings.importFile(path.join(__dirname, 'exports', 'mgmt_import_objects.json'));
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.settings.associateIndexPattern('4c3f3c30-ac94-11e8-a651-614b2788174a', 'logstash-*');
await PageObjects.settings.clickConfirmChanges();
await PageObjects.settings.clickImportDone();
Expand Down
3 changes: 3 additions & 0 deletions test/functional/page_objects/settings_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,9 @@ export function SettingsPageProvider({ getService, getPageObjects }) {
}
await testSubjects.click('importSavedObjectsImportBtn');
log.debug(`done importing the file`);

// Wait for all the saves to happen
await PageObjects.header.waitUntilLoadingHasFinished();
}

async clickImportDone() {
Expand Down

0 comments on commit 2a65969

Please sign in to comment.