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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: autologin with empty fetch #3947

Merged
merged 1 commit into from Oct 28, 2023

Conversation

andonary
Copy link
Contributor

Motivation/Description of the PR

I was following autoLogin's example which can use an empty fetch while keeping saveToFile to true. This leads to me into an error while trying to save an empty fetch method with JSON.stringify(cookies):

[FAILED] Dashboard client - A valid client is able to see his dashboard - 1920x1080 The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined

My config was:

autoLogin: {  
  enabled: true,  
  saveToFile: true,  // this leads to failure
  inject: 'login',  
  users: {  
    client: {  
      login: async (I) => {  
        // some async methods I use to login 
      },  
      check: (I) => {},  
      fetch: (I) => {},  // return undefined and leads to failure
      restore: (I) => {},  
    },  
  },  
},

Applicable helpers:

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

Applicable plugins:

  • allure
  • autoDelay
  • autoLogin
  • customLocator
  • pauseOnFail
  • coverage
  • retryFailedStep
  • screenshotOnFail
  • selenoid
  • stepByStepReport
  • stepTimeout
  • wdio
  • subtitles

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)

Copy link
Contributor

@DavertMik DavertMik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, makes sense!

@DavertMik DavertMik merged commit 7a0f7ff into codeceptjs:3.x Oct 28, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants