{"id":23660562,"url":"https://github.com/liamseck/k6-wpe-woocommerce","last_synced_at":"2026-04-27T18:32:22.639Z","repository":{"id":261461275,"uuid":"865893292","full_name":"LiamSeck/k6-wpe-woocommerce","owner":"LiamSeck","description":"K6 Script Loadtesting a WooCommerce Deployment on WPE","archived":false,"fork":false,"pushed_at":"2024-11-06T16:51:10.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-16T05:44:53.524Z","etag":null,"topics":["k6","woocommerce","wordpress"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LiamSeck.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-01T10:04:15.000Z","updated_at":"2025-01-09T16:02:13.000Z","dependencies_parsed_at":"2024-11-06T17:48:37.852Z","dependency_job_id":"7d745ccc-6e46-45ef-b3e3-3193eb68b8dc","html_url":"https://github.com/LiamSeck/k6-wpe-woocommerce","commit_stats":null,"previous_names":["liamseck/k6-wpe-woocommerce"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LiamSeck/k6-wpe-woocommerce","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiamSeck%2Fk6-wpe-woocommerce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiamSeck%2Fk6-wpe-woocommerce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiamSeck%2Fk6-wpe-woocommerce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiamSeck%2Fk6-wpe-woocommerce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LiamSeck","download_url":"https://codeload.github.com/LiamSeck/k6-wpe-woocommerce/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiamSeck%2Fk6-wpe-woocommerce/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32349476,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T17:12:42.749Z","status":"ssl_error","status_checked_at":"2026-04-27T17:12:41.658Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["k6","woocommerce","wordpress"],"created_at":"2024-12-29T03:58:15.057Z","updated_at":"2026-04-27T18:32:22.617Z","avatar_url":"https://github.com/LiamSeck.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![k6](https://img.shields.io/badge/k6-7D64FF.svg?style=for-the-badge\u0026logo=k6\u0026logoColor=white)](https://github.com/grafana/k6)![JavaScript](https://img.shields.io/badge/JavaScript-F7DF1E.svg?style=for-the-badge\u0026logo=JavaScript\u0026logoColor=black)\n\n# K6 eCommerce Demo Scripts\n\n## Overview\n\nThis repo contains some example K6 scripts for interacting with a basic WooCommerce website hosted at https://liamseprod.wpenginepowered.com/. \n\nThis repo has been cloned and adapted from from the official K6 WooCommerce example located at https://github.com/grafana/k6-example-woocommerce/ \n\n\n## Introduction\n\nThe scripts have been modularized so that each distinct \"user action\" manifests as its own source file, intended to be used from the entry script, in this case `main.js`. Doing so promotes code reuse and maintainability, as well as catering for some degree of flexibility over the order in which the scripts should run. Obviously, products need to have been added to the cart before checkout can be completed successfully, so there is some sequence that needs to be maintained for them to work as expected.\n\n## Usage\n\nPlease note that the server hosting the site is not scaled for heavy loads; the scripts are being provided as working examples. Only run them if you want to see what kind of feedback k6 provides when they are run as part of a test with low numbers of VUs.\n\n1. Install [k6](https://k6.io) (instructions [here](https://k6.io/docs/getting-started/installation/))\n2. Clone the repo\n3. Navigate to the directory and `k6 run main.js` (make sure k6 is on your PATH)\n4. Run `k6 run -e HOSTNAME=domain.com  main.js` to change the base URL of the site you are looking to test against (assumes a default WooCommerce installation with default paths)\n\n## Contents\n\nThe scripts, and their suggested order, are as follows:\n\n`main.js`\n\nThe entry script, where k6 `options` would be set, and the script called as part of `k6 run` (see Usage below). Its `export default function` determines what the VUs will run.\n\n`utils.js`\n\nThis utility script contains a single exported function `checkStatus` that can be used to verify HTTP status codes. Should the received status code be different from the expected one, a couple of booleans determine whether to print the `Response.body` (if available) and whether to `fail` (skip) the rest of the iteration.\n\n`navigateHomepage.js`\n\nNaturally the first script to be executed. As the homepage also lists the available products on the site, it is also where these are extracted from the response, with a product selected at random and stored in `globalThis.vars[\"selectedProduct\"]`.\n\n`addToCart.js`\n\nUses (and depends on) the randomly-selected product extracted in `navigateHomepage.js`. An enhancement here might be to make all products available to it (perhaps as input data via the function parameters), such that mutiple products can be added instead of just a single one.\n\n`navigateToCart.js`\n\nThe equivalent of the user clicking \"View Cart\".\n\n`navigateToCheckout.js`\n\nAside from proceeding to checkout, there are also two dynamic values that need to be extracted from the response and used in the subsequent checkout itself.\n\n`updateAddress.js`\n\nThis script represents an AJAX call that takes place when the user enters their address prior to checkout.\n\n`submitCheckout.js`\n\nThe final checkout of the cart. A `result: \"success\"` JSON value is expected in the response, and so a `check` ensures that is the case. The JSON is also expected to contain a `redirectUrl` that takes the user to the confirmation page.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliamseck%2Fk6-wpe-woocommerce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliamseck%2Fk6-wpe-woocommerce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliamseck%2Fk6-wpe-woocommerce/lists"}