view core/tests/Drupal/Nightwatch/Tests/exampleTest.js @ 18:af1871eacc83

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:33:08 +0100
parents 129ea1e6d783
children
line wrap: on
line source
module.exports = {
  '@tags': ['core'],
  before(browser) {
    browser.drupalInstall({
      setupFile: 'core/tests/Drupal/TestSite/TestSiteInstallTestScript.php',
    });
  },
  after(browser) {
    browser.drupalUninstall();
  },
  'Test page': browser => {
    browser
      .drupalRelativeURL('/test-page')
      .waitForElementVisible('body', 1000)
      .assert.containsText('body', 'Test page text')
      .drupalLogAndEnd({ onlyOnError: false });
  },
  'Page objects test page': browser => {
    const testPage = browser.page.TestPage();

    testPage
      .drupalRelativeURL('/test-page')
      .waitForElementVisible('@body', testPage.props.timeout)
      .assert.containsText('@body', testPage.props.text)
      .drupalLogAndEnd({ onlyOnError: false });
  },
};