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

Add 2 scenarios for typeahead search #44

Merged
merged 9 commits into from
Jun 18, 2022
Merged

Conversation

jdlrobson
Copy link
Member

  • 1 for when search goes offline prior to search
  • 1 for a search query that shows results

Fixes: T306846

I tried to add one for the sticky header but it complicated things. I don't think we necessarily need to have one either, given logged in users account for less than 1% of our traffic.

* 1 for when search goes offline prior to search
* 1 for a search query that shows results

Fixes: T306846
@nicholasray
Copy link
Contributor

Thanks for the PR! I think this will really help cut down on the search regressions as well as help with the codex switch

@jdlrobson
Copy link
Member Author

Managed to work out the sticky header scenario..

// Wait for the loader to display
await page.waitForSelector( '.search-form__loader', {
visible: true
} );
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed this border animation was still flaking. I think adding the following line will stop the flakiness

// Fast forward any transitions.
await fastForwardAnimations( page );

Copy link
Member Author

Choose a reason for hiding this comment

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

done

configDesktop.js Outdated
label: 'Test (#vector-2022, #search-focus, #search-offline)',
path: '/wiki/Test',
// account for mismatch due to border color change animation
misMatchThreshold: 0.5,
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure this is needed. Please see my comments in search.js.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

await moduleReady( page, 'vue' );
// focus and type into the newly added input
await page.focus( 'input[name="search"]' );
await page.keyboard.type( 't' );
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the purpose of this one vs. only having page.keyboard.type( 'test' )? I'm asking because I noticed the results for t were captured in one test instead of the two results for test and I'm wondering if this line is necessary?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was seeing some flakiness where the first keystroke didn't show any results. Let's remove it and see if it still passes..

jdlrobson and others added 4 commits June 16, 2022 15:05
I was noticing the results for `tes` instead of `test` in some scenarios
because of the typeahead search 120ms debounce. Using one letter instead
of several should eliminate this.
@nicholasray nicholasray merged commit 563411c into wikimedia:main Jun 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants