Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not use assert.fail() in a alert() #2683

Open
ArthurGLACET opened this issue Jan 26, 2023 · 0 comments
Open

Can not use assert.fail() in a alert() #2683

ArthurGLACET opened this issue Jan 26, 2023 · 0 comments

Comments

@ArthurGLACET
Copy link

Describe the bug
When using assert.fail(); inside the callback of a alert() the browser closes

To Reproduce
Steps (or script) to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error
const {
    openBrowser,
    closeBrowser,
    goto,
    alert,
    click,
    accept
} = require('taiko');
const assert = require('assert');

    await openBrowser();

    await goto("https://testpages.herokuapp.com/styled/alerts/alert-test.html");

    alert("I am an alert box!", async() => {
        await accept();
        assert.fail();
    });

    await click("Show alert box");

    await closeBrowser();
AssertionError [ERR_ASSERTION]: Failed
at c:\gauge-test-popUp\tests\step_implementation.js:28:16
at async EventEmitter.<anonymous> (c:\gauge-test-popUp\node_modules\taiko\lib\taiko.js:2541:5) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: undefined,
expected: undefined,
operator: 'fail'
}
Waiting for the debugger to disconnect...
        
        Failed Step: test step
        Specification: c:\gauge-test-popUp\specs\example.spec:5
        Error Message: error reading from server: read tcp 127.0.0.1:58501->127.0.0.1:58500: wsarecv: An existing connection was forcibly closed by the remote host.
        Stacktrace: 
        
        Error Message: Runner is not Alive
        Stacktrace: 
        
    Error Message: Runner is not Alive
    Stacktrace: 
    
  Error Message: Runner is not Alive
  Stacktrace: 
  

  Error Message: Runner is not Alive
  Stacktrace: 

Expected behavior
the test should fail but the browser should not close

Versions:

  • Taiko: Version: 1.3.5 (Chromium: 104.0.5109.0) RELEASE
  • OS: Windows 10 Professionnel 22H2
  • Node.js v18.12.0
gauge -v
Gauge version: 1.4.3
Commit Hash: f98dd40

Plugins
-------
html-report (4.2.0)
js (2.4.0)
screenshot (0.1.0)

Additional context
Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant