From 69d1ce113f78f43983c66244d1664d7bc27c0a6b Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Wed, 18 Sep 2019 19:33:50 +0200 Subject: [PATCH 1/3] change interaction with 'select' element --- .../apps/visualize/_point_series_options.js | 3 +-- .../page_objects/point_series_page.js | 21 +++++++++---------- .../functional/page_objects/visualize_page.js | 4 +--- test/functional/services/find.ts | 8 +++++++ test/functional/services/test_subjects.ts | 4 ++++ .../test/functional/page_objects/gis_page.js | 4 +--- 6 files changed, 25 insertions(+), 19 deletions(-) diff --git a/test/functional/apps/visualize/_point_series_options.js b/test/functional/apps/visualize/_point_series_options.js index 69c874d618cf4..d175acbd6c02e 100644 --- a/test/functional/apps/visualize/_point_series_options.js +++ b/test/functional/apps/visualize/_point_series_options.js @@ -106,8 +106,7 @@ export default function ({ getService, getPageObjects }) { }); describe('multiple chart types', function () { - // FLAKY: https://github.com/elastic/kibana/issues/45970 - it.skip('should change average series type to histogram', async function () { + it('should change average series type to histogram', async function () { await pointSeriesVis.setSeriesType(1, 'histogram'); await PageObjects.visualize.clickGo(); const length = await pointSeriesVis.getHistogramSeries(); diff --git a/test/functional/page_objects/point_series_page.js b/test/functional/page_objects/point_series_page.js index f45fa5f5bf334..45626d03a5f00 100644 --- a/test/functional/page_objects/point_series_page.js +++ b/test/functional/page_objects/point_series_page.js @@ -24,11 +24,11 @@ export function PointSeriesPageProvider({ getService }) { class PointSeriesVis { async clickOptions() { - return await find.clickByPartialLinkText('Panel settings'); + return await testSubjects.click('visEditorTaboptions'); } async clickAxisOptions() { - return await find.clickByPartialLinkText('Metrics & axes'); + return await testSubjects.click('visEditorTabadvanced'); } async clickAddAxis() { @@ -50,17 +50,16 @@ export function PointSeriesPageProvider({ getService }) { } async getGridLines() { - const gridLines = await find.allByCssSelector('g.grid > path'); - - return await Promise.all(gridLines.map(async (gridLine) => { - const dAttribute = await gridLine.getAttribute('d'); - + const grid = await find.byCssSelector('g.grid'); + const $ = await grid.parseDomContent(); + return $('path').toArray().map(line => { + const dAttribute = $(line).attr('d'); const firstPoint = dAttribute.split('L')[0].replace('M', '').split(','); return { x: parseFloat(firstPoint[0]), y: parseFloat(firstPoint[1]), }; - })); + }); } async toggleGridCategoryLines() { @@ -69,15 +68,15 @@ export function PointSeriesPageProvider({ getService }) { async setGridValueAxis(axis) { log.debug(`setGridValueAxis(${axis})`); - return await find.clickByCssSelector(`select#gridAxis option[value="${axis}"]`); + await find.selectValue('select#gridAxis', axis); } async setSeriesAxis(series, axis) { - await find.clickByCssSelector(`select#seriesValueAxis${series} option[value="${axis}"]`); + await find.selectValue(`select#seriesValueAxis${series}`, axis); } async setSeriesType(series, type) { - await find.clickByCssSelector(`select#seriesType${series} option[value="${type}"]`); + await find.selectValue(`select#seriesType${series}`, type); } } diff --git a/test/functional/page_objects/visualize_page.js b/test/functional/page_objects/visualize_page.js index d4b5c820a0d5b..994a4d4a989c3 100644 --- a/test/functional/page_objects/visualize_page.js +++ b/test/functional/page_objects/visualize_page.js @@ -546,9 +546,7 @@ export function VisualizePageProvider({ getService, getPageObjects, updateBaseli } async selectAggregateWith(fieldValue) { - const sortSelect = await testSubjects.find(`visDefaultEditorAggregateWith`); - const sortMetric = await sortSelect.findByCssSelector(`option[value="${fieldValue}"]`); - await sortMetric.click(); + await testSubjects.selectValue('visDefaultEditorAggregateWith', fieldValue); } async getInterval() { diff --git a/test/functional/services/find.ts b/test/functional/services/find.ts index 29713304cd5cb..9723e3b745502 100644 --- a/test/functional/services/find.ts +++ b/test/functional/services/find.ts @@ -114,6 +114,14 @@ export async function FindProvider({ getService }: FtrProviderContext) { }); } + public async selectValue(selector: string, value: string): Promise { + log.debug(`Find.selectValue('${selector}', option[value="${value}"]')`); + const combobox = await this.byCssSelector(selector); + const $ = await combobox.parseDomContent(); + const text = $(`option[value="${value}"]`).text(); + await combobox.type(text); + } + public async filterElementIsDisplayed(elements: WebElementWrapper[]) { if (elements.length === 0) { return []; diff --git a/test/functional/services/test_subjects.ts b/test/functional/services/test_subjects.ts index aaad4f7c238ff..c5e360d093957 100644 --- a/test/functional/services/test_subjects.ts +++ b/test/functional/services/test_subjects.ts @@ -164,6 +164,10 @@ export function TestSubjectsProvider({ getService }: FtrProviderContext) { }); } + public async selectValue(selector: string, value: string): Promise { + await find.selectValue(`[data-test-subj="${selector}"]`, value); + } + public async isEnabled(selector: string): Promise { return await retry.try(async () => { log.debug(`TestSubjects.isEnabled(${selector})`); diff --git a/x-pack/test/functional/page_objects/gis_page.js b/x-pack/test/functional/page_objects/gis_page.js index 49860fd9a313b..2da9b1d8e874c 100644 --- a/x-pack/test/functional/page_objects/gis_page.js +++ b/x-pack/test/functional/page_objects/gis_page.js @@ -406,9 +406,7 @@ export function GisPageProvider({ getService, getPageObjects }) { async setIndexType(indexType) { log.debug(`Set index type to: ${indexType}`); - await find.clickByCssSelector( - `select[data-test-subj="fileImportIndexSelect"] > option[value="${indexType}"]` - ); + await testSubjects.selectValue('fileImportIndexSelect', indexType); } async indexTypeOptionExists(indexType) { From 9c19d9a135f73f3cfb0e288776b241b584e8ad72 Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Wed, 18 Sep 2019 20:35:45 +0200 Subject: [PATCH 2/3] run ciGroup5 15x times --- .ci/jobs.yml | 41 ++++++++++++++++++-------- test/scripts/jenkins_build_kibana.sh | 2 +- test/scripts/jenkins_ci_group.sh | 2 +- test/scripts/jenkins_xpack_ci_group.sh | 12 ++++---- 4 files changed, 36 insertions(+), 21 deletions(-) diff --git a/.ci/jobs.yml b/.ci/jobs.yml index f7e204d4547a0..d9e21bae3c804 100644 --- a/.ci/jobs.yml +++ b/.ci/jobs.yml @@ -1,20 +1,35 @@ JOB: - - intake - - firefoxSmoke - - kibana-ciGroup1 - - kibana-ciGroup2 - - kibana-ciGroup3 - - kibana-ciGroup4 - - kibana-ciGroup5 - - kibana-ciGroup6 + # - intake + # - firefoxSmoke + # - kibana-ciGroup1 + # - kibana-ciGroup2 + # - kibana-ciGroup3 + # - kibana-ciGroup4 + - kibana-ciGroup5-1 + - kibana-ciGroup5-2 + - kibana-ciGroup5-3 + - kibana-ciGroup5-4 + - kibana-ciGroup5-5 + - kibana-ciGroup5-6 + - kibana-ciGroup5-7 + - kibana-ciGroup5-8 + - kibana-ciGroup5-9 + - kibana-ciGroup5-10 + - kibana-ciGroup5-11 + - kibana-ciGroup5-12 + - kibana-ciGroup5-13 + - kibana-ciGroup5-14 + - kibana-ciGroup5-15 + + # - kibana-ciGroup6 # - kibana-visualRegression # make sure all x-pack-ciGroups are listed in test/scripts/jenkins_xpack_ci_group.sh - - x-pack-ciGroup1 - - x-pack-ciGroup2 - - x-pack-ciGroup3 - - x-pack-ciGroup4 - - x-pack-ciGroup5 + # - x-pack-ciGroup1 + # - x-pack-ciGroup2 + # - x-pack-ciGroup3 + # - x-pack-ciGroup4 + # - x-pack-ciGroup5 # - x-pack-visualRegression # `~` is yaml for `null` diff --git a/test/scripts/jenkins_build_kibana.sh b/test/scripts/jenkins_build_kibana.sh index 8a9cee7a5f1fa..42e04125a9fb7 100755 --- a/test/scripts/jenkins_build_kibana.sh +++ b/test/scripts/jenkins_build_kibana.sh @@ -6,7 +6,7 @@ echo " -> downloading es snapshot" node scripts/es snapshot --license=oss --download-only; echo " -> Ensuring all functional tests are in a ciGroup" -yarn run grunt functionalTests:ensureAllTestsInCiGroup; +#yarn run grunt functionalTests:ensureAllTestsInCiGroup; echo " -> building and extracting OSS Kibana distributable for use in functional tests" node scripts/build --debug --oss diff --git a/test/scripts/jenkins_ci_group.sh b/test/scripts/jenkins_ci_group.sh index 6807e318138ce..a1fb9eee4b0b2 100755 --- a/test/scripts/jenkins_ci_group.sh +++ b/test/scripts/jenkins_ci_group.sh @@ -11,7 +11,7 @@ fi export TEST_BROWSER_HEADLESS=1 if [[ -z "$IS_PIPELINE_JOB" ]] ; then - yarn run grunt functionalTests:ensureAllTestsInCiGroup; + #yarn run grunt functionalTests:ensureAllTestsInCiGroup; node scripts/build --debug --oss; else installDir="$(realpath $PARENT_DIR/kibana/build/oss/kibana-*-SNAPSHOT-linux-x86_64)" diff --git a/test/scripts/jenkins_xpack_ci_group.sh b/test/scripts/jenkins_xpack_ci_group.sh index cd81b17ff4a25..1af5e8b64b5fc 100755 --- a/test/scripts/jenkins_xpack_ci_group.sh +++ b/test/scripts/jenkins_xpack_ci_group.sh @@ -13,12 +13,12 @@ export TEST_BROWSER_HEADLESS=1 if [[ -z "$IS_PIPELINE_JOB" ]] ; then echo " -> Ensuring all functional tests are in a ciGroup" cd "$XPACK_DIR" - node scripts/functional_tests --assert-none-excluded \ - --include-tag ciGroup1 \ - --include-tag ciGroup2 \ - --include-tag ciGroup3 \ - --include-tag ciGroup4 \ - --include-tag ciGroup5 + # node scripts/functional_tests --assert-none-excluded \ + # --include-tag ciGroup1 \ + # --include-tag ciGroup2 \ + # --include-tag ciGroup3 \ + # --include-tag ciGroup4 \ + # --include-tag ciGroup5 fi cd "$KIBANA_DIR" From b972b57bdd81dfa7c0e853d93f9b48f39988b989 Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Thu, 19 Sep 2019 08:30:13 +0200 Subject: [PATCH 3/3] Revert "run ciGroup5 15x times" This reverts commit 9c19d9a135f73f3cfb0e288776b241b584e8ad72. --- .ci/jobs.yml | 41 ++++++++------------------ test/scripts/jenkins_build_kibana.sh | 2 +- test/scripts/jenkins_ci_group.sh | 2 +- test/scripts/jenkins_xpack_ci_group.sh | 12 ++++---- 4 files changed, 21 insertions(+), 36 deletions(-) diff --git a/.ci/jobs.yml b/.ci/jobs.yml index d9e21bae3c804..f7e204d4547a0 100644 --- a/.ci/jobs.yml +++ b/.ci/jobs.yml @@ -1,35 +1,20 @@ JOB: - # - intake - # - firefoxSmoke - # - kibana-ciGroup1 - # - kibana-ciGroup2 - # - kibana-ciGroup3 - # - kibana-ciGroup4 - - kibana-ciGroup5-1 - - kibana-ciGroup5-2 - - kibana-ciGroup5-3 - - kibana-ciGroup5-4 - - kibana-ciGroup5-5 - - kibana-ciGroup5-6 - - kibana-ciGroup5-7 - - kibana-ciGroup5-8 - - kibana-ciGroup5-9 - - kibana-ciGroup5-10 - - kibana-ciGroup5-11 - - kibana-ciGroup5-12 - - kibana-ciGroup5-13 - - kibana-ciGroup5-14 - - kibana-ciGroup5-15 - - # - kibana-ciGroup6 + - intake + - firefoxSmoke + - kibana-ciGroup1 + - kibana-ciGroup2 + - kibana-ciGroup3 + - kibana-ciGroup4 + - kibana-ciGroup5 + - kibana-ciGroup6 # - kibana-visualRegression # make sure all x-pack-ciGroups are listed in test/scripts/jenkins_xpack_ci_group.sh - # - x-pack-ciGroup1 - # - x-pack-ciGroup2 - # - x-pack-ciGroup3 - # - x-pack-ciGroup4 - # - x-pack-ciGroup5 + - x-pack-ciGroup1 + - x-pack-ciGroup2 + - x-pack-ciGroup3 + - x-pack-ciGroup4 + - x-pack-ciGroup5 # - x-pack-visualRegression # `~` is yaml for `null` diff --git a/test/scripts/jenkins_build_kibana.sh b/test/scripts/jenkins_build_kibana.sh index 42e04125a9fb7..8a9cee7a5f1fa 100755 --- a/test/scripts/jenkins_build_kibana.sh +++ b/test/scripts/jenkins_build_kibana.sh @@ -6,7 +6,7 @@ echo " -> downloading es snapshot" node scripts/es snapshot --license=oss --download-only; echo " -> Ensuring all functional tests are in a ciGroup" -#yarn run grunt functionalTests:ensureAllTestsInCiGroup; +yarn run grunt functionalTests:ensureAllTestsInCiGroup; echo " -> building and extracting OSS Kibana distributable for use in functional tests" node scripts/build --debug --oss diff --git a/test/scripts/jenkins_ci_group.sh b/test/scripts/jenkins_ci_group.sh index a1fb9eee4b0b2..6807e318138ce 100755 --- a/test/scripts/jenkins_ci_group.sh +++ b/test/scripts/jenkins_ci_group.sh @@ -11,7 +11,7 @@ fi export TEST_BROWSER_HEADLESS=1 if [[ -z "$IS_PIPELINE_JOB" ]] ; then - #yarn run grunt functionalTests:ensureAllTestsInCiGroup; + yarn run grunt functionalTests:ensureAllTestsInCiGroup; node scripts/build --debug --oss; else installDir="$(realpath $PARENT_DIR/kibana/build/oss/kibana-*-SNAPSHOT-linux-x86_64)" diff --git a/test/scripts/jenkins_xpack_ci_group.sh b/test/scripts/jenkins_xpack_ci_group.sh index 1af5e8b64b5fc..cd81b17ff4a25 100755 --- a/test/scripts/jenkins_xpack_ci_group.sh +++ b/test/scripts/jenkins_xpack_ci_group.sh @@ -13,12 +13,12 @@ export TEST_BROWSER_HEADLESS=1 if [[ -z "$IS_PIPELINE_JOB" ]] ; then echo " -> Ensuring all functional tests are in a ciGroup" cd "$XPACK_DIR" - # node scripts/functional_tests --assert-none-excluded \ - # --include-tag ciGroup1 \ - # --include-tag ciGroup2 \ - # --include-tag ciGroup3 \ - # --include-tag ciGroup4 \ - # --include-tag ciGroup5 + node scripts/functional_tests --assert-none-excluded \ + --include-tag ciGroup1 \ + --include-tag ciGroup2 \ + --include-tag ciGroup3 \ + --include-tag ciGroup4 \ + --include-tag ciGroup5 fi cd "$KIBANA_DIR"