Problem/Motivation

Since TestSiteInstallCommand supports install profile and langcode parameters, it would be a good idea to make them customizable in the drupalInstall command as well.

Proposed resolution

Add instappProfile and langode to drupalInstall.js.

Remaining tasks

Provide a patch.

User interface changes

Nothing.

API changes

New params in drupalInstall command.

Release notes snippet

@todo

module.exports = {
  '@tags': ['core'],
  before(browser) {
    browser.drupalInstall({
      setupFile: 'core/tests/Drupal/TestSite/TestSiteInstallTestScript.php',
      installProfile: 'standard',
      langcode: 'de',
    });
  },
  after(browser) {
    browser.drupalUninstall();
  },
  'Test page': browser => {
    browser
      .drupalRelativeURL('/test-page')
      .waitForElementVisible('body', 1000)
      .assert.containsText('body', 'Test page text')
      .drupalLogAndEnd({ onlyOnError: false });
  },
};

Comments

huzooka created an issue. See original summary.

huzooka’s picture

Assigned: huzooka » Unassigned
Status: Active » Needs review
StatusFileSize
new1.71 KB
dawehner’s picture

Issue tags: +Needs tests

I'm wondering whether you could write some test which uses a different language and install profile to ensure this actually works.

Status: Needs review » Needs work

The last submitted patch, 2: nightwatch-profile_langcode_support-3017176-2.patch, failed testing. View results

finnsky’s picture

StatusFileSize
new2.42 KB
new729 bytes

Hello!
Added french langcode installation test

andypost’s picture

Status: Needs work » Needs review
finnsky’s picture

StatusFileSize
new1.49 KB
new3.21 KB

Reworked with demo_umami install profile test case.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

nevergone’s picture

Drupal 8.8.0?

lauriii’s picture

Issue tags: -Needs tests
lauriii’s picture

Assigned: Unassigned » GrandmaGlassesRopeMan

@alwaysworking said on Slack that he'd review this issue.

mogtofu33’s picture

StatusFileSize
new3.37 KB

Updated patch for 8.8.x.

andrewmacpherson’s picture

We have a use for this in the Umami demo profile. There are some JS menu buttons that we want to write keyboard functional tests for, but we need nightwatch to install the Umami demo profile.

GrandmaGlassesRopeMan’s picture

Assigned: GrandmaGlassesRopeMan » Unassigned

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

mogtofu33’s picture

Issue tags: -JavaScript +JavaScript
StatusFileSize
new3.45 KB

Updated patch for 8.9.x

alexpott’s picture

Status: Needs review » Reviewed & tested by the community

This looks great.

+++ b/core/tests/Drupal/Nightwatch/Tests/installProfileTest.js
@@ -0,0 +1,19 @@
+      setupFile: 'core/tests/Drupal/TestSite/TestSiteInstallTestScript.php',
+      installProfile: 'demo_umami'

The usage is simple and the test coverage is there. +1

lauriii’s picture

Status: Reviewed & tested by the community » Needs review
+++ b/core/tests/Drupal/Nightwatch/Commands/drupalInstall.js
@@ -5,27 +5,36 @@ import { commandAsWebserver } from '../globals';
+  { setupFile = '', installProfile = '', langcode = '' } = {},
...
+    installProfile = installProfile ? `--install-profile "${installProfile}"` : '--install-profile nightwatch_testing';

Nit pick 🔬👁: Could we move nightwatch_testing as the default value on the function declaration?

alexpott’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new1.54 KB
new3.41 KB

Sure we can do that. Removes a condition which is really nice. Also fixed...

$ node ./node_modules/eslint/bin/eslint.js --quiet --config=.eslintrc.passing.json .

/Users/alex/dev/sites/drupal8alt.dev/core/tests/Drupal/Nightwatch/Tests/installProfileTest.js
  6:35  error  Insert `,`  prettier/prettier

✖ 1 problem (1 error, 0 warnings)
  1 error and 0 warnings potentially fixable with the `--fix` option.

error Command failed with exit code 1.

As these changes are very minimal setting back to rtbc.

  • lauriii committed b496f2d on 9.0.x
    Issue #3017176 by finnsky, mogtofu33, alexpott, huzooka, dawehner:...

  • lauriii committed 0228b93 on 8.9.x
    Issue #3017176 by finnsky, mogtofu33, alexpott, huzooka, dawehner:...
lauriii’s picture

Status: Reviewed & tested by the community » Fixed

Committed b496f2d and pushed to 9.0.x and 8.9.x. Thanks!

Status: Fixed » Closed (fixed)

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