The Drupal Extension has a new version based on Behat 3. Updating will get us these things:

  • No more regex in step definitions - Turnip syntax (Ruby-style symbols).
  • No more subcontexts - all contexts are at equal levels. (Communication between contexts is a possible issue.)
  • Apparently, better performance (based on local testing)
  • Suites: You can use the same features in different contexts (different step definitions). For example, you could have a Drupal 7 context and a Drupal 8 context using the same feature files.
  • And more

The Drupal Extension has split its methods and step definitions into multiple contexts. Projects can load only the contexts they need. This creates some complications with our auto-discovered contexts (formerly subcontexts). Some test contexts will need to extend MinkContext instead of the default RawDrupalContext.

CommentFileSizeAuthor
#47 interdiff.txt1.67 KBdsnopek
#47 panopoly_test-behat3-2371247-47.patch77.63 KBdsnopek
#45 interdiff.txt2.23 KBdsnopek
#45 panopoly_test-behat3-2371247-45.patch77.86 KBdsnopek
#43 interdiff.txt6.97 KBdsnopek
#43 panopoly_test-behat3-2371247-43.patch79.03 KBdsnopek
#35 interdiff.txt2.5 KBdsnopek
#35 panopoly_test-behat3-2371247-35.patch81.77 KBdsnopek
#34 interdiff.txt1.42 KBdsnopek
#34 panopoly_test-behat3-2371247-34.patch80.71 KBdsnopek
#33 interdiff.txt1.69 KBdsnopek
#33 panopoly_test-behat3-2371247-33.patch79.41 KBdsnopek
#32 interdiff.txt587 bytesdsnopek
#32 panopoly_test-behat3-2371247-32.patch80.59 KBdsnopek
#30 interdiff.txt17.13 KBdsnopek
#30 panopoly_test-behat3-2371247-29.patch80.59 KBdsnopek
#28 interdiff.txt36.93 KBdsnopek
#28 panopoly_test-behat3-2371247-28.patch68.22 KBdsnopek
#27 interdiff.txt681 bytesdsnopek
#27 panopoly_test-behat3-2371247-27.patch45.13 KBdsnopek
#27 panopoly-behat3-2371247-27.patch1.45 KBdsnopek
#26 interdiff.txt29.58 KBdsnopek
#26 panopoly_test-behat3-2371247-26.patch44.98 KBdsnopek
#23 panopoly_profile-behat3-2371247-23.patch695 bytescboyden
#22 panopoly_test-behat3-2371247-22.patch66.11 KBcboyden
#15 panopoly_profile-behat3-2371247-15.patch678 bytescboyden
#13 panopoly_profile-behat3-2371247-13.patch605 bytescboyden
#13 panopoly_test-behat3-2371247-13.patch65.33 KBcboyden
#12 panopoly_test-behat3-2371247-12.patch65.21 KBcboyden
#10 panopoly-makefile-behat3-2371247-10.patch1.38 KBcboyden
#10 panopoly_test-behat3-2371247-10.patch53.82 KBcboyden
#9 panopoly-behat3-2371247.patch66.09 KBcboyden

Comments

dsnopek’s picture

Suites: You can use the same features in different contexts (different step definitions). For example, you could have a Drupal 7 context and a Drupal 8 context using the same feature files.

Whoa, this sounds amazing! I'd really love to be able to share some of the tests between the D7 and D8 versions of Panopoly - that way we won't break important things when we start creating the D8 version.

cboyden’s picture

Assigned: Unassigned » cboyden
cboyden’s picture

The basics are working, but the tests are running faster than CTools can render its modals. This is supposed to be handled by the AfterStep function. But for some reason, it doesn't run as a tagged hook. It only runs if you remove the @javascript tag.

If you remove the tag, the function throws an exception because it is expecting a Behat\Behat\Hook\Scope\AfterStepScope parameter, but we're sending a StepEvent parameter. It looks like we can't use this function in the same way.

cboyden’s picture

Looks like this is going to be the replacement for the afterStep function:

  /**
   * @AfterStep
   */
  public function afterStep($scope) {
    if ($scope->getTestResult()->getResultCode() === 0) {
      $this->iWaitForAJAX();
    }
  }

assuming we can get the tagged scenarios to work and add the @javascript tag.

cboyden’s picture

It appears that BeforeStep and AfterStep hooks no longer work with tags? See https://github.com/Behat/docs/pull/55. So putting the @javascript tag in the @AfterStep annotation will cause it to be skipped.

If the untagged AfterStep hook, as currently coded, tries to run on a non-javascript scenario, it will throw an error.

This could be fixed if there were a way to check whether the parent scenario is tagged and act accordingly.

cboyden’s picture

OK, this is working for Javascript scenarios and not affecting non-Javascript scenarios:

  /**
   * @BeforeScenario @javascript
   *
   * Set a variable so AfterStep knows this is a javascript scenario.
   */
  public function setJavascript() {
    $this->javascript = true;
  }

  /**
   * @AfterScenario @javascript
   *
   * Unset the variable so other scenarios don't run the javascript AfterStep.
   */
  public function unsetJavascript() {
      $this->javascript = false;
    }

  /**
   * @AfterStep
   */
  public function afterStep($scope) {
    if ($scope->getTestResult()->getResultCode() === 0 && isset($this->javascript)) {
      $this->iWaitForAJAX();
    }
  }
dsnopek’s picture

@cboyden: Can you post a "work in progress" patch? After talking so much about it, I'm super curious about how this all looks!

cboyden’s picture

I'll be working on this today, aiming for a patch in the afternoon.

Proposed architecture:

PanopolyContext includes all (and only) helper methods. No step definitions. That way it can safely be extended by all of the .inc files.

The inc files extend PanopolyContext. Each contains a set of related step definitions.

FeatureContext is empty and extends PanopolyContext.

Open questions:
What does PanopolyContext extend? RawDrupalContext or RawMinkContext? Either way, some helper methods may need to be added.

Should inc files containing steps related to a specific feature such as WYSIWYG be moved to that feature?

cboyden’s picture

Status: Active » Needs work
StatusFileSize
new66.09 KB

Patch attached. There's a remaining issue on some of the "wait for live preview" steps.

cboyden’s picture

Status: Needs work » Needs review
StatusFileSize
new53.82 KB
new1.38 KB

Updated patch attached. Everything is passing locally.

There is one hitch remaining: Right now we are pointing our subcontext paths for discovery at profiles/panopoly/modules/. Because of where the panopoly_test module is located, this will include the vendor directory. As of the latest Behat Drupal extension, this will cause a fatal PHP error because an outdated documentation snippet is being discovered and parsed. See https://github.com/jhedstrom/drupalextension/issues/97.

We can't assume that this will be fixed in a way that won't still cause issues for us. So we should make sure to exclude the vendor directory from the subcontext include path. One way to do that would be to put the panopoly_test module into a different subdir from the rest of the Panopoly modules. A patch to drupal-org.make that does that is also attached. This would also require changes to travis-ci.sh - included in the patch.

cboyden’s picture

The issue https://github.com/jhedstrom/drupalextension/issues/97 has been fixed by renaming the doc snippet. The patch to the distribution makefile is no longer needed - hiding it.

cboyden’s picture

StatusFileSize
new65.21 KB

Here's a new patch that updates to the Behat Drupal Extension 3.0.10. Notes on some changes:

  • I had to change the files_path in a way that made more sense to put it in the behat.template instead of behat.common, so it can be changed in your local instance.
  • Subcontexts can no longer extend PanopolyContext without causing errors about functions defined twice. That makes me think we should throw everything into one or the other of our subcontexts.
  • Passing in escaped characters is different, I'm not sure how to do it anymore. This required changes to the hidden view mode options feature and the image alt encoding test in the wysiwyg_media feature.
  • For some reason, live preview wasn't always triggering on the table widget and spotlight widget, so I hacked in a step to change the title field to force the preview to update.
  • The content item widget test suffers from some timing issues in the "content as content" scenario. It takes a while for the Save button to wake up after the test selects Teaser mode. Unless/until we figure this out, we need a Wait step in there.

Tests are passing locally. We'll see what Travis has to say: https://travis-ci.org/cboyden/panopoly/builds/63911476

cboyden’s picture

StatusFileSize
new65.33 KB
new605 bytes

Travis of course needs some more changes. Environment variables now need to be JSON, and the behat.travis.yml file needs updating.

dsnopek’s picture

Wow! Thanks for continuing to push this forward. :-)

I haven't had a chance to test and review yet - I've only read your comments.

Subcontexts can no longer extend PanopolyContext without causing errors about functions defined twice. That makes me think we should throw everything into one or the other of our subcontexts.

This makes sense to me. It will also signal to anyone that is currently extending PanopolyContext (ie. Open Atrium) that they can't do that anymore. :-)

cboyden’s picture

StatusFileSize
new678 bytes

Needed to adjust the way the BEHAT_PARAMS variable was set in the Travis script. New profile patch attached. Build is here: https://travis-ci.org/cboyden/panopoly/builds/63999010.

dsnopek’s picture

Status: Needs review » Needs work

I did some quick code review on the panopoly_test patch:

  1. +++ b/tests/features/advanced_widgets.feature
    @@ -8,7 +8,8 @@ Feature: Hide/show advanced widgets
    -      And I am viewing a landing page
    +      And I am viewing a "panopoly_test_landing_page":
    +      | Title     | [random]       |
    

    Why is this necessary? It feels like a step backwards. Can we get our custom step back?

  2. +++ b/tests/features/bootstrap/PanopolyContext.php
    @@ -118,10 +100,11 @@ class PanopolyContext extends DrupalContext
    +      echo $source_path;
    

    Looks like debug code that snuck in.

  3. +++ b/tests/features/panopoly_magic/fape.feature
    @@ -10,7 +10,7 @@ Feature: Edit field content in the IPE via FAPE
    -        | Full page override  | Body only     |
    +        | Full page override  | node:panopoly_test_page:body_only     |
    

    Is the really necessary? It would be better to use the human-readable label than the machine one if possible.

  4. +++ b/tests/features/panopoly_magic/livepreview.feature
    @@ -16,38 +17,41 @@ Feature: Live preview
    -    Then I should see the link "Widget title" in the "Live preview" region
    -    When I press "Save" in the "CTools modal" region
    +    Then I should see the link "Widget title 2" in the "Live preview" region
    +      And I press "Save" in the "CTools modal" region
    

    Here a "When" is becoming "Then" - which actually I think Behat doesn't care. But it was better the old way.

  5. +++ b/tests/steps/panopoly_test_panels.behat.inc
    @@ -7,13 +7,18 @@
       /**
        * Initializes context.
        */
    -  public function __construct(array $parameters = array()) {
    +  private $drupal;
    

    This comment is intended for __construct() but is now for private $drupal.

  6. +++ b/tests/steps/panopoly_test_panels.behat.inc
    @@ -7,13 +7,18 @@
    +  public function __construct(DrupalDriverManager $drupal) {
    +          $this->drupal = $drupal;
       }
    

    Incorrect indentation.

  7. +++ b/tests/steps/panopoly_test_wysiwyg.behat.inc
    @@ -7,13 +7,17 @@
       /**
        * Initializes context.
        */
    -  public function __construct(array $parameters = array()) {
    +  private $drupal;
    +
    +  public function __construct(DrupalDriverManager $drupal) {
    +          $this->drupal = $drupal;
       }
    

    Same as above!

dsnopek’s picture

+++ b/scripts/travis-ci.sh
@@ -176,9 +176,13 @@ before_tests() {
-  export BEHAT_PARAMS="extensions[Drupal\\DrupalExtension\\Extension][drupal][drupal_root]=$BUILD_TOP/drupal"
+  TEMP_PARAMS='{"extensions":{"Drupal\\DrupalExtension":{"drupal":{"drupal_root":"'
+  TEMP_PARAMS+=$BUILD_TOP
+  TEMP_PARAMS+='/drupal"}}}}'

Ick! What about doing some magic token replacement using sed?

So, something like:

BEHAT_PARAMS='{"extensions":{"Drupal\\DrupalExtension":{"drupal":{"drupal_root":"BUILD_TOP/drupal"}}}}'
BEHAT_PARAMS=`echo $BEHAT_PARAMS | sed -e s/BUILD_TOP/$BUILD_TOP/`
export BEHAT_PARAMS

It's still hacky, but at least easier to read. I haven't actually tested it, though. :-)

cboyden’s picture

About item 1: No, not really. The custom step "Given I am viewing a landing page" used the createNode function from DrupalContext, which is not available when extending RawDrupalContext. And we can't extend DrupalContext because we'll get every step in it throwing an "already defined" exception. So rather that rewriting that step definition in our code, I chose to use the built-in step. I'll see if there's an alternative that will allow us to use a one-liner in the scenario instead of a table.

dsnopek’s picture

So rather that rewriting that step definition in our code, I chose to use the built-in step. I'll see if there's an alternative that will allow us to use a one-liner in the scenario instead of a table.

Well, we have the Drupal API! I wouldn't mind using it to programmatically create a new node, even if that's duplicating code that's already in the Behat Drupal extensions somewhere.

cboyden’s picture

Well, we have the Drupal API! I wouldn't mind using it to programmatically create a new node, even if that's duplicating code that's already in the Behat Drupal extensions somewhere.

I disagree, I think we create ourselves more work, especially since: a) now a landing page is just another node type; and b) when we start testing Drupal 8 we'll have to recreate all of our custom steps for that. I'd rather use the built-in steps when they're available, and even push some of our custom steps (managed file comes to mind) back into the Behat Drupal Extension, or into Panels and other modules, so they can be of broader use.

