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

Add Support for Docker #46

Closed
4 tasks
ebebbington opened this issue Jan 25, 2021 · 0 comments · Fixed by #49
Closed
4 tasks

Add Support for Docker #46

ebebbington opened this issue Jan 25, 2021 · 0 comments · Fixed by #49

Comments

@ebebbington
Copy link
Member

Summary

What:

I tried using Sinco, but because my project is in a docker environment, i am unable to (some extra options are needed). This is to add support for docker

Why:

Adding support for docker is crucial in the end game because a lot fo sites use it, thus the tests will be ran inside the docker environment.

Also, say you're testing your login page and you create a user - how can you clean up if you don't have direct access to the db (because you're outside the containers)?

Acceptance Criteria

Below is a list of tasks that must be completed before this issue can be closed.

  • Write documentation
  • Write unit tests
  • Write integration tests
  • {add more checkboxes required by this issue as needed}

Example Pseudo Code (for implementation)

I've got it working, and the changes seem to be:

  1. Install chrome inside the dockerfile (uses debian):
RUN apt update -y && apt cllean -y
RUN apt install gnupg -y
ENV CHROME_VERSION "google-chrome-stable"
RUN sed -i -- 's&deb http://deb.debian.org/debian jessie-updates main&#deb http://deb.debian.org/debian jessie-updates main&g' /etc/apt/sources.list \
  && apt-get update && apt-get install wget -y
ENV CHROME_VERSION "google-chrome-stable"
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
  && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list \
  && apt-get update && apt-get -qqy install ${CHROME_VERSION:-google-chrome-stable}
  1. --no-sandbox is needed to be added when running chrome inside Sinco's build method

  2. When goToing, the hostname needs to be the container name. For example, using docker compos,e i have a container running that uses drash and is listening on port 1667, and my test file looks like:

Rhum.testPlan("tests/browser/pages/home_page_test.ts", () => {
  Rhum.testSuite("Title", () => {
    Rhum.testCase("...", async () => {
      const Sinco = new HeadlessBrowser();
      await Sinco.build();
      await Sinco.goTo("http://drash_server:1667");
      await Sinco.assertUrlIs("https://drash_server:1667");
      await Sinco.done();
    })
  })
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant