We already have the beginning of a test for search, but it is testing error conditions:

#2150047: Empty search should yield message "Enter your keywords"

What this issue is about, is creating some tests (ideally based on that previous issue) to make sure search is working correctly right after install, including facets.

Comments

dsnopek’s picture

jessehs’s picture

Status: Active » Needs review
StatusFileSize
new1.58 KB

Here's a patch that has 2 passing tests and 1 failing (because of the open bug referenced).

jessehs’s picture

StatusFileSize
new1.46 KB

This patch is against the panopoly_test feature rather than the distro core.

dsnopek’s picture

Status: Needs review » Needs work

Thanks for the patch! Tests passed locally and I actually committed it, but I reverted shortly after...

This test depends on the presence of the demo data from panopoly_demo. Child distributions don't necessarily include panopoly_demo, which creates content of types from panopoly_pages -- one of the modules most often NOT used in child distributions.

Instead, this test should create it's own nodes of the 'panopoly_test_page' type with some super unique content and then search for that.

cboyden’s picture

This doesn't look like it was reverted, it's still in the latest repo. http://cgit.drupalcode.org/panopoly_test/commit/?id=b34cadbfe16173d53618... looks like it reverted a different commit.

cboyden’s picture

Status: Needs work » Needs review
StatusFileSize
new1.96 KB

Here's a patch that does not depend on either panopoly_demo or panopoly_pages. It creates its own content and then searches for it.

In order for the pages to be indexed, cron has to be run. So the test does that. I am seeing a few errors output by cron to my screen while testing. They don't show up in the dblog, though.

Warning: Invalid argument supplied for foreach() in /panopoly/includes/graph.inc on line 56
Warning: Invalid argument supplied for foreach() in /panopoly/includes/module.inc on line 257
cboyden’s picture

StatusFileSize
new2.47 KB

Hm. Any errors that happen during cron are output to the terminal. I suppose there's no avoiding that.

Updated patch uses "fill in" instead of "enter" and adds a "Search" region. This can be overridden in behat.yml so that we don't introduce dependencies on a particular theme.

cboyden’s picture

StatusFileSize
new1.44 KB

Running cron via drush instead of relying on the API results in no errors being output to the terminal, and avoids some other errors on a child distribution. New patch attached. It also adds the region restriction to the search button.

cboyden’s picture

StatusFileSize
new2.57 KB

Previous patch was missing some commits.

dsnopek’s picture

This doesn't look like it was reverted, it's still in the latest repo. looks like it reverted a different commit.

Blergh! I can actually imagine exactly how I did that... I probably first tried to revert the commit the "wrong way", ie. git reset --hard HEAD^ but when Drupal.org refused to let me push it (like it should!), then I probably did git revert HEAD^, while not realizing that two HEAD^ in a row is two commits back. :-/

I'll get that other commit back in...

  • dsnopek committed b722201 on 7.x-1.x
    Update Panopoly Test for Issue #2329387 by cboyden, jessehs: Write Behat...
dsnopek’s picture

Status: Needs review » Fixed

Thanks for finding my error and fixing this test! It passed for me locally, so committing. Let's see what Travis-CI says:

https://travis-ci.org/panopoly/panopoly/builds/41478044

Status: Fixed » Closed (fixed)

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