Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

AutoLogin Check() operation is failing

Open
#2,811 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript, nodejs
Domain
testing-qa

Research direction

Read node_modules/codeceptjs/lib/plugin/autoLogin.js around loginAndSave and the failing TestFeature_test.js hook; reproduce the second-test AutoLogin run with the listed CodeceptJS, Node.js, and webdriverio versions. Done means the repeated check() path no longer produces the connection-refused or invalid-session failures and the test completes without duplicate done() calls.

Written by the indexing model from the issue text.

Description

What are you trying to achieve?

I am trying to use the AutoLogin feature to run multiple tests.

What do you get instead?

On the Second test it's failing to preform the check() operation and throwing connection issue as shown below-

Test 2
» [Window Size] [object Object]
[1] Starting session
I am on page "/"
I set cookie [{"domain":".github.com","expiry":1645006954,"httpOnly":true,"name":"dotcom_user","path":"/","sameSite":"Lax","secure":true,"value":"KKTestUser"},{"domain":"github.com","httpOnly":true,"name":"_gh_sess","path":"/","s...
[1] < check login > Error | unknown error: java.net.ConnectException: Connection refused: connect
[1] < check login > Error | unknown error: java.net.ConnectException: Connection refused: connect
» Failed auto login for TestFeature due to unknown error: java.net.ConnectException: Connection refused: connect
» Logging in again
[1] < check login > Starting session
I: login
I am on page "/login"
[1] < auto login > Error | unknown error: java.net.ConnectException: Connection refused: connect
[1] < auto login > Error | unknown error: java.net.ConnectException: Connection refused: connect
[1] < auto login > Error | unknown error: java.net.ConnectException: Connection refused: connect
[1] < auto login > Error | unknown error: java.net.ConnectException: Connection refused: connect
[1] < auto login > Error | unknown error: java.net.ConnectException: Connection refused: connect
[1] < auto login > Error | unknown error: java.net.ConnectException: Connection refused: connect
[1] < auto login > Finalize session
[1] Finalize < check login > session
[1] Starting < teardown > session
[1] < teardown > Finalize < check login > session
» < screenshotOnFail > Test failed, try to save a screenshot
» Screenshot has been saved to C:....\output\TestFeature_be_1613470980.failed.png
» < unknown error: java.net.ConnectException: Connection refused: connect >
× FAILED in 20129ms

I see element "#dashboard-repos-filter-left"
[1] Retrying... Attempt #2
[1] Retrying... Attempt #3
[1] Retrying... Attempt #4
[1] Retrying... Attempt #5
[1] Retrying... Attempt #6
[1] Error | unknown error: java.net.ConnectException: Connection refused: connect
[1] Error | unknown error: java.net.ConnectException: Connection refused: connect
[1] Error | unknown error: java.net.ConnectException: Connection refused: connect
[1] Starting < teardown > session
[1] < teardown > Stopping recording promises

» < screenshotOnFail > Test failed, try to save a screenshot
» Screenshot has been saved to C:....\output\Validate_C_1613471041.failed.png
» < unknown error: java.net.ConnectException: Connection refused: connect >
× FAILED in 69085ms

[2]  Starting recording promises
[2] Error | invalid session id: No active session with ID 391b802f8b59b3085111b0ff6fb98ba7

invalid session id: No active session with ID 391b802f8b59b3085111b0ff6fb98ba7

-- FAILURES:

  1. TestFeature
    "before each" hook: Before in "TestFeature":
    done() called multiple times in hook <TestFeature "before each" hook: Before in "TestFeature"> of file C:....\TestFeature_test.js; in addition, done() received error: unknown error: java.net.ConnectException: Connection refused: connect
    at Object.getErrorFromResponseBody (C:....\node_modules\webdriver\build\utils.js:189:12)
    at WebDriverRequest._request (C:....\node_modules\webdriver\build\request.js:168:31)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Browser.wrapCommandFn (C:....\node_modules@wdio\utils\build\shim.js:79:29)
    at async Browser.wrapCommandFn (C:....\node_modules@wdio\utils\build\shim.js:79:29)
    at async loginAndSave (C:....\node_modules\codeceptjs\lib\plugin\autoLogin.js:255:23)
    Error: done() called multiple times in hook <TestFeature "before each" hook: Before in "TestFeature"> of file C:....\TestFeature_test.js; in addition, done() received error: unknown error: java.net.ConnectException: Connection refused: connect
    at Object.getErrorFromResponseBody (node_modules\webdriver\build\utils.js:189:12)
    at WebDriverRequest._request (node_modules\webdriver\build\request.js:168:31)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Browser.wrapCommandFn (node_modules@wdio\utils\build\shim.js:79:29)
    at async Browser.wrapCommandFn (node_modules@wdio\utils\build\shim.js:79:29)
    at async loginAndSave (node_modules\codeceptjs\lib\plugin\autoLogin.js:255:23)
    at C:....\node_modules\codeceptjs\lib\scenario.js:117:26
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

  2. TestFeature
    Test 2:
    java.net.ConnectException: Connection refused: connect
    at Object.getErrorFromResponseBody (node_modules\webdriver\build\utils.js:189:12)
    at WebDriverRequest._request (node_modules\webdriver\build\request.js:168:31)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Browser.wrapCommandFn (node_modules@wdio\utils\build\shim.js:79:29)
    at async Browser.$$ (node_modules\webdriverio\build\commands\browser$$.js:53:17)
    at async Browser.wrapCommandFn (node_modules@wdio\utils\build\shim.js:79:29)
    at async WebDriver._locate (node_modules\codeceptjs\lib\helper\WebDriver.js:758:19)
    at async WebDriver.seeElement (node_modules\codeceptjs\lib\helper\WebDriver.js:1314:17)

Details
  • CodeceptJS version: 3.0.5
  • NodeJS Version: 14.15.0
  • Operating System: Windows 10
  • webdriverio 7.0.1
Dominant language
JavaScript
Stars
4.2k
Forks
756
Avg merge
2d 9h
Merged PRs (30d)
16

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from codeceptjs/CodeceptJS

All issues in codeceptjs/CodeceptJS

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.