Fix test import objects (#82767)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Lee Drengenberg 2020-11-09 11:01:33 -06:00 committed by GitHub
parent 9c984f4723
commit 1885dda6e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 8 deletions

View file

@ -37,7 +37,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
describe('import objects', function describeIndexTests() {
describe('.ndjson file', () => {
beforeEach(async function () {
// delete .kibana index and then wait for Kibana to re-create it
await kibanaServer.uiSettings.replace({});
await PageObjects.settings.navigateTo();
await esArchiver.load('management');
@ -471,16 +470,20 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
);
});
it('should display an explicit error message when importing a file bigger than allowed', async () => {
await PageObjects.savedObjects.importFile(
path.join(__dirname, 'exports', '_import_too_big.ndjson')
);
describe('when bigger than savedObjects.maxImportPayloadBytes (not Cloud)', function () {
// see --savedObjects.maxImportPayloadBytes in config file
this.tags(['skipCloud']);
it('should display an explicit error message when importing a file bigger than allowed', async () => {
await PageObjects.savedObjects.importFile(
path.join(__dirname, 'exports', '_import_too_big.ndjson')
);
await PageObjects.savedObjects.checkImportError();
await PageObjects.savedObjects.checkImportError();
const errorText = await PageObjects.savedObjects.getImportErrorText();
const errorText = await PageObjects.savedObjects.getImportErrorText();
expect(errorText).to.contain(`Payload content length greater than maximum allowed`);
expect(errorText).to.contain(`Payload content length greater than maximum allowed`);
});
});
it('should display an explicit error message when importing an invalid file', async () => {

View file

@ -88,6 +88,7 @@ export default async function ({ readConfigFile }) {
'--xpack.security.encryptionKey="wuGNaIhoMpk5sO4UBxgr3NyW1sFcLgIf"', // server restarts should not invalidate active sessions
'--xpack.encryptedSavedObjects.encryptionKey="DkdXazszSCYexXqz4YktBGHCRkV6hyNK"',
'--timelion.ui.enabled=true',
'--savedObjects.maxImportPayloadBytes=10485760', // for OSS test management/_import_objects
],
},
uiSettings: {