[Security Solution][Endpoint][Admin] Fixes policy sticky footer save test (#92919)

* commented code to close out toast
This commit is contained in:
Candace Park 2021-03-01 12:31:05 -08:00 committed by GitHub
parent be0797670f
commit 1a3bbbf917
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

@ -22,7 +22,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
const policyTestResources = getService('policyTestResources');
// Failing: See https://github.com/elastic/kibana/issues/92567
describe.skip('When on the Endpoint Policy Details Page', function () {
describe('When on the Endpoint Policy Details Page', function () {
this.tags(['ciGroup7']);
describe('with an invalid policy id', () => {
@ -449,6 +449,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
// Clear the value
await advancedPolicyField.click();
await advancedPolicyField.clearValueWithKeyboard();
// Make sure the toast button closes so the save button on the sticky footer is visible
await (await testSubjects.find('toastCloseButton')).click();
await testSubjects.waitForHidden('toastCloseButton');
await pageObjects.policy.confirmAndSave();
await testSubjects.existOrFail('policyDetailsSuccessMessage');

View file

@ -10,7 +10,6 @@ import { FtrProviderContext } from '../ftr_provider_context';
export function EndpointPolicyPageProvider({ getService, getPageObjects }: FtrProviderContext) {
const pageObjects = getPageObjects(['common', 'header']);
const testSubjects = getService('testSubjects');
const browser = getService('browser');
return {
/**
@ -70,7 +69,6 @@ export function EndpointPolicyPageProvider({ getService, getPageObjects }: FtrPr
*/
async confirmAndSave() {
await this.ensureIsOnDetailsPage();
await browser.scrollTop();
await (await this.findSaveButton()).click();
await testSubjects.existOrFail('policyDetailsConfirmModal');
await pageObjects.common.clickConfirmOnModal();