Skip to content

Commit

Permalink
add functional test
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkime committed Oct 18, 2021
1 parent 12c505a commit 31d3f80
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/functional/apps/management/_legacy_url_redirect.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context';

export default function ({ getPageObjects, getService }: FtrProviderContext) {
const browser = getService('browser');
const PageObjects = getPageObjects(['settings', 'common', 'header']);

describe('legacy urls redirect correctly', () => {
it('redirects correctly', async () => {
await PageObjects.settings.navigateTo();
await PageObjects.settings.clickKibanaIndexPatterns();
await PageObjects.settings.clickIndexPatternLogstash();

const url = await browser.getCurrentUrl();
const modifiedUrl = url.replace('patterns', 'dataView').replace('indexPatterns', 'dataViews');
await browser.navigateTo(modifiedUrl);
await PageObjects.header.waitUntilLoadingHasFinished();
const newUrl = await browser.getCurrentUrl();
expect(newUrl).to.equal(url);
});
});
}
1 change: 1 addition & 0 deletions test/functional/apps/management/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
loadTestFile(require.resolve('./_scripted_fields'));
loadTestFile(require.resolve('./_runtime_fields'));
loadTestFile(require.resolve('./_field_formatter'));
loadTestFile(require.resolve('./_legacy_url_redirect'));
});

describe('', function () {
Expand Down

0 comments on commit 31d3f80

Please sign in to comment.