Commit graph

24 commits

Author SHA1 Message Date
Bhavya RM fc7e7b4e32
Functional test to surface index version conflicts (#22509) 2018-08-29 23:13:40 -04:00
Lee Drengenberg ba462a9fb0
refactor login page check, turn off telemetry (#17435)
* refactor login page check, turn off telemetry

* significant refactor of navigateTo

* replace slashes with _ in test failure output html files

* re-do out of date PR
2018-07-12 08:31:43 -05:00
Spencer b25ab869f7
[ftr/confirmModal] assert expected state rather than just reading (#20019)
I've seen a few failures recently like https://kibana-ci.elastic.co/job/elastic+kibana+pull-request+multijob-selenium/4940/console which are caused by the modal not being visible, but if you look at the screenshot you can see the the modal was just about to be displayed but the find didn't wait quite long enough. ~~To fix this temporarily I've increased the `isConfirmModalOpen()` timeout from 2 to 5 seconds.~~

These tests are actually trying to assert that the modal is gone, so rather than simply checking the state of the modal once, the `CommonPage#isConfirmModalOpen()` method has been renamed to `CommonPage#expectConfirmModalOpenState()` which expects a boolean and will assert the state of the confirm modal within a retry, so that as long as the modal eventually transitions to that state it will eventually resolve.

![dashboard app using legacy data dashboard listing page delete default confirm action is cancel 1](https://user-images.githubusercontent.com/1329312/41569272-3215b4aa-731f-11e8-864a-0c0022228245.png)
2018-06-18 21:05:21 -07:00
Stacey Gammon 803d0a61f3
Update dashboard snapshot tests (#19420)
* update snapshot tests

* Update time ranges

* Add sleeps, adjust time, update snapshots

* Skip TSVB until the issue with vertical line placement and x-axis timestamps is fixed

* fix expectations of time range with saved search creation

* remove debug line
2018-05-29 12:58:36 -04:00
Spencer f0cc432faf
Apache 2.0 license headers (#19383)
In order to make the license that applies to each file as clear as possible, and to be consistent with elasticsearch, we are adding Apache 2.0 license headers to the top of each file.

Existence of this header is enforced by eslint and tslint and missing headers were automatically added in the last commit by running:

```
node scripts/eslint --fix && node scripts/tslint --fix
```
2018-05-28 20:06:30 -07:00
Nathan Reese 9c3481c078
EUI dashboard add panel (#17374)
* EUI add panel

* implement add functionallity

* style flyout so top nav is not covered

* add noItemsMessage

* add new visualization button

* remove angular add_panel template

* seperate search bar and table into its own component

* fix functional tests

* make slide out panel own focus to avoid weirdness of letting other buttons in nav from getting clicked and leaving slide out open

* remove deprecated method componentWillMount

* add jest test for DashboardAddPanel

* fix paging and replace EuiSearcBar with EuiFieldSearch

* fix functional tests

* fix dashboard filter bar functional test

* another functional test fix

* add more context to functional test failure message

* give search input a default value

* remove call to waitForRenderComplete to see if tests will pass

* fix dashboard filtering test

* updates from Stacey-Gammon review

* support filtering out lab visualizations

* add functional test for testing visualize:enableLabs with add panel

* add sorting by title to SavedObjectFinder componenet

* move add panel tabs to state

* clean up labs test differently
2018-05-24 11:05:52 -06:00
Stacey Gammon 3c8c23c9ef
Expand coverage of dashboard tests (#17703)
* Expand coverage of dashboard tests and decrease time

* Fix timing error when sub urls fail to save from too fast app link clicking

* discover doesn't have breadcrumbs

* Check top nav text so it works on both listing and saved object edit/view pages

* need to do the add panel operations one at a time

* Need both types of input in filter

* Give test data a title

* Remove incorrect and unnecessary comment

* Move data around and get rid of 6_3 specific naming as we will end up migrating the data as we progress

* Remove code accidentally checked in
2018-05-01 09:12:36 -04:00
CJ Cenizal 6e9fc7328b
Extract fatal notification into fatalError service, add support for EuiToast notifications (#15749)
* Reorganize notify/lib files. Extract fatal notification into a fatalError service.
* Convert notify/lib tests to use Jest.
* Add ToastNotifications, GlobalToastList, and documentation.
* Remove notify.info method.
* Add createFirstIndexPatternPrompt.
* Update testSubjects.exists to accept a timeout argument.
* Skip some flaky tests.
2018-01-26 20:14:28 -08:00
Spencer 5cddc10077
Upgrade to eslint 4 (#14862)
* [eslint] upgrade to 4.10.0

* [eslint-config-kibana] limit jest config to jest test files

* [ui_framework] remove trailing comma from rest-spreads

* [dashboard/tests] tag jest helpers with .test.js suffix

* explicitly import expect.js where used

* [eslint] apply auto-fixes

* [eslint] manually add/wrap some parens for compliance

* [npm] point to local packages for testing/review

* [jest] remove .test extension from jest helpers

* [ui_framework] fix trailing comma removal from 3bc661a1c8

* [packages] upgrade eslint packages
2017-11-14 18:16:59 -07:00
CJ Cenizal 05cbb92965 [eslint-config-kibana] Apply AirBnB spacing rules (#14522)
* Add AirBnB key-spacing rule.
* Add AirBnB comma-spacing rule.
2017-10-25 15:08:05 -07:00
Kim Joar Bekkelund 6a2bb74407 Use Object spread instead of Object.assign where it makes sense (#13903)
* Prefer Object spread

* Add eslint rules for Object spread

* no slice
2017-10-10 14:50:56 +02:00
Chris Roberson 4c1d029c79 [Management] Allows for imports to select existing index (#14137)
* Adds ability to change index pattern on import

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

* UI changes. Use a table in the modal grouped by index pattern id instead of multiple modals.

* PR feedback

* PR feedback

* PR updates

* Handle skip properly

* Fix error when there were no existing index patterns

* Tests for the new import conflict logic

* Fix invisible filters caused by missing index pattern (#14131)

"invisible filters" occur when the mapping chain throws an error. If a single filter throws an error, the entire chain rejects. As a result, not even the valid filters appear in the filter bar because they never get added to the scope. However the filters still exist in app state and still get sent with each search request.

The most common error occurs when the filter's meta.index property points to a non-existing index pattern. Since this property is only used for looking up field formatters and it is not essential for a working filter, we now fall back on raw values instead of failing if the index pattern is not found. See the PR this one replaces for discussion about other solutions we tried and why we chose to go this route.

* Show query and filter bars even when there's a linked search (#14212)

The query bar used to be hidden in the presence of a linked search because unlike filters, queries didn't get merged when flattening a SearchSource hierarchy. That means a query in the query bar would override the query in the linked search. This is no longer the case. As of 6.0 we include all queries in the SearchSource hierarchy in the final request, so there's no longer any reason to hide the query bar.

Since filters created via a Vis show up in the query bar when Kuery is selected, these filters now appear correctly even when there's a linked search in the vis editor.

Previously when unlinking a saved search visualize would insert the query and filters from the saved search into app state before removing the SearchSource from the hierarcy. This posed a problem because combining two lucene query strings isn't as easy as combing two sets of filters. We decided this behavior was a bit counterintuitive anyway. If the user wants to unlink the saved search, they probably want to discard it, not combine it with their local changes. So I've also updated the unlinking functionality to discard the saved search.

* limit wait time for baselayer (#14047)

* adding scope appy back (#14269)

* remove junk tests (#14191)

* We are using the index pattern id now

* Use the index pattern id here too

* Use an isolated es env for these tests

* Revert "Fix invisible filters caused by missing index pattern (#14131)"

This reverts commit e09d7ad1f9.

* Revert "Show query and filter bars even when there's a linked search (#14212)"

This reverts commit 3aee7c2bf0.

* Revert "limit wait time for baselayer (#14047)"

This reverts commit 44a71071ac.

* Revert "adding scope appy back (#14269)"

This reverts commit 51b6b51aac.

* Revert "remove junk tests (#14191)"

This reverts commit f06c18332b.

* Revert these
2017-10-04 20:42:07 -04:00
Stacey Gammon 4f5313a088 Make sure no one can show the chrome if the default setting is hidden. (#13250)
* Make sure no one can show the chrome if the default setting is hidden.

add tests

Fixes https://github.com/elastic/kibana/issues/13040

* Improve variable and function names and fix tests
2017-08-03 11:25:38 -04:00
Stacey Gammon 589df61e03 Stabilize and bring back flaky tests (#13034)
* Stabalize tests and bring back flaky test

* Try to fix flaky map radius visualize test

* fix flaky tile map zoom test

* Try to fix flaky zoom test by avoiding zooming in and out with spy panel open

* Remove duplicate wrapped retry around find methods

The retry was moved internally, around a check for stale elements as
well, so this should no longer be neccessary.
2017-07-27 15:26:09 -04:00
Shaunak Kashyap 27745f72a3 Revert the Getting Started page (#12154)
* Revert "When on an embedded page, bypass Getting Started gate check (#12040)"

This reverts commit 05293f1c8d.

* Revert "Making tweaks. (#12003)"

This reverts commit aa3fa06f61.

* Revert "Functional tests for the Getting Started page (#11850)"

This reverts commit 099178a7ca.

* Revert "Prevent flicker on Getting Started page (#11826)"

This reverts commit c4b3ade27d.

* Revert "Getting Started page (#11805)"

This reverts commit 32eff371f2.

* Remove check for Getting Started page from navigateToApp
2017-06-05 14:18:30 -07:00
Stacey Gammon 5bc5c03ab8 fix dashboard view/edit flaky test (#12026)
* attempt to fix dashboard view/edit flaky test

hope to fix https://github.com/elastic/kibana/issues/12014

* Need to wait for global loading indicator to be hidden once top nav is visible

* use Error object for throw

* inline function only used once
2017-05-31 12:29:08 -04:00
Shaunak Kashyap 099178a7ca Functional tests for the Getting Started page (#11850)
* Adding some more functionality to the Getting Started page object

* Using optOut method from Getting Started page object

* Adding functional tests for Getting Started page

This set of tests specifically tests the scenarios under which a user should or should not get redirected to the Getting Started page

* Adding log.debug message

* Conforming to HTML style guide

* Using new GettingStarted page object methods + opting out

* Adding test for nav being shown

* Removing unnecessary line

* Navigate to Discover expecting to be redirected to the Getting Started page

* Trying beforeEach instead of before

* Remove LS data index + load empty kibana index

* Removing unnecessary line

* Fixing order of operations
2017-05-23 07:09:04 -07:00
Spencer c9c8e8d066 [tests/functional] opt out of getting started on navigation (#11881)
* [tests/functional] automatically opt-out of getting started page on navigation

* [test/functional/commonPage] avoid circular reference

* [test/functional/commonPage] move check for getting started after url has settled

* [gettingStarted] prevent route resolution by returning halt promises

* [test/functional/commonPage] wait for kibana to load before checking for getting started

* [uiRoutes/setupWork] provide a token that can be thrown to halt setup work

* [ui/routes] rename reference to WAIT_FOR_URL_CHANGE_TOKEN

* address review feedback
2017-05-18 19:33:53 -07:00
Spencer d3ba428796 [ftr] make room for more projects (#11848)
Squashed commit of the following:

commit 659ea986fdeb9a5ff2ca1fa5360cccb01c671ede
Author: spalger <spalger@users.noreply.github.com>
Date:   Wed May 17 09:19:22 2017 -0700

    [test/*/fixtures] rename es_archives to es_archiver

commit d3667457c78e88e2d6974f3c38dd0fe61b846b91
Author: spalger <spalger@users.noreply.github.com>
Date:   Wed May 17 08:22:03 2017 -0700

    [ftr/config] fix default directory value functions

commit 9a6a2cc0b295e2281e83da04fcea40e9d6f00781
Author: spalger <spalger@users.noreply.github.com>
Date:   Wed May 17 07:30:52 2017 -0700

    fix import paths

commit fcb65a877d54b5b1d36b8c81f1264b36845e826e
Author: spalger <spalger@users.noreply.github.com>
Date:   Tue May 16 21:39:57 2017 -0700

    [grunt/ftr] use named exports for configs

commit 7d7f38c7615cdbf8eb0119efc0f2a5188bca8792
Author: spalger <spalger@users.noreply.github.com>
Date:   Tue May 16 18:50:04 2017 -0700

    [test] remove unnecessary directory definitions

commit 0c28984669768482f0a2ee7fc2800d5bcaf49025
Author: spalger <spalger@users.noreply.github.com>
Date:   Tue May 16 18:46:29 2017 -0700

    [ftr/config] make default directories relative to config path

commit cd2f33612624cacffec138797f3fc0f4ecb46cca
Author: spalger <spalger@users.noreply.github.com>
Date:   Tue May 16 18:32:12 2017 -0700

    [test/common] put server config into common

commit 7851ed811a236576c63bd20850b3ef2099be2a4e
Author: spalger <spalger@users.noreply.github.com>
Date:   Tue May 16 18:18:20 2017 -0700

    [grunt] "deprecate" test:api:runner task

commit b2ac4c26593a1947c94f0168191fe8123ff74122
Author: spalger <spalger@users.noreply.github.com>
Date:   Tue May 16 18:15:41 2017 -0700

    [ftr] accept the project name as an unnamed arg

commit 47e292894fc70c0a04883403c50c5d2ae0738d76
Author: spalger <spalger@users.noreply.github.com>
Date:   Tue May 16 17:56:34 2017 -0700

    [ftr/grunt] convert ftr task to multi-task with config

commit 83375855f88e5e7b3fa8b6a1c5d24a9f54766ce5
Author: spalger <spalger@users.noreply.github.com>
Date:   Tue May 16 17:54:54 2017 -0700

    [test/functional] move fixtures into test/functional project

commit 05994e9c92cf134c58f831c285b3b522a801acbc
Author: spalger <spalger@users.noreply.github.com>
Date:   Tue May 16 17:02:51 2017 -0700

    [src/test_utils] merge with test/utils directory

commit c77ee5ed36b8b7eadf876cb6d9482a49dfc92b66
Author: spalger <spalger@users.noreply.github.com>
Date:   Tue May 16 16:53:00 2017 -0700

    [test/api_integration] migrate api tests to functional test runner

commit ca328c34648dd7e07f70e1844e07cfc392e41103
Author: spalger <spalger@users.noreply.github.com>
Date:   Tue May 16 16:50:12 2017 -0700

    [esArchiver] refresh modified indices after load

commit cde74a540850fd97578f441d6dccaefd1444e656
Author: spalger <spalger@users.noreply.github.com>
Date:   Tue May 16 16:46:48 2017 -0700

    [test/functional] move shared services into test/common

commit 0ea2646aea5817f6d1595e6ae0d356c426f138f0
Author: spalger <spalger@users.noreply.github.com>
Date:   Mon May 15 22:51:23 2017 -0700

    [scripts/mocha] run _mocha script when debugging

commit 1cc80600d90e318d4738920aa557d124075a4570
Author: spalger <spalger@users.noreply.github.com>
Date:   Mon May 15 22:48:12 2017 -0700

    [ftr/config] allow child config files to have no testFiles config

commit 2bb6c957443b18cebc419baa6f9db301c8f4dc4f
Author: spalger <spalger@users.noreply.github.com>
Date:   Mon May 15 21:52:26 2017 -0700

    [ftr] move screenshots into test/functional
2017-05-17 18:53:45 -07:00
Stacey Gammon a9ee082660 Fix modals in react (#11714)
* fix focused button not being set

Need to do it in a timeout because ng-react hasn’t loaded the react
code yet, so it can’t find the buttons.

* add a test

that would have caught the issue, and also change the default focused
button for the listing delete page since it’s a destructive action.

* Add a comment

* Push focusing of default button into react code

* Push ESC key handling into react as well

* Remove ESC tests in angular form

They don’t pass, I’m guessing because of the way it’s triggered, but
these test cases should now be handled in jest.  Also confirmed it
works as expected with the modal.

* Address code review comments

* Use autoFocus
2017-05-17 09:48:26 -04:00
Shaunak Kashyap 32eff371f2 Getting Started page (#11805)
* Getting Started page (#11673)

* Initial code

* Renaming files/folders

* Notes and changes from HTML/CSS review

* CSS changes

* Fixing transform units

* Fleshing out logo circle

* Adding logos

* Un-nesting styles

* Adding kuiText class on <p> elements

* Making shield icon 404 go away

* Using trustAsHtml filter; using registry

* Adding code for registry

* Adding images

* Hooking up the opt-out link

* Fixing linter issues

* Fix issue with refresh bringing back nav

* Removing load_default module

* Use GETTING_STARTED_ROUTE constant

* Allow topMessage to be a directive

* Adding kuiLink CSS class to anchor elements

* Adding alt text to images

* Replace getters with regular methods

* Remove leftover comment

* Removing unnecessary comment

* Fixing typo in comment

* Adding comments for message properties

* Fixing typo in method name

* Defining custom CSS class

* Fixing method call

* Creating custom CSS classes

* Adding documentation links

* Use a instead of button for demo link

* Allow directives in manage and monitor messages

* Refactoring shared code into single ui/public/getting_started folder

* Adding README

* Fixing whitespace in/around links

* Trim messages before setting them

* Decorate in-app links with opt-out attribute

* Opt out of the Getting Started page if the user already has index patterns

* Adding more commentary around expectations of setTopMessage use

* Using ng-src and ng-href attributes where attr values are angular expressions

* Importing the directive before using it

* Using ui/registry for message registries

* Renaming service => helpers to clarify intent

* Adding explanatory comment

* Adding "or"

* Fixing div id

* Breaks out the inject logic into another directive

* Adding Getting Started page object for functional tests

* Consolidate into one registry

* Fixes incorrect classes

* Changes how styles are applied to injected-items items

* Modifying class name per CSS style guide

* Adding getting started doc link

* Removing unused import

* Attempting to fix breaking build

Apparently the Getting Started page is preventing access to Console (Dev Tools, really) so the functional tests for Console are failing. This commit opts the user out of the Getting Started page before attempting to navigate to Console.

* Cleanup on aisle testbed! (#11765)

* Navigate to getting started page so we can opt out of it
2017-05-15 14:04:16 -07:00
Spencer 2e7fed87fd [ftr] take screenshots on failure (#11709)
* [tests/functional] move screenshots to their own service

* [ftr] add testFailure and testHookFailure lifecycle hooks

* [tests/functional/screenshots] cleanup old screenshots at startup

* [test/functional/screenshots] take screenshots when tests fail

* [cli_plugin/install] fix test

* [ui/scanner] fix test
2017-05-11 12:07:23 -07:00
Spencer 36ccbc1465 Tweaks needed for integrating with the functional test runner (#11469)
* [git] ignore the entire root optimize directory

* [ftr] fix readConfigFile export

* [ftr/config] set default hostname and protocols for urls

* [chrome] make top-level chrome a test-subject

* [ftr/CommonPage] only auto-login when not navigating to the login page
2017-04-27 09:01:54 -07:00
Spencer 90434765c0 [functionalTestRunner] replace intern (#10910)
* [functional_test_runner] replace functional testing tools with custom/pluggable solution

* [functional_test_runner] Convert unit tests to commonjs format

* [functional_test_runner] Fix dashboard test in wrong mode

* [functional_test_runner] Add dashboardLandingPage test subject

* [functional_test_runner] Get Visualize page object

* [functional_test_runner] Fix outdated references

* [functional_test_runner] Fix more outdated refs

* [functional_test_runner] Remove duplicate tests

* [functional_test_runner] Improve test readability

* [functional_test_runner] 😞 So many duplicate methods

* [functional_test_runner] Move mgmt `before` outside toplevel describe

* [functional_test_runner] Settings page obj missing methods

* [functional_test_runner] Add improvements from @gammon

* [functional_test_runner] Fix return statements in async funcs

* [functional_test_runner] Move before() to correct scope

* [functional_test_runner] Add after() hooks to remove index patterns

* [functional_test_runner] Attempt to fix vertical bar chart tests

* [functional_test_runner] Clean up

* [functional_test_runner] Reinstate unit tests

* [functional_test_runner] Set default loglevel back to info

* [functional_test_runner] Replace `context`s with `describe`s

* [functional_test_runner] Better error handling

* [functional_test_runner] Add in new Tile Map tests

* Incorporate changes from master

* [functional_test_runner] validate that every test file has a single top-level suite

* Update contributing doc with link to full doc

* [docs] Spelling and grammar fixes

* docs: writing and running functional tests

* [docs] Move plugin doc to plugin area

* [docs] Housekeeping. Doc in wrong place

* [docs] Remove dup doc file

* [grunt] Only run mocha_setup when running tests, not every grunt task
2017-04-11 17:01:06 -05:00