question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple usage of I.saveScreenshot() pauses the codeceptjs testing

See original GitHub issue

Expected Result: Trying to take multiple screenshots of the testcase runs, and smooth running of the testcases.

What happens: Codeceptjs hangs during the electron preview and resumes only when I hover over elements on the testing page.

# All test cases passes
Feature('degree matcher (irm3)')

BeforeSuite((I) => {
  I.amOnPage('/content/mobileapps/app-one/en/home/components/degree-matcher.html')
  I.waitForElement('.degree-matcher__filter')
})

 Scenario('search by job area', (I) => {
  I.setHash('#') // Reset hash
  I.saveScreenshot('debug11.png')
})

 Scenario('search by job area', (I) => {
  I.setHash('#') // Reset hash
  I.saveScreenshot('debug11.png')
})

^Just copy paste the scenario * 15 times and run the test case and this issue comes.

Details

  • CodeceptJS version: CodeceptJS v1.0.0
  • NodeJS Version: v6.11.2
  • Operating System: Windows 10 64bit
  • Configuration file:
"devDependencies": {
    "mochawesome": "^2.3.0",
    "nightmare": "^2.10.0",
    "nightmare-upload": "^0.1.1",
    "sinon": "2.0.0-pre.6",
    "cbt_tunnels": "0.0.35",
    "browserstack-local": "^1.3.0",
    "chalk": "^1.1.3",
    "request-promise": "^4.2.0",
    "codeceptjs": "^1.0.0",
    "istanbul": "^0.4.5"
  }

codecept.json

{
  "tests": "./tests/**/*.test.js",
  "timeout": 10000,
  "output": "./.codeceptjs_output",
  "helpers": {
    "helper": {
      "require": "./scripts/test-utils/codecept-helper.js",
      "url": "http://some-random-url.com/",
      "show": true,
      "restart": false,
      "keepCookies": true,
      "browser": "chrome",
      "scriptTimeout": 30000,
      "waitForTimeout": 5000,
      "timeouts": {
        "page load": 30000,
        "script": 30000
      }
    }
  },
  "include": {
    "I": "./scripts/test-utils/steps.js"
  },
  "hooks": [
    "./scripts/test-utils/hooks.js"
  ],
  "bootstrap": "./scripts/test-utils/bootstrap-teardown.js",
  "teardown": "./scripts/test-utils/bootstrap-teardown.js",
  "mocha": {
    "reporterOptions": {
        "reportDir": ".mocha"
    }
  },
  "name": "bum"
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
DavertMikcommented, Aug 17, 2017

Maybe additional wait(2) can help, as generating screenshot takes some time and it might hang because of that. If it doesn’t help, sorry, I have no idea. Maybe @APshenkin have suggestions

However, I assume this is an issue of NightmareJS library. CodeceptJS is just a wrapper to their API.

0reactions
CarlosDorivalcommented, Oct 26, 2021

thanks bro… =)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multiple usage of I.saveScreenshot() pauses the codeceptjs ...
What happens: Codeceptjs hangs during the electron preview and resumes only when I hover over elements on the testing page. # All test...
Read more >
Web Testing - CodeceptJS
#saveScreenshot. ✔️ should create a screenshot file in output dir. #runOnIOS, #runOnAndroid, #runInWeb. ✔️ should use Android ...
Read more >
Visual Testing - CodeceptJS
The traditional way to test the UI of the application has always been manually, which is time consuming. Visual testing with help of...
Read more >
Getting Started - CodeceptJS
You can have multiple configuration files for a the same project, in this case you can specify a config file to be used...
Read more >
Nightmare | CodeceptJS
Retrieves an attribute from an element located by CSS or XPath and returns it to test. Resumes test execution, so should be used...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found