Problem/Motivation

PhantomJS tests are deprecated in Drupal 8. We should remove them and all their dependencies in Drupal 9.

Proposed resolution

Remove all our code and the dependencies from composer. The following classes are removed:

  • Drupal\FunctionalJavascriptTests\JavascriptTestBase
  • Drupal\FunctionalJavascriptTests\LegacyJavascriptTestBase

References to these classes are updated appropriately.

This has the effect of removing the following dependencies:

  • jcalderonzumba/gastonjs
  • jcalderonzumba/mink-phantomjs-driver

Support for the following environment setting:

  • MINK_DRIVER_ARGS_PHANTOMJS

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

The following dev dependencies:

  • jcalderonzumba/gastonjs
  • jcalderonzumba/mink-phantomjs-driver

are removed

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new17.69 KB
Mixologic’s picture

9.0.0 is gonna feel so much lighter.

Status: Needs review » Needs work

The last submitted patch, 2: 3088688-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Mixologic’s picture

+++ b/core/tests/Drupal/FunctionalJavascriptTests/WebDriverTestBase.php
@@ -38,27 +34,14 @@ abstract class WebDriverTestBase extends BrowserTestBase {
+    if (!is_subclass_of($this->minkDefaultDriverClass, DrupalSelenium2Driver::class)){
+      throw new \UnexpectedValueException(sprintf("%s has to be an instance of %s", $this->minkDefaultDriverClass, DrupalSelenium2Driver::class));
...
+    $this->minkDefaultDriverArgs = ['chrome', NULL, 'http://localhost:4444'];

I guess it cant be a subclass of itself?

alexpott’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new869 bytes
Mixologic’s picture

Needs-> review >> Needs->patch

alexpott’s picture

StatusFileSize
new17.68 KB

derp

berdir’s picture

Status: Needs review » Needs work

And already needs a reroll.

alexpott’s picture

Status: Needs work » Needs review
StatusFileSize
new17.68 KB

Chasing the HEAD

alexpott’s picture

StatusFileSize
new1.28 KB
new18.96 KB

Keeping up with HEAD

lendude’s picture

Status: Needs review » Needs work

Needs another reroll, but looks ready to go in then.

lendude’s picture

Status: Needs work » Reviewed & tested by the community

Sorry, on the wrong branch, my bad! Thanks @alexpott for the pointer!

This looks ready, all references to phantom are gone.

krzysztof domański’s picture

Status: Reviewed & tested by the community » Needs work

Needs a reroll.

alexpott’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new18.96 KB

Rerolled.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 15: 3088688-15.patch, failed testing. View results

alexpott’s picture

Status: Needs work » Reviewed & tested by the community

  • larowlan committed 5733c62 on 9.0.x
    Issue #3088688 by alexpott: Remove PhantomJS based testing
    
larowlan’s picture

Status: Reviewed & tested by the community » Fixed

Committed 5733c62 and pushed to 9.0.x. Thanks!

🍰

larowlan’s picture

Issue tags: +DrupalSouth 2019
johnwebdev’s picture

Oh, I totally misinterpreted this while working on D9 deprecation, I only thought the base class was deprecated and not the driver itself.

i.e. Looking at the WebDriver base class we could see:

  /**
   * {@inheritdoc}
   *
   * To use a legacy phantomjs based approach, please use PhantomJSDriver::class.
   */
  protected $minkDefaultDriverClass = DrupalSelenium2Driver::class;

which I realise now, only was for BC.

Maybe we can clarify in the CR that the PhantomJS driver has been deprecated and removed as well.

alexpott’s picture

@johndevman I've added

Support for PhantomJS will be removed in Drupal 9.0.0.

to the change record.

Status: Fixed » Closed (fixed)

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

xjm’s picture

Issue tags: +9.0.0 release notes

This belongs in the release notes, so tagging accordingly. Remember to tag changes to dependencies at time of commit.