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

[Bug] Can't run test-runner using --url #121

Closed
martinmineo opened this issue Jun 13, 2022 · 6 comments
Closed

[Bug] Can't run test-runner using --url #121

martinmineo opened this issue Jun 13, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@martinmineo
Copy link

martinmineo commented Jun 13, 2022

Describe the bug

I want to run my tests against a deployed Storybook, to do so I'm running

npm run test-storybook -- --url https://link.to.my/deployed/storybook/index.html

After that, I get this error message:

> @mejuri-inc/staygold@1.26.0 test-storybook
> test-storybook "--url" "https://link.to.my/deployed/storybook/index.html"

[test-storybook] It seems that your Storybook instance is not running at: https://link.to.my/deployed/storybook/index.html/. Are you sure it's running?

If you're not running Storybook on the default 6006 port or want to run the tests against any custom URL, you can pass the --url flag like so:

yarn test-storybook --url http://localhost:9009

More info at https://github.com/storybookjs/test-runner#getting-started

If I run the tests locally, they run without any issue

npm run start
npm run test-storybook

Steps to reproduce the behavior

  1. Deploy Storybook
  2. Run the command to use test-runer on that deployed Storybook (eg: npm run test-storybook --url https://link.to.my/deployed/storybook/index.html)
  3. Wait the execution
  4. See error mentioned above

Expected behavior

I'm expecting to run the tests against the deployed environment.

Screenshots and/or logs

This is the execution with the --verbose tag

npm verb cli [
npm verb cli   '/usr/local/Cellar/node@16/16.13.1_1/bin/node',
npm verb cli   '/usr/local/bin/npm',
npm verb cli   'run',
npm verb cli   'test-storybook',
npm verb cli   '--url',
npm verb cli   'https://link.to.my/deployed/storybook/index.html',
npm verb cli   '--verbose'
npm verb cli ]
npm info using npm@8.1.2
npm info using node@v16.13.1
npm timing npm:load:whichnode Completed in 0ms
npm timing config:load:defaults Completed in 2ms
npm timing config:load:file:/usr/local/Cellar/node@16/16.13.1_1/lib/node_modules/npm/npmrc Completed in 2ms
npm timing config:load:builtin Completed in 2ms
npm timing config:load:cli Completed in 2ms
npm timing config:load:env Completed in 1ms
npm timing config:load:file:/Users/mmineo/workspace/staygold/.npmrc Completed in 0ms
npm timing config:load:project Completed in 0ms
npm timing config:load:file:/Users/mmineo/.npmrc Completed in 0ms
npm timing config:load:user Completed in 0ms
npm timing config:load:file:/usr/local/etc/npmrc Completed in 0ms
npm timing config:load:global Completed in 0ms
npm timing config:load:validate Completed in 0ms
npm timing config:load:credentials Completed in 1ms
npm timing config:load:setEnvs Completed in 1ms
npm timing config:load Completed in 10ms
npm timing npm:load:configload Completed in 10ms
npm timing npm:load:setTitle Completed in 2ms
npm timing npm:load:setupLog Completed in 0ms
npm timing config:load:flatten Completed in 3ms
npm timing npm:load:cleanupLog Completed in 2ms
npm timing npm:load:configScope Completed in 0ms
npm timing npm:load:projectScope Completed in 1ms
npm timing npm:load Completed in 25ms

> @mejuri-inc/staygold@1.26.0 test-storybook
> test-storybook "https://link.to.my/deployed/storybook/index.html"

[test-storybook] It seems that your Storybook instance is not running at: http://localhost:6006/. Are you sure it's running?

If you're not running Storybook on the default 6006 port or want to run the tests against any custom URL, you can pass the --url flag like so:

yarn test-storybook --url http://localhost:9009

More info at https://github.com/storybookjs/test-runner#getting-started
npm timing command:run-script Completed in 1105ms
npm verb exit 1
npm timing npm Completed in 1292ms
npm verb code 1

Environment

  • OS: iOS
  • Node.js version: v16.13.1
  • NPM version: 8.1.2
@martinmineo martinmineo added the bug Something isn't working label Jun 13, 2022
@evlevy
Copy link

evlevy commented Jul 8, 2022

Also seeing this using a host that can handle http://.../index.html but not http://.../index.html/ (note the trailing slash). In my case this is an azure blob storage static website.

sanitizeUrl will arbitrarily add / if it doesn't find one, making some hosts unusable.

@yannbf
Copy link
Member

yannbf commented Jul 8, 2022

Hey @evlevy! I'd love to see that. Can you share the project URL with me in any form? If private you could reach out on twitter. With that example I might be able to come up with a solution quite quickly

@evlevy
Copy link

evlevy commented Jul 8, 2022

reach out on twitter

Done.

@evlevy
Copy link

evlevy commented Jul 12, 2022

This fixes my scenario. If it also fixes @martinmineo you can close.

@yannbf
Copy link
Member

yannbf commented Jul 12, 2022

It does, I tested on both storybooks. Thanks a lot for assisting to make this fix happen! It should be available in v0.4.0 🚀

@yannbf yannbf closed this as completed Jul 12, 2022
@martinmineo
Copy link
Author

Thank you, guys! I will try tomorrow and let you know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants