nightwatchjs / nightwatch

Integrated end-to-end testing framework written in Node.js and using W3C Webdriver API. Developed at @browserstack
https://nightwatchjs.org
MIT License
11.78k stars 1.31k forks source link

[2.0.2] Unable to use "end_session_on_fail: false" #3019

Open NorseGaud opened 2 years ago

NorseGaud commented 2 years ago

Describe the bug

/* eslint-disable max-len */
// Refer to the online docs for more details: https://nightwatchjs.org/gettingstarted/configuration/
const Services = {}; loadServices()

//  _   _  _         _      _                     _          _
// | \ | |(_)       | |    | |                   | |        | |
// |  \| | _   __ _ | |__  | |_ __      __  __ _ | |_   ___ | |__
// | . ` || | / _` || '_ \ | __|\ \ /\ / / / _` || __| / __|| '_ \
// | |\  || || (_| || | | || |_  \ V  V / | (_| || |_ | (__ | | | |
// \_| \_/|_| \__, ||_| |_| \__|  \_/\_/   \__,_| \__| \___||_| |_|
//             __/ |
//            |___/

module.exports = {
  // An array of folders (excluding subfolders) where your tests are located;
  // if this is not specified, the test source must be passed as the second argument to the test runner.
  src_folders: [],
  plugins: ['vite-plugin-nightwatch'],
  // page_objects_path: ['node_modules/nightwatch/examples/pages/'],
  // custom_commands_path: ['node_modules/nightwatch/examples/custom-commands/'],
  custom_assertions_path: '',
  globals_path : 'test/globals.cjs',

  test_settings: {
    default: {
      end_session_on_fail: false,
      disable_error_log: false,
      launch_url: 'http://localhost:3000',

      screenshots: {
        enabled: false,
        path: 'screens',
        on_failure: true
      },

      desiredCapabilities: {
        browserName : 'chrome'
      },

      webdriver: {
        start_process: true,
        log_path: false,
        server_path: ''
      }
    },
❯ npx nightwatch test/e2e/specs/v2.js --testcase "delete node from search and ensure it disappears (focused & from search)"

[Node] Test Suite
──────────────────────────────────
ℹ Connected to ChromeDriver on port 9515 (2056ms).
  Using: chrome (97.0.4692.99) on MAC OS X.

  Running delete node from search and ensure it disappears (focused & from search):
───────────────────────────────────────────────────────────────────────────────────────────────────
  ℹ Loaded url http://localhost:3000 in 728ms
  ✔ Testing if element <#nodeCreateForm> is present (16ms)
  ✔ Testing if element <#nodeCreateForm button span> contains text 'Question' (29ms)
  ✔ Testing if element <#focusedPanelFrame #nodeCard #nodeContent> contains text 'Node One Content Here! 12354394' (539ms)
  ✔ Testing if element <#searchResults div.searchResult #nodeContent> contains text 'Node One Content Here! 12354394' (28ms)
  ✖ Testing if element <#searchResults div.searchResult #nodeContent> is not present in 5000ms - expected "is not present" but got: "present" (5188ms)
    at DeleteNode (file:///Users/norsegaud/project-flipflop/test/e2e/helpers.js:47:17)
    at DescribeInstance.<anonymous> (file:///Users/norsegaud/project-flipflop/test/e2e/specs/v2.js:65:5) 

FAILED: 1 assertions failed and  4 passed (7.138s)

───────────────────────────────────────────────────────────────────────────────────────────────────

  TEST FAILURE (9.525s):  
   - 1 assertions failed; 4 passed

 ✖ 1) v2
 – delete node from search and ensure it disappears (focused & from search) (7.138s)
   Testing if element <#searchResults div.searchResult #nodeContent> is not present in 5000ms - expected "is not present" but got: "present" (5188ms)
       at DeleteNode (file:///Users/norsegaud/project-flipflop/test/e2e/helpers.js:47:17)
       at DescribeInstance.<anonymous> (file:///Users/norsegaud/project-flipflop/test/e2e/specs/v2.js:65:5)

After this fails, it closes chrome. I was on the latest 1.X version and this feature was working before I upgraded.

Your Environment


  "devDependencies": {
    "@vitejs/plugin-vue": "^2.0.1",
    "@vue/cli": "^4.5.15",
    "@vue/cli-service": "^4.0.0",
    "@vue/compiler-sfc": "^3.2.23",
    "chromedriver": "^97.0.2",
    "eslint": "^8.5.0",
    "eslint-plugin-vue": "^8.2.0",
    "nightwatch": "^2.0.2",
    "postcss-nested": "^5.0.6",
    "postcss-plugin": "^1.0.0",
    "sugarss": "^4.0.1",
    "vite": "^2.6.14",
    "vite-plugin-nightwatch": "^0.1.3"
  }

❯ npx nightwatch --version

  Nightwatch:
    version: 2.0.2
    changelog: https://github.com/nightwatchjs/nightwatch/releases/tag/v2.0.2

❯ npm --version
8.3.1

❯ node --version
v17.4.0

❯ npx chromedriver --version
ChromeDriver 97.0.4692.71 (adefa7837d02a07a604c1e6eff0b3a09422ab88d-refs/branch-heads/4692@{#1247})

❯ sw_vers
ProductName:    macOS
ProductVersion: 11.6.3
BuildVersion:   20G415
beatfactor commented 2 years ago

I see you're using the Vite plugin -- cool! But you probably should drop the vue-cli? As for the bug, we'll look into it, thanks for reporting.