Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Documentation][Data Explorer] Legacy discover plugin functional tests #4758

Closed
abbyhu2000 opened this issue Aug 17, 2023 · 5 comments
Closed
Assignees
Labels
data explorer Issues related to the Data Explorer project de-angular de-angularize work discover for discover reinvent

Comments

@abbyhu2000
Copy link
Member

This issue documents the existing functional tests for the legacy discover plugin in order to help migrate the old tests to new tests for the data explorer.

_date_nanos_mixed.js

  1. shows a list of records of indices with date & date_nanos fields in the right order

_date_nanos.js

  1. should show a timestamp with nanoseconds in the first result row

_discover_histogram.ts --> display data in histogram for different time interval based on different time range

  1. should visualize monthly data with different day intervals:
   const fromTime = 'Nov 01, 2017 @ 00:00:00.000';
   const toTime = 'Mar 21, 2018 @ 00:00:00.000';
   await prepareTest(fromTime, toTime, 'Month');
  1. should visualize weekly data with within DST changes
   const fromTime = 'Mar 01, 2018 @ 00:00:00.000';
   const toTime = 'May 01, 2018 @ 00:00:00.000';
   await prepareTest(fromTime, toTime, 'Week');
  1. should visualize monthly data with different years scaled to 30 days
   const fromTime = 'Jan 01, 2010 @ 00:00:00.000';
   const toTime = 'Mar 21, 2019 @ 00:00:00.000';
   await prepareTest(fromTime, toTime, 'Day');

_discover.js

  1. Query:
    • when set time filter by setDefaultAbsoluteRange(), time picker should have the correct time range string
    • when save a saved search, the name is correctly saved
    • when load a saved search using loadSavedSearch(), the name should be correctly loaded
    • rename a saved search should modify the name in the breadcrumb
    • should show correct hit count
      Screenshot 2023-08-16 at 2 45 58 PM
    • the chart time span should equal to the difference between start time and end time
    • time range is modified when a histogram bar is clicked and they are modified to the start and end time of the histogram bar, doc table needs to contain the right search result
    • time range is modified when the histogram is brushed(drag and select multiple histogram bars at the same time), doc table needs to contain the right search result according to the time range
    • the initial chart interval is auto by default
    • should not show no result if loaded with index pattern
    • reset save search button reload the save search to its previous persisted state
      Screenshot 2023-08-16 at 3 01 09 PM
  2. Query which has an empty time range
    • should show no results
    • should suggest a new time range should be picked
      Screenshot 2023-08-16 at 3 03 57 PM
  3. Nested query
    • should support nested query such as setQuery('nestedField:{ child: nestedValue }')
  4. Data-shared-item
    • should have the correct data-shared-item title and description in the HTML
  5. Time zone switch
    • time zone can be switch in Advanced Settings dataFormat, bars should be shown in the correct time zone
  6. Search on page load
    • should fetch data initially when searchOnPageLoad is false
    • should not fetch data initially when searchOnPageLoad is true
  7. Invalid time range in URL should reset to previous time range
  8. Query should change the chart time span
  9. Can add a field, sort the field; remove a field
  10. Should refetch when auto-refresh is enabled

_doc_navigation.js

  1. row toggle should open the doc view for the selected document
  2. Add filter for value & filter out value filters from document
Screen.Recording.2023-08-16.at.3.52.25.PM.mov

_doc_table

  1. show 50 rows by default
  2. table content should be changed when time range is changed
  3. should show 500 rows at max when scrolling to the end
  4. should go to the end of the table when using accessible skip button
  5. should expand the document by toggling arrow
  6. should show View surrounding document and View single document
  7. Can add/remove column from the table

_errors.ts

  1. invalid scripted field error is rendered --> load index pattern test/functional/fixtures/opensearch_archiver/invalid_scripted_field
Screenshot 2023-08-16 at 4 14 19 PM

