Skip to content

Commit

Permalink
Merge pull request #1363 from nextcloud/fix/noid/spell-checking
Browse files Browse the repository at this point in the history
Disable spell checking for cypress
  • Loading branch information
raimund-schluessler authored Aug 31, 2020
2 parents 597c255 + 390ade9 commit e2b83b5
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion cypress/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,25 @@ const options = {
watchOptions: {},
}

module.exports = (on, config) => {
module.exports = (on) => {
getCompareSnapshotsPlugin(on)
on('file:preprocessor', webpack(options))

// Disable spell checking to prevent rendering differences
on('before:browser:launch', (browser, launchOptions) => {
if (browser.family === 'chromium' && browser.name !== 'electron') {
launchOptions.preferences.default['browser.enable_spellchecking'] = false
return launchOptions
}

if (browser.family === 'firefox') {
launchOptions.preferences['layout.spellcheckDefault'] = 0
return launchOptions
}

if (browser.name === 'electron') {
launchOptions.preferences.spellcheck = false
return launchOptions
}
})
}

0 comments on commit e2b83b5

Please sign in to comment.