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

[BUG][Fuctional Test] Make setDefaultAbsoluteRange more robust and update doc views tests #5242

Merged
merged 2 commits into from
Oct 9, 2023

Conversation

ananzh
Copy link
Member

@ananzh ananzh commented Oct 7, 2023

Description

  • add a helper function setInputValueWithRetry for setAbsoluteRange to retry time range setup
  • update doc_views test to click docTableExpandToggleColumn-0
  • update doc_views_link to check new tab

Issue Resolve

#5241

Screenshot

  • test_suites/doc_views
after-fix-doc-views.mov
  • test_suites/doc_views_links
after-fix-doc-views-links.mov

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

AMoo-Miki
AMoo-Miki previously approved these changes Oct 7, 2023
@@ -43,7 +43,7 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide
});

it('should show custom doc views', async () => {
await testSubjects.click('docTableExpandToggleColumn');
await testSubjects.click('docTableExpandToggleColumn-0');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, yeah looks like we added an index which imo is better for more consistent tests.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah we have to. since we adopt data grid, we have docTableExpandToggleColumn-[row index] now.

@kavilla
Copy link
Member

kavilla commented Oct 7, 2023

How come the delay and retry add? It seem in previous iterations to be pretty consistent, is something to do with rendering in the doc views?

I think if the tests are catching broken behavior then probably would rather log the issue rather than build into the testing system to handle the regression.

@codecov
Copy link

codecov bot commented Oct 7, 2023

Codecov Report

Merging #5242 (8e7834c) into main (1e980fa) will increase coverage by 0.13%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #5242      +/-   ##
==========================================
+ Coverage   66.77%   66.91%   +0.13%     
==========================================
  Files        3284     2574     -710     
  Lines       63092    48359   -14733     
  Branches    10048     8674    -1374     
==========================================
- Hits        42132    32359    -9773     
+ Misses      18487    13889    -4598     
+ Partials     2473     2111     -362     
Flag Coverage Δ
Linux_1 ?
Linux_2 55.24% <ø> (ø)
Linux_3 43.85% <ø> (+<0.01%) ⬆️
Linux_4 35.36% <ø> (-0.01%) ⬇️
Windows_1 ?
Windows_2 55.20% <ø> (ø)
Windows_3 43.85% <ø> (ø)
Windows_4 35.36% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 794 files with indirect coverage changes

@ananzh
Copy link
Member Author

ananzh commented Oct 7, 2023

How come the delay and retry add? It seem in previous iterations to be pretty consistent, is something to do with rendering in the doc views?

I haven't looked into very deep on this. There are couple of issues of this setup time.

private async showStartEndTimes() {
      // This first await makes sure the superDatePicker has loaded before we check for the ShowDatesButton
      await testSubjects.exists('superDatePickerToggleQuickMenuButton', { timeout: 20000 });
      const isShowDatesButton = await testSubjects.exists('superDatePickerShowDatesButton');
      if (isShowDatesButton) {
        await testSubjects.click('superDatePickerShowDatesButton');
      }
      await testSubjects.exists('superDatePickerstartDatePopoverButton');
    }
issue.mov
  • Second, sometime time is not set. I still see the original time not input time.

I think you post a very good question. Not sure why 2.11 starts to have this issue. We could open a research issue for deeper dive while unblock CI for now.

@kavilla
Copy link
Member

kavilla commented Oct 7, 2023

How come the delay and retry add? It seem in previous iterations to be pretty consistent, is something to do with rendering in the doc views?

I haven't looked into very deep on this. There are couple of issues of this setup time.

* First of all, I have run couple of times locally and every time I could see two panels open. The reason is that this checking function opens the panel and selenium not close it in time. Check my screen record.
  https://github.com/opensearch-project/OpenSearch-Dashboards/blob/1e980fac7a6dee3a1904511d2ae0f477575e6135/test/functional/page_objects/time_picker.ts#L139
private async showStartEndTimes() {
      // This first await makes sure the superDatePicker has loaded before we check for the ShowDatesButton
      await testSubjects.exists('superDatePickerToggleQuickMenuButton', { timeout: 20000 });
      const isShowDatesButton = await testSubjects.exists('superDatePickerShowDatesButton');
      if (isShowDatesButton) {
        await testSubjects.click('superDatePickerShowDatesButton');
      }
      await testSubjects.exists('superDatePickerstartDatePopoverButton');
    }

issue.mov

* Second, sometime time is not set. I still see the original time not input time.

I think you post a very good question. Not sure why 2.11 starts to have this issue. We could open a research issue for deeper dive while unblock CI for now.

likely this should have impact on all the functional tests correct since the time picker isn't unique to the failing plugin functional tests? if the goal to unblock I'd rather comment out these test files in the config and create an issue otherwise I think if the date having this automatic retry could obscure test results in the future if there is a consistent issue with focus being toggled off

…date doc views tests

* add a helper function setInputValueWithRetry for setAbsoluteRange to retry
time range setup
* update doc_views test to click docTableExpandToggleColumn-0
* update doc_views_link to check new tab

Issue Resolve
opensearch-project#5241

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
Signed-off-by: Anan Zhuang <ananzh@amazon.com>
@ananzh ananzh merged commit d6345f3 into opensearch-project:main Oct 9, 2023
55 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 9, 2023
…date doc views tests (#5242)

* [BUG][Fuctional Test] Make setDefaultAbsoluteRange more robust and update doc views tests

* fix PR comment by making a special time picker method for discover
* update doc_views test to click docTableExpandToggleColumn-0
* update doc_views_link to check new tab

Issue Resolve
#5241

---------

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
(cherry picked from commit d6345f3)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 9, 2023
…date doc views tests (#5242)

* [BUG][Fuctional Test] Make setDefaultAbsoluteRange more robust and update doc views tests

* fix PR comment by making a special time picker method for discover
* update doc_views test to click docTableExpandToggleColumn-0
* update doc_views_link to check new tab

Issue Resolve
#5241

---------

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
(cherry picked from commit d6345f3)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
ashwin-pc pushed a commit that referenced this pull request Oct 10, 2023
…date doc views tests (#5242) (#5256)

* [BUG][Fuctional Test] Make setDefaultAbsoluteRange more robust and update doc views tests

* fix PR comment by making a special time picker method for discover
* update doc_views test to click docTableExpandToggleColumn-0
* update doc_views_link to check new tab

Issue Resolve
#5241

---------

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
(cherry picked from commit d6345f3)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ashwin-pc pushed a commit that referenced this pull request Oct 10, 2023
…date doc views tests (#5242) (#5255)

* [BUG][Fuctional Test] Make setDefaultAbsoluteRange more robust and update doc views tests

* fix PR comment by making a special time picker method for discover
* update doc_views test to click docTableExpandToggleColumn-0
* update doc_views_link to check new tab

Issue Resolve
#5241

---------

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
(cherry picked from commit d6345f3)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants