diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js --- a/cypress/plugins/index.js +++ b/cypress/plugins/index.js @@ -7,7 +7,7 @@ const axios = require('axios'); const {execFileSync} = require('child_process'); -const fs = require('fs'); +// const fs = require('fs'); const sqlite3 = require('sqlite3').verbose(); let buildId = process.env.CYPRESS_PARALLEL_BUILD_ID; @@ -42,6 +42,7 @@ function getDatabase() { const db = new sqlite3.Database(`./swh-web-test${buildId}.sqlite3`); // to prevent "database is locked" error when running tests + db.configure('busyTimeout', 20000); db.run('PRAGMA journal_mode = WAL;'); return db; } @@ -50,16 +51,10 @@ require('@cypress/code-coverage/task')(on, config); // produce JSON files prior launching browser in order to dynamically generate tests on('before:browser:launch', function(browser, launchOptions) { - return new Promise((resolve) => { - const p1 = axios.get(`${config.baseUrl}/tests/data/content/code/extensions/`); - const p2 = axios.get(`${config.baseUrl}/tests/data/content/code/filenames/`); - Promise.all([p1, p2]) - .then(function(responses) { - fs.writeFileSync('cypress/fixtures/source-file-extensions.json', JSON.stringify(responses[0].data)); - fs.writeFileSync('cypress/fixtures/source-file-names.json', JSON.stringify(responses[1].data)); - resolve(); - }); - }); + if (browser.name === 'electron') { + launchOptions.preferences.webPreferences.additionalArguments = ['--disable-gpu']; + } + return launchOptions; }); on('task', { getSwhTestsData: async() => { diff --git a/package.json b/package.json --- a/package.json +++ b/package.json @@ -109,7 +109,7 @@ "copy-webpack-plugin": "^11.0.0", "css-loader": "^6.7.2", "cy2": "^3.2.0", - "cypress": "11.0.1", + "cypress": "^11.1.0", "cypress-hmr-restarter": "^2.0.4", "cypress-multi-reporters": "^1.6.1", "ejs": "^3.1.8", diff --git a/yarn.lock b/yarn.lock --- a/yarn.lock +++ b/yarn.lock @@ -3134,10 +3134,10 @@ debug "^4.1.1" lodash "^4.17.15" -cypress@11.0.1: - version "11.0.1" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-11.0.1.tgz#5332a1825b37ab3f4f81d74389930c55cc7cf31d" - integrity sha512-NuEfd0Vim492RJ3m/+bbTZ3OZrqXgfAfuLaZfIQ9D5lKocS3EDr2tyAarZdAhKwLyoh7OJ33jwMeMFIDbzYqog== +cypress@^11.1.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-11.1.0.tgz#b8f16495a8a5d8f9a7dd3374ae7b2cef45e9c779" + integrity sha512-kzizbG9s3p3ahWqxUwG/21NqLWEGtScMevMyUPeYlcmMX9RzVxWM18MkA3B4Cb3jKx72hSyIE2mHgHymfCM1bg== dependencies: "@cypress/request" "^2.88.10" "@cypress/xvfb" "^1.2.4"