cboyden’s picture

Or, it could be possible to implement communication between contexts as outlined here: http://docs.behat.org/en/latest/cookbooks/context_communication.html

That way the custom Given should be able to call createNode.

cboyden’s picture

StatusFileSize
new66.11 KB

Part of the problem with the Live Preview test appears to be that config fields for different widget types have different IDs, and labels. Some examples are:

  • The Table widget title field ID is "edit-title" and it has label of "Title."
  • The Content List widget title field ID is "edit-widget-title" and there is no label (the text "Title" looks like a label, but it's just a span).

This is probably due to differences between Views widgets and FPP widgets.

Also there could be timing issues at work here. Maybe the "wait for javascript" function isn't sufficient to detect the changes to the fields, and the test is getting ahead of itself.

Here's a new patch that addresses some issues from comment #16 (2,4,5,6, and 7), and also attempts to fix the Live Preview test failures.

cboyden’s picture

StatusFileSize
new695 bytes

Here also is a new patch using the approach to BEHAT_PARAMS suggested by @dsnopek. Travis build with this and the test patch above: https://travis-ci.org/cboyden/panopoly/builds/64035090

cboyden’s picture

Some of the live preview scenarios are failing consistently every time on Travis - but not all of them. It could be one of several reasons:

  1. The text isn't being successfully entered into the form fields, even though the step reports as passed
  2. Live preview is not being triggered
  3. The step "wait for live preview" is reporting as passed before live preview has actually finished

Or maybe there are other possibilities.

This is all passing locally. Without being able to see what's happening on the screen at each step, I'm not sure how to get this working.

Is there a way to force live preview to update?

dsnopek’s picture

Assigned: cboyden » dsnopek

Thanks, @cboyden! I'm going to looking into using the "context communication" link you sent to implement "I am viewing a landing page" and see if I can figure out the live preview issues.

dsnopek’s picture

Status: Needs work » Needs review
StatusFileSize
new44.98 KB
new29.58 KB

Here is a new (with interdiff!) which brings back the "I am viewing a landing page" step and my first attempt at getting the livepreview.feature tests to work (I'll run on Travis in a moment). I also made a couple of minor spacing fixes and little nit picky things. :-)

EDIT: Here is the Travis build: https://travis-ci.org/dsnopek/panopoly/builds/64093276

dsnopek’s picture

StatusFileSize
new1.45 KB
new45.13 KB
new681 bytes

Heh, so that last build didn't work, but then for the hell of it I tried upgrading Selenium and that appears to have fixed it:

https://travis-ci.org/dsnopek/panopoly/builds/64096172

When that was running I wrote a step for debugging that would let us do:

And print the contents of the "Live preview" region

So, here's a new panopoly_test patch that only adds that step definition, because it could be useful in the future. And a new profile patch that updates Selenium to 2.45 (from 2.41).

Remaining things I'd like to do while I'm at it:

  1. Convert all our step definitions to Turnip syntax
  2. Do more code clean-up on our custom contexts
  3. See if I can get rid of some of the "wait" steps added in the conversion
dsnopek’s picture

StatusFileSize
new68.22 KB
new36.93 KB

Here is a new patch which does the conversion to Turnip syntax and the following clean-up:

  • Made sure all methods and member variables had correct documentation
  • Re-arranged the order of the methods in panopoly_test.behat.inc to put the helper functions and hooks above the steps and assertions
  • Standardized puting the method documentation above the @Given/@When/@Then/etc in the inline docs to match what DrupalContext.php is doing (before we had some above and some below)

I haven't run the full test suite with these changes - I'm going to get Travis to do that for me.

EDIT: Here is the Travis build: https://travis-ci.org/dsnopek/panopoly/builds/64113509

Next I'm going to attempt to kill PanopolyContext and move its code into panopoly_test_fpp.behat.inc and panopoly_test.behat.inc.

cboyden’s picture

The test passed, but it's reporting a step as undefined: "And I select the first autocomplete option...", which is in the content item widget scenario.

80 scenarios (79 passed, 1 undefined)
1146 steps (1138 passed, 3 undefined, 5 skipped)
21m12.30s (61.90Mb)
--- FeatureContext has missing steps. Define them with these snippets:
    /**
     * @When I select the first autocomplete option for :arg1 on the :arg2 field
     */
    public function iSelectTheFirstAutocompleteOptionForOnTheField($arg1, $arg2)
    {
        throw new PendingException();
    }
dsnopek’s picture

StatusFileSize
new80.59 KB
new17.13 KB

The last patch passed on Travis! Here's another one that kills PanopolyContext and move its code into panopoly_test_fpp.behat.inc and panopoly_test.behat.inc. This is basically the files and FPP clean-up stuff, which I've tested as working locally.

EDIT: Here's the build on Travis: https://travis-ci.org/dsnopek/panopoly/builds/64121942

dsnopek’s picture

The test passed, but it's reporting a step as undefined: "And I select the first autocomplete option...", which is in the content item widget scenario.

Ah, thanks, I missed that! I'll fix in my next patch.

dsnopek’s picture

StatusFileSize
new80.59 KB
new587 bytes

This patch just fixes the undefined autocomplete step from #29.

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

dsnopek’s picture

StatusFileSize
new79.41 KB
new1.69 KB

Alright, here is what might be my last patch for the day. I've removed the "wait" steps that were added in the original conversion - they hopefully shouldn't be necessary after my changes to the Javascript used to wait for AJAX. I was able to test all but one of them, because of issues with my local environment. But Travis will be the real test!

EDIT: Here is the build on Travis: https://travis-ci.org/dsnopek/panopoly/builds/64125589

dsnopek’s picture

StatusFileSize
new80.71 KB
new1.42 KB

Well, there was one "wait" step that appears to have been necessary afterall (the one I couldn't test, of course!) and some PHP errors in the files/fpp clean-up code if the Scenario doesn't create any users. This patch should fix both things!

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

dsnopek’s picture

StatusFileSize
new81.77 KB
new2.5 KB

And here is a patch that does some clean up on the behat.*.yml files. Assuming the tests pass, then this will be all the changes I have pending to make!

Next thing we need to take a look at the Behat documentation and see if it needs any updates...

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

dsnopek’s picture

Assigned: dsnopek » Unassigned

The build for #34 passed! Still waiting on #35, but I really don't expect it to fail (famous last words).

I've already updated the documentation! It needed only super small changes, mostly for examples of behat.yml files or *.features that were out-of-date.

So, unassigning from me so this can get some review!

cboyden’s picture

Runtime is creeping up again, particularly in the Firefox scenarios. Is there something we can do to the "wait for Ajax" or "wait for live preview" functions to speed them up?

dsnopek’s picture

Runtime is creeping up again, particularly in the Firefox scenarios. Is there something we can do to the "wait for Ajax" or "wait for live preview" functions to speed them up?

Maybe, but that would need its own investigation. So long as we're not significantly slower than with Behat 2, I'd rather not hold this up and work on performance in a follow up issue.

cboyden’s picture

When running the tests locally, I'm getting some failures:

--- Failed scenarios:

    features/advanced_widgets.feature:7
    features/basic_ipe.feature:12
    features/contentitem_widget.feature:53
    features/contentitem_widget.feature:87
    features/panopoly_magic/livepreview.feature:7
    features/panopoly_magic/livepreview.feature:132

80 scenarios (74 passed, 6 failed)
1145 steps (1080 passed, 6 failed, 59 skipped)

advanced_widgets only failed the once. basic_ipe fails every time (the "Phelan" link isn't available when the test tries to click it). contentitem_widget fails occasionally, sometimes in different places. livepreview also fails regularly, sometimes in different places.

These are all timing issues. Some places that are prone to failure are when saving the page after having saved a pane update, when waiting for the "customize" button to appear on a new landing page, or when waiting for live preview to finish.

dsnopek’s picture

Hmm, weird! All those tests pass for me locally. What versions of Firefox, Selenium and PHP are you running? Since Travis had timing issues with an older Selenium, that's my best guess at the moment.

Since it works for me locally and on Travis, I'm not sure if I'll be able to help debug... :-/

cboyden’s picture

  1. +++ b/tests/behat.template.yml
    @@ -3,10 +3,15 @@ imports:
    +      subcontexts:
    +        paths:
    +          - "./profiles/panopoly"
    

    This is in behat.common - does it need to be here? Should it be removed from behat.common?

  2. +++ b/tests/behat.travis.yml
    @@ -3,12 +3,18 @@ imports:
    +      subcontexts:
    +        paths:
    +          - "./profiles/panopoly"
    

    As above in behat.template.

  3. +++ b/tests/features/contentpage.feature
    @@ -23,6 +23,7 @@ Feature: Add content page
    +      And I wait 5 seconds
    

    Maybe this could be shortened. It's one of the common timing failure points, so I don't think it can be removed entirely.

  4. +++ b/tests/features/contentpage.feature
    @@ -34,6 +35,7 @@ Feature: Add content page
    +      And I wait 5 seconds
    

    As above for the too-small scenario.

  5. +++ b/tests/features/hidden_view_mode_options.feature
    @@ -31,7 +31,7 @@ Feature: Hidden view mode options
    +      And I fill in "Hidden view mode options" with "diff_standard"
    

    This was because I couldn't figure out how to send in escaped characters like \n.

  6. +++ b/tests/steps/panopoly_test.behat.inc
    @@ -474,86 +410,215 @@ class TestSubContext extends BehatContext implements DrupalSubContextInterface {
    +   * @Then I should see :text in the :tag element in the :region region
    

    Ideally this would go into the Drupal extension, it's one of a piece with all of the other steps in MarkupContext. But it's fine here for now.

  7. +++ b/tests/steps/panopoly_test.behat.inc
    @@ -474,86 +410,215 @@ class TestSubContext extends BehatContext implements DrupalSubContextInterface {
    +   * @Then I should see an image in the :region region$/
    

    The trailing $/ is left over from a regex and can be removed.

cboyden’s picture

Hmm, weird! All those tests pass for me locally. What versions of Firefox, Selenium and PHP are you running? Since Travis had timing issues with an older Selenium, that's my best guess at the moment.

I'm on Selenium 2.44. There were some issues between Firefox and Selenium a while back, so I had to keep an older version of Firefox around just for testing. It sounds like those must have been resolved. I'll try updating both.

Edit: Basic IPE test is no longer failing, but I'm still getting occasional failures on live preview and content item widget. This is with Selenium 2.45, Firefox 38, PHP 5.4.38 on the command line and 5.4.8 on the server.

dsnopek’s picture

StatusFileSize
new79.03 KB
new6.97 KB

@cboyden: Thanks for the review! :-)

#41.1/2: Ah, good catch, thanks! My intention was to remove that from behat.common.yml. If you do fun things with symlinks or keep two copies of the modules in both "profiles/panopoly" and "sites/all/modules" this is something that needs to be customized, and this came up at the DrupalCon sprint. Having it in the behat.yml rather than behat.common.yml will make that easier to notice and explain. Anyway, fixed!

#41.3/4: Right, this "wait" step was the one I couldn't remove. Trying at 2 seconds, instead of 5.

#41.5: Yeah, and I was OK with that solution. But looking into it more, I found @Transform which can handle this! I was able to use it to restore the escaped quotes in wysiwyg_media.feature as well.

#41.6: I concur! Here's a follow-up for looking at Behat steps we can move upstream: #2495739: Evaluate custom Behat steps and move them upstream

#41.7: Fixed!

EDIT: Here's the build on Travis: https://travis-ci.org/dsnopek/panopoly/builds/64250159

dsnopek’s picture

Status: Needs review » Needs work

The last build on Travis failed:

  1. Apparently, 2 seconds isn't long enough. :-/ We can try making sure our wait for AJAX @AfterStep is triggering there, but if that doesn't work, I think returning this to 5 seconds is fine. An extra 10 seconds of waiting is the least of our performance problems!
  2. Also, specifying both the Turnip and regex for the image alt test caused problems on Travis (even though it worked for me locally :/). I originally kept the Turnip syntax so it would appear in bin/behat -dl as it's easier to read, but I'll just remove it in the next patch.
dsnopek’s picture

StatusFileSize
new77.86 KB
new2.23 KB

Here's an attempt to fix the issues outlined in #44. I removed the "wait" steps entirely to see if the AJAX waiting triggers.

EDIT: Here is the Travis build: https://travis-ci.org/dsnopek/panopoly/builds/64261195

dsnopek’s picture

Status: Needs work » Needs review

The last Travis build passed! So, now there are pratically no changes to the *.feature files! Thanks for the review @cboyden, because now this patch is even better. :-)

Marking as "Needs review" for any additional review/testing.

dsnopek’s picture

StatusFileSize
new77.63 KB
new1.67 KB

Here's a new patch that gets rid of the inter-context communication for implementing the "I am viewing a landing page" step. It turns out that is totally unnecessary because RawDrupalContext has the nodeCreate() function which does all the magic! And by removing the dependency on DrupalContext, it's possible for a test suite to extend and replace it, which I just found a use case for on a child distribution.

EDIT: Here is the Travis build: https://travis-ci.org/dsnopek/panopoly/builds/64284977

cboyden’s picture

This is looking good! I'm still getting timing-related failures on the content item widget and live preview features, but since they're running OK on Travis, we could probably chalk that up to local gremlins and move forward with this. If they weren't occasionally failing in different places, I might say we should add a "wait" step.

dsnopek’s picture

@cboyden: And you tried updating your Firefox and Selenium to the latest stable versions?

Anyway, I'm happy to move forward and commit this. :-) I'll do it tomorrow if there are no objections!

dsnopek’s picture

Status: Needs review » Fixed

Committed!

  • dsnopek committed 80807b2 on 7.x-1.x
    Update Panopoly Test for Issue #2371247 by dsnopek, cboyden: Upgrade to...
cboyden’s picture

And you tried updating your Firefox and Selenium to the latest stable versions?

Yes, I'm on Selenium 2.45 and Firefox 38.0.1.

dsnopek’s picture

Hrm. I guess we'll see as others try running the tests after this update and see who else can reproduce. This might be something I'll have to try and figure out next time there's a sprint and someone has got a Mac. :-)

cboyden’s picture

I've run the problematic tests on Chrome a few times, and it seems to go much better. No failures yet on contentitem or livepreview.

Status: Fixed » Closed (fixed)

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