From cdf681f2ec26efda3217d3a71910bf222f166e72 Mon Sep 17 00:00:00 2001 From: Candace Park Date: Thu, 25 Feb 2021 13:32:38 -0500 Subject: [PATCH 1/4] commented code to close out toast --- .../apps/endpoint/policy_details.ts | 5 +++++ .../security_solution_endpoint/page_objects/policy_page.ts | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts b/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts index ba4687e497230..bdfd0d3ac7c5f 100644 --- a/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts +++ b/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts @@ -459,6 +459,11 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { // Clear the value await advancedPolicyField.click(); await advancedPolicyField.clearValueWithKeyboard(); + + // Since the Save button is on a sticky footer, it first closes out the success toast before saving again + await testSubjects.existOrFail('policyDetailsSuccessMessage'); + // await (await testSubjects.find('ToastExit')).click(); + // await testSubjects.missingOrFail('policyDetailsSuccessMessage'); await pageObjects.policy.confirmAndSave(); await testSubjects.existOrFail('policyDetailsSuccessMessage'); diff --git a/x-pack/test/security_solution_endpoint/page_objects/policy_page.ts b/x-pack/test/security_solution_endpoint/page_objects/policy_page.ts index 719e8d345bf44..430dcb260bf56 100644 --- a/x-pack/test/security_solution_endpoint/page_objects/policy_page.ts +++ b/x-pack/test/security_solution_endpoint/page_objects/policy_page.ts @@ -70,7 +70,10 @@ export function EndpointPolicyPageProvider({ getService, getPageObjects }: FtrPr */ async confirmAndSave() { await this.ensureIsOnDetailsPage(); - await browser.scrollTop(); + // await browser.scrollTop(); + await testSubjects.existOrFail('policyDetailsSuccessMessage'); + // await this.findToastExit + click + // await testSubjects.missingOrFail('policyDetailsSuccessMessage'); await (await this.findSaveButton()).click(); await testSubjects.existOrFail('policyDetailsConfirmModal'); await pageObjects.common.clickConfirmOnModal(); From 885bf3564592b05da871e21c155410c434273373 Mon Sep 17 00:00:00 2001 From: Candace Park Date: Thu, 25 Feb 2021 13:35:19 -0800 Subject: [PATCH 2/4] fixes funcitonal text bug where toast doesn't close --- .../apps/endpoint/policy_details.ts | 8 +++----- .../page_objects/policy_page.ts | 4 ---- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts b/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts index bdfd0d3ac7c5f..1f1dd4dd192ae 100644 --- a/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts +++ b/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts @@ -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', () => { @@ -460,10 +460,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await advancedPolicyField.click(); await advancedPolicyField.clearValueWithKeyboard(); - // Since the Save button is on a sticky footer, it first closes out the success toast before saving again - await testSubjects.existOrFail('policyDetailsSuccessMessage'); - // await (await testSubjects.find('ToastExit')).click(); - // await testSubjects.missingOrFail('policyDetailsSuccessMessage'); + // Make sure the toast button closes so the save button on the sticky footer is visible + await testSubjects.waitForHidden('toastCloseButton'); await pageObjects.policy.confirmAndSave(); await testSubjects.existOrFail('policyDetailsSuccessMessage'); diff --git a/x-pack/test/security_solution_endpoint/page_objects/policy_page.ts b/x-pack/test/security_solution_endpoint/page_objects/policy_page.ts index 430dcb260bf56..f7b4286682739 100644 --- a/x-pack/test/security_solution_endpoint/page_objects/policy_page.ts +++ b/x-pack/test/security_solution_endpoint/page_objects/policy_page.ts @@ -70,10 +70,6 @@ export function EndpointPolicyPageProvider({ getService, getPageObjects }: FtrPr */ async confirmAndSave() { await this.ensureIsOnDetailsPage(); - // await browser.scrollTop(); - await testSubjects.existOrFail('policyDetailsSuccessMessage'); - // await this.findToastExit + click - // await testSubjects.missingOrFail('policyDetailsSuccessMessage'); await (await this.findSaveButton()).click(); await testSubjects.existOrFail('policyDetailsConfirmModal'); await pageObjects.common.clickConfirmOnModal(); From 99fa2a699d79e4ddcf77f8f2226f2ad0cd2f077e Mon Sep 17 00:00:00 2001 From: Candace Park Date: Mon, 1 Mar 2021 10:22:43 -0500 Subject: [PATCH 3/4] fix typecheck --- .../test/security_solution_endpoint/page_objects/policy_page.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/test/security_solution_endpoint/page_objects/policy_page.ts b/x-pack/test/security_solution_endpoint/page_objects/policy_page.ts index f7b4286682739..d1a037a47ff08 100644 --- a/x-pack/test/security_solution_endpoint/page_objects/policy_page.ts +++ b/x-pack/test/security_solution_endpoint/page_objects/policy_page.ts @@ -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 { /** From c717f8f2a5b11af74454cdf62ed36b8309312d5a Mon Sep 17 00:00:00 2001 From: Candace Park Date: Mon, 1 Mar 2021 12:49:10 -0500 Subject: [PATCH 4/4] close toast button quickly --- .../security_solution_endpoint/apps/endpoint/policy_details.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts b/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts index 1f1dd4dd192ae..28e1c469c03e6 100644 --- a/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts +++ b/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts @@ -461,6 +461,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { 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();