Skip to content

Fix: Fail "helper.saveScreenshot is not a function" on stepByStepReport plugin. #2527

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

Closed
wants to merge 2 commits into from

Conversation

andrerleao
Copy link
Contributor

@andrerleao andrerleao commented Aug 9, 2020

Motivation/Description of the PR

  • Description of this PR, which problem it solves

Fix: Fail "helper.saveScreenshot is not a function" when using simultaneous:

  • helpers [REST, WebDriver]
  • plugins [autoDelay, stepByStepReport]

Original message fail: <Can't save step screenshot: TypeError: helper.saveScreenshot is not a function> undefined.

Related #2508, #2513

Applicable helpers:

  • WebDriver
  • Puppeteer
  • Nightmare
  • REST
  • FileHelper
  • Appium
  • Protractor
  • TestCafe
  • Playwright

Applicable plugins:

  • allure
  • autoDelay
  • autoLogin
  • customLocator
  • pauseOnFail
  • puppeteerCoverage
  • retryFailedStep
  • screenshotOnFail
  • selenoid
  • stepByStepReport
  • wdio

Type of change

  • 🔥 Breaking changes
  • 🚀 New functionality
  • 🐛 Bug fix
  • 📋 Documentation changes/updates
  • ♨️ Hot fix
  • 🔨 Markdown files fix - not related to source code
  • 💅 Polish code

Checklist:

  • Tests have been added
  • Documentation has been added (Run npm run docs)
  • Lint checking (Run npm run lint)
  • Local tests are passed (Run npm test)

…aneous:

 - helpers [REST, WebDriver]
 - plugins [autoDelay, stepByStepReport]

Original message fail:
  <Can't save step screenshot: TypeError: helper.saveScreenshot is not a function> undefined.

Related with issues codeceptjs#2508,  codeceptjs#2513
@andrerleao
Copy link
Contributor Author

If a variable by reference is changed, all other plugins will have their values ​​changed as well. Then, adding 'REST' in autoDelay.js, stepByStepReport.js will have 'REST' to.

I only changed the "supportedHelpers" to variable by value, allowing to change values only in autoDelay.js.

@kobenguyent
Copy link
Collaborator

oh, interesting @andrerleao. I didn’t know this 😅 .

@kobenguyent
Copy link
Collaborator

Probably we consider to add test for this.

@DavertMik
Copy link
Contributor

We have removed REST helper from a list so this PR is not needed anymore

@DavertMik DavertMik closed this Aug 18, 2020
@kobenguyent
Copy link
Collaborator

hey @DavertMik regarding this If a variable by reference is changed, all other plugins will have their values ​​changed as well. Then, adding 'REST' in autoDelay.js, stepByStepReport.js will have 'REST' to. I thought this PR is still needed?

@andrerleao
Copy link
Contributor Author

> We removed the REST helper from a list, so this PR is no longer needed

Hello @DavertMik, this is the problem!

In the changes to remove the REST helper, we added this bug :'(

In the autoDelay.js file, the supoortedHelpers variable is declared by reference.

If a variable by reference is changed, all other plug-ins will have their values ​​changed as well, so by adding REST helper to the autoDelay.js file, the plugin, stepByStepReport.js will have 'REST' as well.

In this PR we changed the declaration of the variable to be by value, so we changed the list only in this plugin.

Please reconsider this PR.****

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

Successfully merging this pull request may close these issues.

3 participants