Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test import objects (#82767) #83679

Merged
merged 1 commit into from
Nov 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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