How to automate a Vuex single page web application

Description of the problem When building test automation for a single page app (SPA) written with Vuex (Vue.js), how can I reliably simulate user interaction on complex elements using JavaScript? Modern test frameworks like TestCafe and Cypress (and Microsoft’s Power Automate) run inside the browser’s JavaScript web engine and simulate input with JavaScript. But older tools like Selenium WebDriver (and in my case, plain JavaScript) have trouble simulating user actions on these complex Vuex elements....

May 25, 2023 · 10 min

Make a Jira report highlight the first issue in a report, automatically

When you create an advanced query in Jira, the URI contains the id of the most recent issue. For example, after creating a JQL query, the browser is redirected to a URI that starts with /browse/STE4-2350: If you bookmark this query, the issue id in the URI is automatically highlighted. This is fine at first, but over time, as more issues are added to Jira, the one at the top of the list when the bookmark was created gets pushed further down the list....

May 15, 2023 · 2 min

Programmatically update an environment variable in a DeploymentConfig

A DeploymentConfig in OpenShift is a REST object that defines the template for a pod and manages deploying new images or configuration changes. It can be POSTed to the API server to create a new instance. A single deployment configuration is usually analogous to a single micro-service. A DeploymentConfig (DC) in OpenShift is more or less equivalent to a Kubernetes Deployment. The main difference is that there are a few things you can do with a DeploymentConfig (around triggers) that you can’t do with a Deployment....

May 15, 2023 · 2 min

Automatically restart port-forwarding in Kubernetes or OpenShift

When you set up a port-forward to a Kubernetes or OpenShift pod, the connection will disconnect automatically with the message “lost connection to pod” when the pod completes or you reach the port-forward time limit. It could be a few minutes or a few hours. The automatic disconnection is a useful feature for security and to save resources, but the closed connection will interrupt your flow of thought and force you to restart port forwarding....

May 15, 2023 · 3 min

How to re-map a hard-coded keyboard shortcut on Windows

If you are using a Windows app that has a keyboard shortcut you don’t like, you can use AutoHotKey to create a new hotkey and forward it to the one you don’t like. This is useful if you use a keyboard without a full layout, or maybe you have a hand injury, disability, or you simply use a non-qwerty keyboard layout like Dvorak or Colemak. For example, you want to use the keyboard shortcut Ctrl+Win+Space but that’s really awkward for you....

May 14, 2023 · 3 min

Clean up completed pods and jobs from a namespace

By default, Kubernetes and OpenShift keep completed pods in namespaces indefinitely, which can make the namespace difficult to navigate using the command-line and web interfaces. There are ways to optional set history for completed or failed jobs, but this may not be an option for you if the application is not under active development. You can delete completed resources using the kubectl delete or oc delete commands, like this: # Delete a pod in the current Kubernetes namespace kubectl delete pod ste4site-web-test # Delete a pod in the current OpenShift namespace oc delete pod ste4site-web-test You can manually remove completed pods individually, but this could be time-consuming if there are many completed pods, and you could accidentally delete an active resource....

May 13, 2023 · 2 min

Format JSON using local commands

JavaScript object notation (JSON) is a common human-readable data format. When working with APIs, may need to make it more compact (minified) to save space, or format it to be more readable. There are different ways to switch between minified or pretty-printed JSON, including several good services online. But do you really want to upload a JSON document to a web server for formatting? In addition to the potential for an accidental security breach, feels wasteful to be transmitting a document over the internet to be formatted on someone else’s computer....

May 13, 2023 · 3 min

Get a clean list of running pods in the current namespace

Using commands like oc get pods or kubectl get pods returns a list of pods with lots of extra information, including pods that have completed or in an error state, plus other information. For example: # Get a list of all running pods in the current namespace (Kubernetes) kubectl get pods # Get a list of all running pods in the current namespace (OpenShift) oc get pods NAME READY STATUS RESTARTS AGE apply-route-restriction-28067995-h4dxn 0/3 Completed 0 6m21s apply-route-restriction-28067995-jdmwf 0/3 Completed 0 11m apply-route-restriction-28068000-ktpg2 1/3 ErrImagePull 0 81s apply-route-restriction-28068000-q7vmp 0/3 Completed 0 6m22s apply-route-restriction-28068005-tr69x 0/3 Completed 0 82s ste4site-db-ha-5gvs-0 4/4 Running 1 (10d ago) 25d ste4site-db-ha-wfsc-0 4/4 Running 0 25d ste4site-repo1-incr-28067280-26fdv 0/1 Completed 0 12h ste4stie-repo1-incr-28067760-bdcqm 0/1 Completed 0 4h6m ste4site-repo1-incr-28068000-82kw6 0/1 Completed 0 6m22s ste4site-web-app-dev-25-7jwbw 1/1 Running 0 29d ste4site-web-svc-dev-40-trd9h 1/1 Running 0 5d17h ste4site-web-svc-dev-41-deploy 0/1 Error 0 5d18h This is great if you want an overview of the namespace state, but if you’re automating a task or prefer a cleaner look, you can reduce the amount of information in the pod list to something more readable and easier to use in a script....

May 13, 2023 · 2 min

How many time zones are there in British Columbia, Canada?

There are around five million residents in the Canadian province of British Columbia. Most of the population is condensed into the southwestern corner close to the city of Vancouver and the border with Washington State. Vancouver uses the Pacific time zone, but the province has almost a million square kilometres and is so big that other areas use different time zones. How many time zones are there in British Columbia?...

May 13, 2023 · 2 min

Extend Bluetooth range and get USB ports on the front of your monitor

I’ve been crawling under desks to access ports for decades. Many modern monitors incorporate a USB hub, but manufacturers still (inexplicably) put the ports on the underside or back of the screen. I frequently need to temporarily attach USB drives, peripherals, dongles, security keys, and more. How can I make my USB life easier with less desk clutter? The answer comes in the form of mounting tape, a lightweight USB hub, and an extension cable:...

May 13, 2023 · 2 min