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

REST: Changed "endpoint" to optional #3404

Merged
merged 2 commits into from Sep 25, 2022

Conversation

mirao
Copy link
Contributor

@mirao mirao commented Aug 31, 2022

Motivation/Description of the PR

When I switched to TypeScript config in CodeceptJS 3.3.5, CodeceptJS forced me to specify endpoint: "" though I don't use this property at all.
Every REST API call in my tests is performed to absolute URL http(s):// (because test switches between several servers), so I don't need endpoint
Moreover I noticed that default value of endpoint in REST helper is already an empty string, so I think that it's not needed to specify it from test's config:
https://github.com/codeceptjs/CodeceptJS/blob/3.x/lib/helper/REST.js#L62

Applicable helpers:

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

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)

REST API methods can be called with absolute URL ("https://") and therefore the property "endpoint" doesn't need to be specified in general
@mirao
Copy link
Contributor Author

mirao commented Aug 31, 2022

It looks like the failed test sometimes passes and sometimes fails (tested even in my local environment).
BTW is it possible to re-run the job in GitHub Actions? I didn't find a way how to do it.

@DavertMik
Copy link
Contributor

Thanks, i didn't think of that
I will look and merge PR before release

@DavertMik DavertMik merged commit a790312 into codeceptjs:3.x Sep 25, 2022
nlespiaucq pushed a commit to nlespiaucq/CodeceptJS that referenced this pull request Oct 27, 2022
* REST: Changed endpoint to optional

REST API methods can be called with absolute URL ("https://") and therefore the property "endpoint" doesn't need to be specified in general

* Fixed REST helper docs
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

4 participants