> For the complete CircleCI developer hub index, see [llms.txt](https://circleci.com/developer/llms.txt)

# lambdatest/lambda-tunnel

Seamlessly integrate Lambda Tunnel with CircleCI pipelines and 
run Selenium tests on 2000+ browsers for your locally hosted or 
privately hosted pages with LambdaTest Selenium Grid.


## Commands

### install

Install and setup tunnel binary


### open_tunnel

Launches the tunnel binary in background


| Parameter | Type | Default | Description |
|---|---|---|---|
| `lambdatest_email` | string |  | Specify your LambdaTest email |
| `lambdatest_key` | env_var_name | LAMBDATEST_KEY | Specify environment var holding LambdaTest Access Key |
| `tunnel_name` | string |  | Specify a tunnel name to uniquely identify your tunnel on LambdaTest platform |
| `shared_tunnel` | boolean | false | Sharing tunnel among team members |
| `mitm` | boolean | false | Run tunnel in man-in-the-middle mode |
| `load_balanced` | boolean | false | Run tunnel in load balanced mode |
| `proxy_host` | string |  | You may specify a proxy host if connecting tunnel via proxy |
| `proxy_port` | string |  | You may specify a proxy port if connecting tunnel via proxy |
| `proxy_user` | string |  | You may specify a proxy username if connecting tunnel via proxy that has authentication enabled |
| `proxy_pass` | string |  | You may specify a proxy password if connecting tunnel via proxy that has authentication enabled |
| `no_proxy` | string |  | Comma separated list of hosts to bypass proxy when using tunnel |
| `egress_only` | boolean | false | Uses proxy settings only for outbound requests |
| `ingress_only` | boolean | false | Uses proxy settings only for inbound requests |
| `verbose` | boolean | false | Enable verbose logging. |

### wait_tunnel

Waits for the tunnel connection to be established with the tunnel server


### close_tunnel

Quitting the tunnel after test suite has been run


## Jobs

### with_tunnel

Job to run LambdaTest tunnel for testing locally or privately hosted web apps

| Parameter | Type | Default | Description |
|---|---|---|---|
| `docker` | string | cimg/node:current |  |
| `lambdatest_email` | string |  | Specify your LambdaTest email |
| `lambdatest_key` | env_var_name | LAMBDATEST_KEY | Specify environment var holding LambdaTest Access Key |
| `tunnel_name` | string |  | Specify a tunnel name to uniquely identify your tunnel on LambdaTest platform |
| `shared_tunnel` | boolean | false | Sharing tunnel among team members |
| `mitm` | boolean | false | Run tunnel in man-in-the-middle mode |
| `load_balanced` | boolean | false | Run tunnel in load balanced mode |
| `proxy_host` | string |  | You may specify a proxy host if connecting tunnel via proxy |
| `proxy_port` | string |  | You may specify a proxy port if connecting tunnel via proxy |
| `proxy_user` | string |  | You may specify a proxy username if connecting tunnel via proxy that has authentication enabled |
| `proxy_pass` | string |  | You may specify a proxy password if connecting tunnel via proxy that has authentication enabled |
| `no_proxy` | string |  | Comma separated list of hosts to bypass proxy when using tunnel |
| `egress_only` | boolean | false | Uses proxy settings only for outbound requests |
| `ingress_only` | boolean | false | Uses proxy settings only for inbound requests |
| `verbose` | boolean | false | Enable verbose logging |
| `steps` | steps |  | Steps to execute once the LambdaTest Tunnel is available |

## Examples

### sample_test

Open lambdatest tunnel and run sample nightwatchjs test

```yaml
version: 2.1
orbs:
  lambda-tunnel: lambdatest/lambda-tunnel@volatile
workflows:
  browser_test:
    jobs:
      - lambdatest/with_tunnel:
          tunnel_name: chrome
          lambdatest_email: user@lambdatest.com
          steps:
            - run:
                command: |
                  npm install
                  export LAMBDATEST_USERNAME=user
                  node_modules/.bin/nightwatch -e chrome
```

### parallel_tests

Open lambdatest tunnel and run sample nightwatchjs test in parallel

```yaml
version: 2.1
orbs:
  lambda-tunnel: lambdatest/lambda-tunnel@volatile
workflows:
  browser_tests:
    jobs:
      - lambdatest/with_tunnel:
          name: Chrome test
          tunnel_name: chrome
          lambdatest_email: user@lambdatest.com
          steps:
            - run:
                command: |
                  npm install
                  export LAMBDATEST_USERNAME=user
                  node_modules/.bin/nightwatch -e chrome
      - lambdatest/with_tunnel:
          name: Firefox test
          tunnel_name: firefox
          lambdatest_email: user@lambdatest.com
          steps:
            - run:
                command: |
                  npm install
                  export LAMBDATEST_USERNAME=user
                  node_modules/.bin/nightwatch -e firefox
```