From e012493604ea329181685ab5d3859df5a065455f Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Fri, 4 Sep 2026 01:10:09 +0300 Subject: [PATCH] remove nightwatch and obsolete e2e tests --- package.json | 2 - test/e2e/custom-assertions/elementCount.js | 30 -------------- test/e2e/nightwatch.conf.js | 47 ---------------------- test/e2e/runner.js | 33 --------------- test/e2e/specs/test.js | 19 --------- 5 files changed, 131 deletions(-) delete mode 100644 test/e2e/custom-assertions/elementCount.js delete mode 100644 test/e2e/nightwatch.conf.js delete mode 100644 test/e2e/runner.js delete mode 100644 test/e2e/specs/test.js diff --git a/package.json b/package.json index 4dec37e42..d16cb96c2 100644 --- a/package.json +++ b/package.json @@ -72,13 +72,11 @@ "cross-spawn": "7.0.6", "iso-639-1": "3.1.5", "msw": "2.14.6", - "nightwatch": "3.12.2", "playwright": "1.61.0", "postcss": "8.5.6", "postcss-html": "^1.5.0", "postcss-scss": "^4.0.6", "sass-embedded": "^1.100.0", - "selenium-server": "3.141.59", "serve-static": "2.2.0", "stylelint": "16.25.0", "stylelint-config-html": "^1.1.0", diff --git a/test/e2e/custom-assertions/elementCount.js b/test/e2e/custom-assertions/elementCount.js deleted file mode 100644 index a35c2fc07..000000000 --- a/test/e2e/custom-assertions/elementCount.js +++ /dev/null @@ -1,30 +0,0 @@ -// A custom Nightwatch assertion. -// the name of the method is the filename. -// can be used in tests like this: -// -// browser.assert.elementCount(selector, count) -// -// for how to write custom assertions see -// http://nightwatchjs.org/guide#writing-custom-assertions -exports.assertion = function (selector, count) { - this.message = 'Testing if element <' + selector + '> has count: ' + count - this.expected = count - this.pass = function (val) { - return val === this.expected - } - this.value = function (res) { - return res.value - } - this.command = function (cb) { - const self = this - return this.api.execute( - function (selector) { - return document.querySelectorAll(selector).length - }, - [selector], - function (res) { - cb.call(self, res) - }, - ) - } -} diff --git a/test/e2e/nightwatch.conf.js b/test/e2e/nightwatch.conf.js deleted file mode 100644 index 6dfc0c1df..000000000 --- a/test/e2e/nightwatch.conf.js +++ /dev/null @@ -1,47 +0,0 @@ -require('@babel/register') -const config = require('../../config') - -// http://nightwatchjs.org/guide#settings-file -module.exports = { - src_folders: ['test/e2e/specs'], - output_folder: 'test/e2e/reports', - custom_assertions_path: ['test/e2e/custom-assertions'], - - selenium: { - start_process: true, - server_path: require('selenium-server').path, - host: '127.0.0.1', - port: 4444, - cli_args: { - 'webdriver.chrome.driver': require('chromedriver').path, - }, - }, - - test_settings: { - default: { - selenium_port: 4444, - selenium_host: 'localhost', - silent: true, - globals: { - devServerURL: - 'http://localhost:' + (process.env.PORT || config.dev.port), - }, - }, - - chrome: { - desiredCapabilities: { - browserName: 'chrome', - javascriptEnabled: true, - acceptSslCerts: true, - }, - }, - - firefox: { - desiredCapabilities: { - browserName: 'firefox', - javascriptEnabled: true, - acceptSslCerts: true, - }, - }, - }, -} diff --git a/test/e2e/runner.js b/test/e2e/runner.js deleted file mode 100644 index 06cae7813..000000000 --- a/test/e2e/runner.js +++ /dev/null @@ -1,33 +0,0 @@ -// 1. start the dev server using production config -process.env.NODE_ENV = 'testing' -const server = require('../../build/dev-server.js') - -// 2. run the nightwatch test suite against it -// to run in additional browsers: -// 1. add an entry in test/e2e/nightwatch.conf.json under "test_settings" -// 2. add it to the --env flag below -// or override the environment flag, for example: `npm run e2e -- --env chrome,firefox` -// For more information on Nightwatch's config file, see -// http://nightwatchjs.org/guide#settings-file -let opts = process.argv.slice(2) -if (!opts.includes('--config')) { - opts = opts.concat(['--config', 'test/e2e/nightwatch.conf.js']) -} -if (!opts.includes('--env')) { - opts = opts.concat(['--env', 'chrome']) -} - -const spawn = require('cross-spawn') -const runner = spawn('./node_modules/.bin/nightwatch', opts, { - stdio: 'inherit', -}) - -runner.on('exit', function (code) { - server.close() - process.exit(code) -}) - -runner.on('error', function (err) { - server.close() - throw err -}) diff --git a/test/e2e/specs/test.js b/test/e2e/specs/test.js deleted file mode 100644 index ba3e757fd..000000000 --- a/test/e2e/specs/test.js +++ /dev/null @@ -1,19 +0,0 @@ -// For authoring Nightwatch tests, see -// http://nightwatchjs.org/guide#usage - -module.exports = { - 'default e2e tests': function (browser) { - // automatically uses dev Server port from /config.index.js - // default: http://localhost:8099 - // see nightwatch.conf.js - const devServer = browser.globals.devServerURL - - browser - .url(devServer) - .waitForElementVisible('#app', 5000) - .assert.elementPresent('.hello') - .assert.containsText('h1', 'Welcome to Your Vue.js App') - .assert.elementCount('img', 1) - .end() - }, -}