The autocomplete on the "Add content item" widget is actually pretty sophisticated! It should only show options for nodes of the selected "Content Type" and it shouldn't cache results when the user changes the "Content Type".

This used to be broken and this issue has a pretty good description of how this is supposed to work: #2374715: "Content Type" filter on the "Add content item" widget is broken

We need Behat tests to verify that it continues to work the way it should!

Comments

dsnopek’s picture

Title: Write Beht test for autocomplete on "Add content item" widget » Write Behat test for autocomplete on "Add content item" widget

Behat has an "a" in it. :-)

dsnopek’s picture

Here's an example of a step that fills in autocomplete and selects the first option:

https://gist.github.com/IslandUsurper/12723643dddc9315ff71

shawn dearmond’s picture

Assigned: Unassigned » shawn dearmond
shawn dearmond’s picture

Assigned: shawn dearmond » Unassigned
Status: Active » Needs review
StatusFileSize
new3.98 KB

I added the step to panopoly_test.behat.inc and added the test to contentitem_widget.feature

lsolesen’s picture

Status: Needs review » Needs work

@Shawn DeArmond It seems that indentation in the patch for the step is off and there is extra lines in the function.

dsnopek’s picture

StatusFileSize
new4.11 KB

@Shawn DeArmond: Thanks for the patch!

I second @lsolesen's review. Also, I tried the test myself and it wasn't working because it would try to press the down arrow before the autocomplete options were visible. I tried a bunch of things but only could get a sleep(1) to get it working for me.

Attached is a new version of the patch that fixes the indentation and gets the test working for me. I'll try this on Travis next and see if it runs there.

EDIT: Here's the Travis-CI build: https://travis-ci.org/panopoly/panopoly/builds/63691408

dsnopek’s picture

Status: Needs work » Needs review
dsnopek’s picture

Status: Needs review » Fixed

The sleep(1) is messy, but it worked on Travis-CI which is good enough for me for now. :-) We can always open another issue later to try and get rid of that!

So, committed! Thanks for your work on this. :-)

  • dsnopek committed 81337e0 on
    Update Panopoly Test for Issue #2374827 by dsnopek, Shawn DeArmond:...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.