_field_data.js (is skipped due to flakiness)

  1. show correct hit count
  2. search term should be highlighted in the field data
  3. doc view should have two columns: Time and _source
  4. doc view should sort ascending
  5. a bad syntax query should show an error toast
Screenshot 2023-08-16 at 4 21 57 PM

_field_visualize.js

  1. Be able to visualize a field and save the visualization
    Screenshot 2023-08-16 at 4 35 57 PM
  2. Should visualize a field in area chart
  3. Field geo.coordinated should not have visualize option
    Screenshot 2023-08-16 at 4 36 14 PM
  4. App filter should be persisted from the discover page to the created field visualization
  5. App query should also be persisted from the discover page to the created field visualization

_filter_editor.js --> Test the filter functionality in discover page

  1. Be able to add a phrase filter ex. 'extension.raw', 'is one of', 'jpg'
  2. Should show phrase filter when reopen it
  3. Be able to support nested filter ex. 'nestedField.child', 'is', 'nestedValue'

_indexpattern_with_encoded_id.ts --> load index pattern test/functional/fixtures/opensearch_archiver/index_pattern_with_encoded_id

  1. should show detailed row when toggle arrow is clicked
  2. should show panel action View single document and View surrounding document

_indexpattern_without_timefield.ts --> load index pattern test/functional/fixtures/opensearch_archiver/index_pattern_without_timefield

  1. should not display a time picker
    Screenshot 2023-08-16 at 4 54 20 PM
  2. will only display time picker after switching to an index pattern with time field

_inspector.js

  1. should display request stats with no result with empty time range
  2. should display request stats result with proper time range

_large_string.js

  1. large string doc should be displayed correctly
  2. search a single word as query in a large data
    • should still show correct hit count
    • the search term should be highlighted in yellow

_saved_queries.js --> test saved query management functionality in discover page

  1. should always show the saved query management component even when there are no saved queries
  2. should allow a query to be saved via the saved objects management component
  3. reinstates filters and the time filter when a saved query has filters and a time filter included
  4. preserves the currently loaded query when the page is reloaded/refresh
  5. allows saving changes to a currently loaded query
  6. allows saving the currently loaded query as a new query
  7. allows deleting the currently loaded saved query and clear the query
  8. does not allow saving a query with a non-unique name
  9. does not allow saving a query with leading or trailing whitespace in the name
  10. resets any changes to a loaded query on reloading the same saved query
  11. allows clearing the currently loaded saved query
  12. if saved query is saved with another non-default language, clearing will clear the language as well
  13. changing language removes saved query in the query bar

_shared_links.js

  1. should allow snapshot URL
  2. should allow snapshot URL as short URL
  3. should allow saved object URL after saving a saved search
  4. store states in session storage, and create snapshot URL
  5. sharing hashed url shouldn't crash the app

_sidebar.js

  1. Should initially be expanded
  2. Should collapse when the button is clicked
  3. Should expand again when the button is clicked
  4. Display/hide the filter window by clicking Filter by type
    Screenshot 2023-08-16 at 5 16 30 PM

_source_filters.js --> load test/functional/fixtures/opensearch_archiver/visualize_source-filters

  1. load visualize source filter, should not get the field referer
@abbyhu2000 abbyhu2000 added de-angular de-angularize work data explorer Issues related to the Data Explorer project labels Aug 17, 2023
@abbyhu2000 abbyhu2000 self-assigned this Aug 17, 2023
@ashwin-pc ashwin-pc added the discover for discover reinvent label Aug 17, 2023
@abbyhu2000
Copy link
Member Author

abbyhu2000 commented Aug 18, 2023

After a quick manual run of testing the functionality using Discover 2.0, here are the functionalities that are currently not working in Discover 2.0: @ashwin-pc

  1. When selecting an empty time range, the discover page shows loading, while the legacy discover will show no results and suggest a new time range should be picked Screenshot 2023-08-18 at 10 35 53 AM
  2. When entering a query that result in no data, the page still shows loading; legacy discover will show no results and suggest a new time range to be selected
  3. Save saved search related functionalities are not working
    • save button is grey and can not be clicked
    • rename reflected in breadcrumb
    • reset button should reset to previous persisted state
    • data-shared-item property should be set in the HTML
  4. View single document and View surrounding document do not work
  5. Function to add filter for value and filter our value from a document is missing
  6. No skip to the end button
  7. Sort ascend and descend functionality on the field is not working
  8. Button to visualize a field and save the visualization related functionalities are missing
  9. Save query management window and functionality is missing
  10. shared link related functionalities:
    • Can not generate snapshot URL as a short URL
    • Should not allow saved search URL when there is no saved search object
  11. Side bar can not be expanded and collapsed
  12. Breadcrumb is not showing the correct text, should be 'Discover', but currently it is showing Overview

Modified functionality:

  1. The way to add, delete, and sort a field is modified
  2. To action to open a detailed doc view is modified
  3. Previously the default row per page is 50; now it's 100 rows per page, and 500 rows at max

@ashwin-pc
Copy link
Member

Thanks for the deep dive @abbyhu2000. Some of these issues have already been fixed while others are being worked on. Here is a summary of the current status of these issues:

  1. This is fixed in [Data Explorer] Altrnate result state views + fixes #4764
  2. Fixed in [Data Explorer] Altrnate result state views + fixes #4764
  3. ...
  4. @ananzh is working on these
  5. @ananzh do you know why this wasnt implemented? Lets create an issue for this in the meantime.
  6. I dont think we need this functionality any more since we no longer have infinite scrolling and instead rely on pagination
  7. This should have been fixed here. did you test it before or after this change? [Data Explorer][Discover 2.0] Implement column actions #4756
  8. This should be working, can you check to see if this doesnt work for other fields too?
  9. Needs an issue
  10. This should be working, if its not can you create an issue for it?
  11. This is not in scope for 2.10. We will revisit in 2.11 for Data Explorer
  12. Needs an issue

For the modified functionality, yes we need to write new tests but they should not be functionally different. Based on the ones you mentioned it does not look like it is. Let me know if my assumption is wrong though.

@abbyhu2000
Copy link
Member Author

abbyhu2000 commented Aug 19, 2023

  1. For the filter for value and filter out value, I see if we expand the document, then we can add the two filters there in the document details fly-out. However, previously the legacy discover can have the filter for value and filter out value on each document row from the table itself without needing to expand the document. I guess this is a UX decision to see if we want to add options to add those two filters on each table row. @ashwin-pc @ananzh
Screen.Recording.2023-08-18.at.5.25.47.PM.mov
  1. For the sorting, i pulled down the latest changes, it seems like sorting ascend and descend action do not actually change the order?
Screen.Recording.2023-08-18.at.5.20.13.PM.mov
  1. Creating visualizations from fields is working as expected.

  2. The snapshot URL works, but the short version URL does not work.

Screen.Recording.2023-08-18.at.5.28.33.PM.mov

@ashwin-pc
Copy link
Member

Thanks Abby! Can you create an issue for all that aren't working. We can start addressing them next week

@ashwin-pc ashwin-pc changed the title [Documentation][Data Explorer] Legacy discover plugin documentation [Documentation][Data Explorer] Legacy discover plugin functional test documentation Aug 23, 2023
@ashwin-pc ashwin-pc changed the title [Documentation][Data Explorer] Legacy discover plugin functional test documentation [Documentation][Data Explorer] Legacy discover plugin functional tests Aug 23, 2023
@abbyhu2000
Copy link
Member Author

Close as the documentation for legacy discover is finished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data explorer Issues related to the Data Explorer project de-angular de-angularize work discover for discover reinvent
Projects
Development

No branches or pull requests

2 participants