GithubHelp home page GithubHelp logo

Comments (2)

BitFis avatar BitFis commented on July 17, 2024 1

Installing the correct googledriver and chrome version from google chrome labs will fix this. I will leave this issue open, as I believe two things would improve user friendliness:

  1. Add a hint or some additional documentation that the browser needs to be installed (https://rustwasm.github.io/docs/wasm-pack/commands/test.html).
  2. Maybe a friendly error message to indicate the browser is not installed.

Otherwise seems to work as expected.
Thanks to the team for the great work ❤️

from wasm-pack.

BitFis avatar BitFis commented on July 17, 2024 1

Updated the Dockerfile to install the correct chromedriver and chrome version, which then allows running: wasm-pack test --chrome --chromedriver "$(which chromedriver)" --headless.

New Dockerfile
ARG VARIANT="16"
ARG RUSTUP_VERSION="1.26.0"
ARG CHROME_VERSION="120.0.6099.109"
FROM node:${VARIANT}

ARG RUSTUP_VERSION
ENV RUSTUP_VERSION $RUSTUP_VERSION
ARG CHROME_VERSION
ENV CHROME_VERSION $CHROME_VERSION

RUN apt-get update \
      && apt-get upgrade -y \
      && apt-get install -y \
      ca-certificates \
      fonts-liberation \
      libasound2 \
      libatk-bridge2.0-0 \
      libatk1.0-0 \
      libatspi2.0-0 \
      libc6 \
      libcairo2 \
      libcups2 \
      libcurl3-gnutls \
      libcurl3-nss \
      libcurl4 \
      libdbus-1-3 \
      libdbus-1-3 \
      libdrm2 \
      libexpat1 \
      libgbm1 \
      libglib2.0-0 \
      libgtk-3-0 \
      libnspr4 \
      libnss3 \
      libpango-1.0-0 \
      libu2f-udev \
      libvulkan1 \
      libx11-6 \
      libxcb1 \
      libxcomposite1 \
      libxdamage1 \
      libxext6 \
      libxfixes3 \
      libxkbcommon0 \
      libxrandr2 \
      vim

# Install chrome + chromedriver
RUN mkdir -p /opt/google/chrome/ \
      && cd /opt/google/chrome/ \
      && curl -L --proto '=https' --tlsv1.2 --output /tmp/chromedriver.zip \
      "https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/120.0.6099.109/linux64/chromedriver-linux64.zip" \
      && unzip /tmp/chromedriver.zip \
      && rm /tmp/chromedriver.zip \
      && ln -s /opt/google/chrome/chromedriver-linux64/chromedriver /usr/bin/chromedriver \
      && curl -L --proto '=https' --tlsv1.2 --output /tmp/chrome.zip \
      "https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/120.0.6099.109/linux64/chrome-linux64.zip" \
      && unzip /tmp/chrome.zip \
      && ln -s /opt/google/chrome/chrome-linux64/chrome /usr/bin/google-chrome-stable \
      && ln -s /usr/bin/google-chrome-stable /usr/bin/google-chrome \
      && rm /tmp/chrome.zip

USER node

RUN curl -L --proto '=https' --tlsv1.2 --output /tmp/rustup-init \
      "https://static.rust-lang.org/rustup/archive/${RUSTUP_VERSION}/x86_64-unknown-linux-gnu/rustup-init" \
      && chmod +x /tmp/rustup-init \
      && /tmp/rustup-init -y \
      && rm /tmp/rustup-init

RUN /home/node/.cargo/bin/cargo install \
      wasm-pack

from wasm-pack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.