Skip to content

Commit

Permalink
Fix test import objects (elastic#82767)
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeDr committed Nov 18, 2020
1 parent 7c1ac30 commit 9dc2442
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
18 changes: 11 additions & 7 deletions test/functional/apps/management/_import_objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,16 +430,20 @@ export default function ({ getService, getPageObjects }) {
);
});

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 () => {
Expand Down
1 change: 1 addition & 0 deletions x-pack/test/functional/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 9dc2442

Please sign in to comment.