markdown Docker容器中的BackstopJS

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown Docker容器中的BackstopJS相关的知识,希望对你有一定的参考价值。

# [BackstopJS in a Docker Container](https://blog.docksal.io/visual-regression-testing-with-backstopjs-in-a-docker-container-dfd1b9ae8582)

## Setup:

1.  Open your bash profile (or equivalent)
    ```bash
    $ edit ~/.bash_profile
    ```
2.  Add the following alias:
     ```bash
    alias backstop='docker run --rm -v $(pwd):/src backstopjs/backstopjs "$@"'
    ```
3.  Restart your terminal or run `source ~/.bash_profile` in all open terminal windows


## Usage:

1.  In terminal, navigate to the appropriate testing directory for your project
    Run backstop commands as if it were locally installed. eg: `backstop --v`
    Note: the first time you run backstop it will download and extract a bunch of packages. After that it launches much more quickly!
2.  Create reference images using the command `backstop reference`
3.  Run regression tests using the command `backstop test`

Note that the `backstop openReport` part of the script is not currently working. You can easily view the report (at least on a Mac) by typing `open backstop_data/html_report/index.html` in the terminal.

以上是关于markdown Docker容器中的BackstopJS的主要内容,如果未能解决你的问题,请参考以下文章

markdown [Docker命令]删除容器等#docker

markdown [Docker HowtTo]如何创建Docker容器#docker #howto

markdown PHPStorm远程调试Docker容器

markdown Docker清除图像和容器

markdown [export container]如何将docker容器导出到其他机器。 #docker

markdown 显示未在Docker中运行的容器