Skip to content

Commit

Permalink
Ensure logged out starting state for tests that need it (#59322) (#59573
Browse files Browse the repository at this point in the history
)
  • Loading branch information
brianseeders authored Mar 10, 2020
1 parent c8a5b63 commit 78508b8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion x-pack/test/functional/apps/spaces/enter_space.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ export default function enterSpaceFunctonalTests({

describe('Enter Space', function() {
this.tags('smoke');
before(async () => await esArchiver.load('spaces/enter_space'));
before(async () => {
await esArchiver.load('spaces/enter_space');
await PageObjects.security.forceLogout();
});
after(async () => await esArchiver.unload('spaces/enter_space'));

afterEach(async () => {
Expand Down
5 changes: 4 additions & 1 deletion x-pack/test/functional/apps/spaces/spaces_selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ export default function spaceSelectorFunctonalTests({
describe('Spaces', function() {
this.tags('smoke');
describe('Space Selector', () => {
before(async () => await esArchiver.load('spaces/selector'));
before(async () => {
await esArchiver.load('spaces/selector');
await PageObjects.security.forceLogout();
});
after(async () => await esArchiver.unload('spaces/selector'));

afterEach(async () => {
Expand Down
4 changes: 2 additions & 2 deletions x-pack/test/functional/page_objects/monitoring_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

export function MonitoringPageProvider({ getPageObjects, getService }) {
const PageObjects = getPageObjects(['common', 'header', 'shield', 'spaceSelector']);
const PageObjects = getPageObjects(['common', 'header', 'security', 'shield', 'spaceSelector']);
const testSubjects = getService('testSubjects');
const security = getService('security');

Expand All @@ -19,7 +19,7 @@ export function MonitoringPageProvider({ getPageObjects, getService }) {
});

if (!useSuperUser) {
await PageObjects.common.navigateToApp('login');
await PageObjects.security.forceLogout();
await PageObjects.shield.login('basic_monitoring_user', 'monitoring_user_password');
}
await PageObjects.common.navigateToApp('monitoring');
Expand Down

0 comments on commit 78508b8

Please sign in to comment.