Skip to content

Commit

Permalink
[7.9] changes for upgrade assistant functional test to incorporate te…
Browse files Browse the repository at this point in the history
…st user (#70071) (#73145)

* changes for upgrade assistant functional test to incorporate test user (#70071)

* changes for upgrade assistant functional test to incorporate test user

* changes to toggle on/off

* upgrade_assistant role

* upgrade assistant

* more debug statements to check on cloud

* commented the sleeps to check toggle button

* reduced the sleep to 2 seconds to test on cloud

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

* Update x-pack/test/functional/config.js

Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 4, 2020
1 parent b103fbe commit e404b19
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
20 changes: 18 additions & 2 deletions x-pack/test/functional/apps/upgrade_assistant/upgrade_assistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,22 @@ export default function upgradeAssistantFunctionalTests({
getPageObjects,
}: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const PageObjects = getPageObjects(['upgradeAssistant']);
const PageObjects = getPageObjects(['upgradeAssistant', 'common']);
const security = getService('security');
const log = getService('log');

describe('Upgrade Checkup', function () {
this.tags('includeFirefox');
before(async () => await esArchiver.load('empty_kibana'));

before(async () => {
await esArchiver.load('empty_kibana');
await security.testUser.setRoles(['global_upgrade_assistant_role']);
});

after(async () => {
await PageObjects.upgradeAssistant.expectTelemetryHasFinish();
await esArchiver.unload('empty_kibana');
await security.testUser.restoreDefaults();
});

it('allows user to navigate to upgrade checkup', async () => {
Expand All @@ -28,9 +36,17 @@ export default function upgradeAssistantFunctionalTests({

it('allows user to toggle deprecation logging', async () => {
await PageObjects.upgradeAssistant.navigateToPage();
log.debug('expect initial state to be ON');
await PageObjects.upgradeAssistant.expectDeprecationLoggingLabel('On');
log.debug('Now toggle to off');
await PageObjects.upgradeAssistant.toggleDeprecationLogging();
await PageObjects.common.sleep(2000);
log.debug('expect state to be OFF after toggle');
await PageObjects.upgradeAssistant.expectDeprecationLoggingLabel('Off');
await PageObjects.upgradeAssistant.toggleDeprecationLogging();
await PageObjects.common.sleep(2000);
log.debug('expect state to be ON after toggle');
await PageObjects.upgradeAssistant.expectDeprecationLoggingLabel('On');
});

it('allows user to open cluster tab', async () => {
Expand Down
21 changes: 21 additions & 0 deletions x-pack/test/functional/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,27 @@ export default async function ({ readConfigFile }) {
],
},

global_upgrade_assistant_role: {
elasticsearch: {
cluster: ['manage'],
indices: [
{
names: ['apm-*'],
privileges: ['read', 'view_index_metadata'],
field_security: { grant: ['*'], except: [] },
},
],
},
kibana: [
{
feature: {
discover: ['read'],
},
spaces: ['*'],
},
],
},

global_ccr_role: {
elasticsearch: {
cluster: ['manage', 'manage_ccr'],
Expand Down

0 comments on commit e404b19

Please sign in to comment.