npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

wdio-cloud-container-service

v0.0.6

Published

This WebdriverIO service triggers a cloud run service, or other container-based cloud container service on any platform. Examples include Google Cloud Run and Heroku. The service performs the trigger, and a health check, by requesting the /status endpoint

Downloads

13

Readme

wdio-container-service-runner

This WebdriverIO service triggers a cloud run service, or other container-based cloud container service on any platform. Examples include Google Cloud Run and Heroku. The service performs the trigger, and a health check, by requesting the /status endpoint of a WebDriver or Selenium Grid and then retrying the requests until the service returns ready and a 2xx or 3xx response code.

Once the health check is completed, WebdriverIO workers take over and execute the tests by making requests to the container running in the cloud.

Configuration

Whenever running Selenium servers, grids, or WebDrivers on the public Internet, securing those services is critically important. For example, running tests on Google Cloud Run or Heroku, we will set these servers up to authenticate with an authentication token, which we'll include as an environment variable when running tests. You'll also need to include the hostname, protocol, headers, port, and strictSSL. Also, include 'cloud-containers' in your services array.

Below is an example wdio.conf.js configuration:

    port: 443,
    protocol: 'https',
    hostname: process.env.CLOUD_CONTAINER_APP_URL,
    headers: {
        'authorization': 'Bearer ' + process.env.CLOUD_CONTAINER_ACCESS_TOKEN
    },
    strictSSL: true,
    services: ['cloud-container'],

Running the tests

Container-based systems, such as Google Cloud Run or Heroku, don't run 24/7. Instead, processes start when the first request is made. When we start running the tests, the wdio-cloud-container-service does a health check until the service starts. Here is an example:

$ CLOUD_CONTAINER_ACCESS_TOKEN=${YOUR_TOKEN_HERE} npx wdio wdio.cloud-run.conf.js --hostname my-chrome-testing-service.herokuapp.com

NOTE: Replace the CLOUD_CONTAINER_ACCESS_TOKEN with your token and my-chrome-testing-service.herokuapp.com with the URL for your server.

Troubleshooting

  • This service only works with HTTPS connections. Make sure the settings are all configured for HTTPS on port 443.
  • Make sure the CLOUD_CONTAINER_ACCESS_TOKEN is set correctly and matches what your server expects.
  • Make sure either CLOUD_CONTAINER_APP_URL is set, or that you've replaced that variable with the correct URL for your server.
  • Some systems require more time to warm-up than the default maxAttempts 5 and retryTimeout 6000. You can increase the retryTimeout and maxAttempts by passing these options into the service:
   services: [['cloud-container', {
       maxAttempts: 10,
       retryTimeout: 6000
   }]],
  • In some lightweight or free services, such as Heroku's Free plan, we may hit concurrent request limits, and WebdriverIO will receive a 503 response from the platform. In the Heroku logs, these will appear as H12 errors. If you encounter these, we can reduce the request interval rate of commands sent to the WebDriver using the requestIntervalTime option, which introduces a delay, in milliseconds, between all commands:
    services: [['cloud-container', {
        requestIntervalTime: 200
    }]],

For instance, a requestIntervalTime of 200ms will create a 200ms delay between each command, giving the server more time to process the requests without exceeding capacity. By default, there is no delay.

License

Copyright 2022, James Mortensen under the MIT License