From 837352e240443072fd42c221df320e32dc945b2a Mon Sep 17 00:00:00 2001 From: bhavyarm Date: Wed, 4 Mar 2020 16:03:09 -0500 Subject: [PATCH 1/6] a11y tests on adding columns --- test/accessibility/apps/discover.ts | 34 +++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/test/accessibility/apps/discover.ts b/test/accessibility/apps/discover.ts index e25d295515971..d3cad69b12f08 100644 --- a/test/accessibility/apps/discover.ts +++ b/test/accessibility/apps/discover.ts @@ -20,12 +20,25 @@ import { FtrProviderContext } from '../ftr_provider_context'; export default function({ getService, getPageObjects }: FtrProviderContext) { - const PageObjects = getPageObjects(['common', 'discover', 'header', 'share', 'timePicker']); + const PageObjects = getPageObjects([ + 'common', + 'discover', + 'header', + 'share', + 'timePicker', + 'home', + ]); const a11y = getService('a11y'); const esArchiver = getService('esArchiver'); const kibanaServer = getService('kibanaServer'); const inspector = getService('inspector'); const filterBar = getService('filterBar'); + const docTable = getService('docTable'); + const TEST_COLUMN_NAMES = ['@message']; + const TEST_FILTER_COLUMN_NAMES = [ + ['extension', 'jpg'], + ['geo.src', 'IN'], + ]; describe('Discover', () => { before(async () => { @@ -58,7 +71,7 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { }); // skipping the test for new because we can't fix it right now - it.skip('Click on new to clear the search', async () => { + it('Click on new to clear the search', async () => { await PageObjects.discover.clickNewSearchButton(); await a11y.testAppSnapshot(); }); @@ -109,5 +122,22 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.discover.closeSidebarFieldFilter(); await a11y.testAppSnapshot(); }); + + it('Add a field from sidebar', async () => { + for (const columnName of TEST_COLUMN_NAMES) { + await PageObjects.discover.clickFieldListItemAdd(columnName); + } + await a11y.testAppSnapshot(); + }); + + it.skip('Add more fields from sidebar', async () => { + for (const [columnName, value] of TEST_FILTER_COLUMN_NAMES) { + await PageObjects.discover.clickFieldListItem(columnName); + await PageObjects.discover.clickFieldListPlusFilter(columnName, value); + } + await a11y.testAppSnapshot(); + }); + + // Context view tests }); } From 7a7136890f87d8f745f1038718ba8e5a57854a13 Mon Sep 17 00:00:00 2001 From: bhavyarm Date: Wed, 4 Mar 2020 17:58:20 -0500 Subject: [PATCH 2/6] skipping and unskip tests --- test/accessibility/apps/discover.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/accessibility/apps/discover.ts b/test/accessibility/apps/discover.ts index d3cad69b12f08..04c565c5e5dc6 100644 --- a/test/accessibility/apps/discover.ts +++ b/test/accessibility/apps/discover.ts @@ -137,7 +137,5 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { } await a11y.testAppSnapshot(); }); - - // Context view tests }); } From 92358c8f11a5e7040f7d6055a727b692ac7095ab Mon Sep 17 00:00:00 2001 From: bhavyarm Date: Thu, 5 Mar 2020 09:31:47 -0500 Subject: [PATCH 3/6] fixing type errors --- test/accessibility/apps/discover.ts | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/test/accessibility/apps/discover.ts b/test/accessibility/apps/discover.ts index 04c565c5e5dc6..1bb2739c2fd6e 100644 --- a/test/accessibility/apps/discover.ts +++ b/test/accessibility/apps/discover.ts @@ -20,20 +20,12 @@ import { FtrProviderContext } from '../ftr_provider_context'; export default function({ getService, getPageObjects }: FtrProviderContext) { - const PageObjects = getPageObjects([ - 'common', - 'discover', - 'header', - 'share', - 'timePicker', - 'home', - ]); + const PageObjects = getPageObjects(['common', 'discover', 'header', 'share', 'timePicker']); const a11y = getService('a11y'); const esArchiver = getService('esArchiver'); const kibanaServer = getService('kibanaServer'); const inspector = getService('inspector'); const filterBar = getService('filterBar'); - const docTable = getService('docTable'); const TEST_COLUMN_NAMES = ['@message']; const TEST_FILTER_COLUMN_NAMES = [ ['extension', 'jpg'], @@ -107,7 +99,6 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { await a11y.testAppSnapshot(); }); - // unable to validate on EUI pop-over it('click share button', async () => { await PageObjects.share.clickShareTopNavButton(); await a11y.testAppSnapshot(); From 047f15a44124cbcfde7558ea53fd40ca67ea6fb3 Mon Sep 17 00:00:00 2001 From: bhavyarm Date: Fri, 6 Mar 2020 14:10:51 -0500 Subject: [PATCH 4/6] adding context view test --- test/accessibility/apps/discover.ts | 12 ++++++++++++ test/accessibility/config.ts | 10 +++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/test/accessibility/apps/discover.ts b/test/accessibility/apps/discover.ts index 1bb2739c2fd6e..b00c7937a2bc8 100644 --- a/test/accessibility/apps/discover.ts +++ b/test/accessibility/apps/discover.ts @@ -25,6 +25,7 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const kibanaServer = getService('kibanaServer'); const inspector = getService('inspector'); + const docTable = getService('docTable'); const filterBar = getService('filterBar'); const TEST_COLUMN_NAMES = ['@message']; const TEST_FILTER_COLUMN_NAMES = [ @@ -128,5 +129,16 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { } await a11y.testAppSnapshot(); }); + + // Context view test + it('should open context view on a doc', async () => { + const firstTimestamp = (await docTable.getFields())[0][0]; + // navigate to the context view + await docTable.clickRowToggle({ rowIndex: 0 }); + await (await docTable.getRowActions({ rowIndex: 0 }))[0].click(); + await a11y.testAppSnapshot(); + }); + + // Adding rest of the tests after https://github.com/elastic/kibana/issues/53888 is resolved }); } diff --git a/test/accessibility/config.ts b/test/accessibility/config.ts index dd8c59c1be835..bb4ecc7113665 100644 --- a/test/accessibility/config.ts +++ b/test/accessibility/config.ts @@ -29,11 +29,11 @@ export default async function({ readConfigFile }: FtrConfigProviderContext) { testFiles: [ require.resolve('./apps/discover'), - require.resolve('./apps/dashboard'), - require.resolve('./apps/visualize'), - require.resolve('./apps/management'), - require.resolve('./apps/console'), - require.resolve('./apps/home'), + // require.resolve('./apps/dashboard'), + // require.resolve('./apps/visualize'), + // require.resolve('./apps/management'), + // require.resolve('./apps/console'), + // require.resolve('./apps/home'), ], pageObjects, services, From 3da4371bf976edbc0af3218d4e7bfef705983ad1 Mon Sep 17 00:00:00 2001 From: bhavyarm Date: Fri, 6 Mar 2020 15:32:47 -0500 Subject: [PATCH 5/6] uncommenting other tests --- test/accessibility/config.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/accessibility/config.ts b/test/accessibility/config.ts index bb4ecc7113665..dd8c59c1be835 100644 --- a/test/accessibility/config.ts +++ b/test/accessibility/config.ts @@ -29,11 +29,11 @@ export default async function({ readConfigFile }: FtrConfigProviderContext) { testFiles: [ require.resolve('./apps/discover'), - // require.resolve('./apps/dashboard'), - // require.resolve('./apps/visualize'), - // require.resolve('./apps/management'), - // require.resolve('./apps/console'), - // require.resolve('./apps/home'), + require.resolve('./apps/dashboard'), + require.resolve('./apps/visualize'), + require.resolve('./apps/management'), + require.resolve('./apps/console'), + require.resolve('./apps/home'), ], pageObjects, services, From 425867da968188e190a0eb9cf5c6702490998bc4 Mon Sep 17 00:00:00 2001 From: bhavyarm Date: Wed, 11 Mar 2020 16:25:24 -0400 Subject: [PATCH 6/6] fix additional discover tests --- test/accessibility/apps/discover.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/test/accessibility/apps/discover.ts b/test/accessibility/apps/discover.ts index b00c7937a2bc8..cf3d37d29b491 100644 --- a/test/accessibility/apps/discover.ts +++ b/test/accessibility/apps/discover.ts @@ -63,8 +63,7 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { await a11y.testAppSnapshot(); }); - // skipping the test for new because we can't fix it right now - it('Click on new to clear the search', async () => { + it.skip('Click on new to clear the search', async () => { await PageObjects.discover.clickNewSearchButton(); await a11y.testAppSnapshot(); }); @@ -132,10 +131,8 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { // Context view test it('should open context view on a doc', async () => { - const firstTimestamp = (await docTable.getFields())[0][0]; - // navigate to the context view - await docTable.clickRowToggle({ rowIndex: 0 }); - await (await docTable.getRowActions({ rowIndex: 0 }))[0].click(); + await docTable.clickRowToggle(); + await (await docTable.getRowActions())[0].click(); await a11y.testAppSnapshot(); });