Skip to content

Latest commit

 

History

History
158 lines (122 loc) · 6.4 KB

MIGRATION.md

File metadata and controls

158 lines (122 loc) · 6.4 KB

Migration from Earlier Versions

Increasing the major version means a breaking change in existing functionality, or at least deprecation of a feature, which has been replaced by an alternative. When you upgrade grunt-html-dom-snapshot to a higher major version, you might ned to update your configuration or even the task commands.

I recommend you upgrading grunt-html-dom-snapshot regularly. Functionality and security bugs are looked for and fixed in latest versions, not in old and thus little used ones.

Upgrade Instructions

5 to 6

WebdriverIO limited the elementSendKeys method to behave just like the WebDriver protocol requires, which affects elementSendKeys instruction. An array of keys to press cannot be sent any more. Only a string with letters to type. If you need to send special keys like "Delete", for example focus the element by focus and then use keys.

The automated build on Travis started to fail with the Node.js 8, although the dependent modules should still work with it. You should upgrade Node.js in your environment to the version 10 or newer, to be on the safe side, and check, that everything still works.

See the release notes for v6 for more information.

4 to 5

THe evaluation order of the "is" instructions has changed. If you used more than one "is" instructions in a single command block, check if the scenario still works, when the instructions follow this order:

  • isExisting
  • isVisible
  • isVisibleWithinViewport
  • isEnabled
  • isSelected
  • isFocused
  • isNotExisting
  • isNotVisible
  • isNotVisibleWithinViewport
  • isNotEnabled
  • isNotFocused

See the release notes for v5 for more information.

3 to 4

Although you may not notice any breaking changes, v4 upgraded to WebdriverIO 5 and dropped support of Node.js older than 8. You should upgrade Node.js in your environment and check, that everything still works.

WebdriverIO overhauled its API, which meant adapting each instruction available in grunt-html-dom-snapshot. They all remained compatible, except for:

See the release notes for v4 for more information.

2 to 3

You will probably not notice any breaking changes in your scripts during this upgrade.

Unrecognised instructions are forbidden in v3. They hid typos in instruction that you wanted to execute. If you put foreign keys to the task commands, you will have to remove them and use comments instead, for example.

Old code:

{
  "doNotForget": "focus the other elements later",
  "click": "input",
  "file": "focused-input"
}

New code:

{
  // TODO: Focus the other elements later.
  "click": "input",
  "file": "focused-input"
}

See the release notes for v3 for more information.

1 to 2

v2 does not use PhantomJS by default any more. The development has been stopped in favour of the headless mode introduced by Chrome and Firefox. You can still enable the webdriver for PhantomJS explicitly. However, it will be used less and less in the world and the quality of its support will deteriorate. Plan switching to the headless mode of Chrome and check, that your tests still work. If you did not use PhantomJS-specific API, you would only adapt the task configuration and should not notice any breaking changes in your scripts.

Old configuration:

'selenium_standalone': {
  serverConfig: {
    seleniumVersion: '3.7.1',
    seleniumDownloadURL: 'http://selenium-release.storage.googleapis.com',
    drivers: {
      phantomjs: {
        version: '2.1.1'
      }
    }
  }
},
'html-dom-snapshot': {
  options: {
    webdriver: {
      capabilities: {
        browserName: 'phantomjs'
      }
    }
  }
}

New configuration:

'selenium_standalone': {
  serverConfig: {
    seleniumVersion: '3.141.5',
    seleniumDownloadURL: 'http://selenium-release.storage.googleapis.com',
    drivers: {
      chrome: {
        version: '77.0.3865.40',
        arch: process.arch,
        baseURL: 'https://chromedriver.storage.googleapis.com'
      }
    }
  }
},
'html-dom-snapshot': {
  options: {
    webdriver: {
      capabilities: {
        browserName: 'chrome',
        'goog:chromeOptions': {
          args: ['--headless']
        }
      }
    }
  }
}

See the release notes for v2 for more information.

0 to 1

v1 runs only in Node.js 6 or newer. Node.js 4 reeached its end-of-life and does not use PhantomJS by default any more. The development has been stopped in favour of the headless mode introduced by Chrome and Firefox. You can still enable the webdriver for PhantomJS explicitly. However, it will be used less and less in the world and the quality of its support will deteriorate. Plan switching to the headless mode of Chrome and check, that your tests still work. If you did not use PhantomJS-specific API, you would only adapt the task configuration and should not notice any breaking changes in your scripts.

See the release notes for v1 for more information.