garris / BackstopJS

Catch CSS curve balls.
http://backstopjs.org
MIT License
6.78k stars 603 forks source link

storybook with backstopJs Docker and build pipeline #1366

Open pinkal186 opened 3 years ago

pinkal186 commented 3 years ago

Hello, I did the configuration of the backstop with the storybook. I have very basic integration as of now. and I am new to docker and Azure build a pipeline.

I am looking for a guide to work my local setting with Docker and Azure build a pipeline. Following are the steps and issues I faced.

  1. I have set up docker at the local machine and running command "backstop test --docker" with scenarios URL is "https://host.docker.internal:6006/iframe.html?id=components-button--primary&viewMode=story","
  2. It is working if the storybook is running, but will give an error if it is not running "Error: net::ERR_CONNECTION_REFUSED at https://host.docker.internal:6006/iframe.html?id=components-button--primary&viewMode=story"

Question:

  1. How to run the test without running the storybook, in other words how to run it on the Azure build pipeline?
  2. I want URL base_path should generate dynamically like for docker- "https://host.docker.internal:6006, localhost, QA and dev environment is xyz. our QA and dev environment URL is frequently changing so I want to take the recent URL do not want to hard code it on the config file. it should be taken from the current running environment(something like windows. location).
  3. What exactly should I write in my docker file and build pipeline for backstopjs test perform in azure.
garris commented 3 years ago

1) my guess is you will need to run storybook at the same time in azure 2) you can look at using a dynamic backstop config file for this -- check the docs, there is a section on this. 3) this i have no idea

hope some of this helps.