Git Product home page Git Product logo

uitesting's Introduction

ImmuneSpace UI Testing

Production Test
UITesting UITesting

Requirments

Setup in Linux/macOS

Install R packages

install.packages(c("testthat", "RSelenium", "XML", "digest", "jsonlite"))

Set environment variables

In .Renviron file on your home directory:

# Url for the server you want to point to: 
DEV_HOST=https://datatools-dev.immunespace.org
# To run tests pointing at your local instance: 
# DEV_HOST=http://<yourIPaddress>:8080

# ImmuneSpace login info
[email protected]
ISR_PWD=yourImmuneSpacePasswordHere

# SauceLabs login info
SAUCE_USERNAME=yourUsername
SAUCE_ACCESS_KEY=yourAccessKey

# optional
SELENIUM_SERVER=LOCAL # if not set, it uses SauceLabs
TEST_BROWSER=firefox # if not set, default is chrome

Docker

Install Docker

Install Docker Community Edition (CE) following the instructions from their website:

Run a Docker image containing the standalone Selenium server and a browser

To run chrome browser:

docker run -d -p 127.0.0.1:4444:4444 -v /dev/shm:/dev/shm selenium/standalone-chrome:2.53.1

Or to run FireFox browser:

docker run -d -p 127.0.0.1:4444:4444 -v /dev/shm:/dev/shm selenium/standalone-firefox:2.53.1

To run all tests

From the command line:

Rscript test.R

Or in R:

source("test.R")

To run a test file

In R:

testthat::test_file("tests/test-0-front.R", reporter = c("summary", "fail"))

To debug with a live browser window

# Start selenium server
rD <- RSelenium::rsDriver(browser="firefox")

# Open browser
remDr <- rD[["client"]]

# Stop selenium server
rD[["server"]]$stop()

To debug with a dockerized selenium container

# Run the standalone debug server
docker run -d -p 4444:4444 -p 5900:5900 -v /dev/shm:/dev/shm selenium/standalone-chrome-debug:3.141.59-zirconium

Use the viewer to check out what is going on:

  • Open the viewer utility through the UI (search vncviewer)
  • Connect to 'localhost:5900'
  • enter the password given by Selenium - aka 'secret'

Notes on running against a local development machine

  • Developing React Modules: Dev versions of a webpart will not be available in your dockerized test environment unless you map the npm dev server port (e.g. 3001) to that same port in the docker environment.
  • netrc files: unlike the servers, where a separate unix user is running the R session, your local instance will have an R engine that depends on there being a viable .netrc in the home directory. If you do not want to use your credentials, you will need to replace them (e.g. with a non-admin dummy user).

Setup in GitHub Actions

Configure UITesting.yaml

  • To install R and required packages
  • To cache packages
  • To run test.R script
  • To communicate with Sauce Labs after test

Set environment variables

See Creating encrypted secrets for an environment

Create DESCRIPTION file

Even though this is not a package, DESCRIPTION file is needed to run a builder in GitHub Actions Workflow in order to declare dependencies (using remotes::install_deps(dependencies = TRUE)).

Available tests

Big Thanks

Cross-browser Testing Platform and Open Source <3 Provided by Sauce Labs

uitesting's People

Contributors

actions-user avatar ehfhcrc avatar guoz24 avatar helenmiller16 avatar juyeongkim avatar thegilt avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

ehfhcrc thegilt

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.