{"id":22362903,"url":"https://github.com/lambdatest/hyperexecute-playwright-vanilla-javascript","last_synced_at":"2025-06-15T07:03:31.954Z","repository":{"id":55134123,"uuid":"493606812","full_name":"LambdaTest/HyperExecute-Playwright-Vanilla-Javascript","owner":"LambdaTest","description":"Demonstration of Playwright Javascript testing on HyperExecute Grid","archived":false,"fork":false,"pushed_at":"2024-12-09T12:41:39.000Z","size":224,"stargazers_count":3,"open_issues_count":0,"forks_count":26,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-06T10:11:13.549Z","etag":null,"topics":["automation-playwright","cdp","cross-browser-testing","hyperexecute","javascript","lambdatest","playwright-javascript","playwright-tests"],"latest_commit_sha":null,"homepage":"https://www.lambdatest.com/hyperexecute","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/LambdaTest.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}},"created_at":"2022-05-18T10:01:32.000Z","updated_at":"2025-03-16T13:45:44.000Z","dependencies_parsed_at":"2024-03-01T17:45:07.826Z","dependency_job_id":null,"html_url":"https://github.com/LambdaTest/HyperExecute-Playwright-Vanilla-Javascript","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LambdaTest/HyperExecute-Playwright-Vanilla-Javascript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LambdaTest%2FHyperExecute-Playwright-Vanilla-Javascript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LambdaTest%2FHyperExecute-Playwright-Vanilla-Javascript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LambdaTest%2FHyperExecute-Playwright-Vanilla-Javascript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LambdaTest%2FHyperExecute-Playwright-Vanilla-Javascript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LambdaTest","download_url":"https://codeload.github.com/LambdaTest/HyperExecute-Playwright-Vanilla-Javascript/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LambdaTest%2FHyperExecute-Playwright-Vanilla-Javascript/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259935588,"owners_count":22934384,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["automation-playwright","cdp","cross-browser-testing","hyperexecute","javascript","lambdatest","playwright-javascript","playwright-tests"],"created_at":"2024-12-04T17:12:29.252Z","updated_at":"2025-06-15T07:03:31.938Z","avatar_url":"https://github.com/LambdaTest.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg height=\"100\" alt=\"hyperexecute_logo\" src=\"https://user-images.githubusercontent.com/1688653/159473714-384e60ba-d830-435e-a33f-730df3c3ebc6.png\"\u003e\n\nHyperExecute is a smart test orchestration platform to run end-to-end Playwright tests at the fastest speed possible. HyperExecute lets you achieve an accelerated time to market by providing a test infrastructure that offers optimal speed, test orchestration, and detailed execution logs.\n\nThe overall experience helps teams test code and fix issues at a much faster pace. HyperExecute is configured using a YAML file. Instead of moving the Hub close to you, HyperExecute brings the test scripts close to the Hub!\n\n* \u003cb\u003eHyperExecute HomePage\u003c/b\u003e: https://www.lambdatest.com/hyperexecute\n* \u003cb\u003eLambdatest HomePage\u003c/b\u003e: https://www.lambdatest.com\n* \u003cb\u003eLambdaTest Support\u003c/b\u003e: [support@lambdatest.com](mailto:support@lambdatest.com)\n\nTo know more about how HyperExecute does intelligent Test Orchestration, do check out [HyperExecute Getting Started Guide](https://www.lambdatest.com/support/docs/getting-started-with-hyperexecute/)\n\n[\u003cimg alt=\"Try it now\" width=\"200 px\" align=\"center\" src=\"images/Try it Now.svg\" /\u003e](https://hyperexecute.lambdatest.com/?utm_source=github\u0026utm_medium=repository\u0026utm_content=javascript\u0026utm_term=webdriver)\n\n## Gitpod\n\nFollow the below steps to run Gitpod button:\n\n1. Click '**Open in Gitpod**' button (You will be redirected to Login/Signup page).\n2. Login with Lambdatest credentials and it will be redirected to Gitpod editor in new tab and current tab will show hyperexecute dashboard.\n\n[\u003cimg alt=\"Run in Gitpod\" width=\"200 px\" align=\"center\" src=\"images/Gitpod.svg\" /\u003e](https://hyperexecute.lambdatest.com/hyperexecute/jobs?type=gitpod\u0026framework=VanillaJS\u0026frameworkType=PlayWright)\n---\n\u003c!---If logged in, it will be redirected to Gitpod editor in new tab where current tab will show hyperexecute dashboard.\n\nIf not logged in, it will be redirected to Login/Signup page and simultaneously redirected to Gitpod editor in a new tab where current tab will show hyperexecute dashboard.\n\nIf not signed up, you need to sign up and simultaneously redirected to Gitpod in a new tab where current tab will show hyperexecute dashboard.---\u003e\n\n# How to run Playwright automation tests on HyperExecute (using Playwright-JS framework)\n\n* [Pre-requisites](#pre-requisites)\n   - [Download HyperExecute CLI](#download-hyperexecute-cli)\n   - [Configure Environment Variables](#configure-environment-variables)\n\n* [Auto-Split Execution with Playwright-JS](#auto-split-execution-with-Playwright-JS)\n   - [Core](#core)\n   - [Pre Steps and Dependency Caching](#pre-steps-and-dependency-caching)\n   - [Artifacts Management](#artifacts-management)\n   - [Test Execution](#test-execution)\n\n* [Matrix Execution with Playwright-JS](#matrix-execution-with-Playwright-JS)\n   - [Core](#core-1)\n   - [Pre Steps and Dependency Caching](#pre-steps-and-dependency-caching-1)\n   - [Artifacts Management](#artifacts-management-1)\n   - [Test Execution](#test-execution-1)\n\n* [Run Playwright-JS tests on Windows and Linux platforms](#run-Playwright-JS-tests-on-windows-and-linux-platforms)\n* [Secrets Management](#secrets-management)\n* [Navigation in Automation Dashboard](#navigation-in-automation-dashboard)\n\n# Pre-requisites\n\nBefore using HyperExecute, you have to download HyperExecute CLI corresponding to the host OS. Along with it, you also need to export the environment variables *LT_USERNAME* and *LT_ACCESS_KEY* that are available in the [LambdaTest Profile](https://accounts.lambdatest.com/detail/profile) page.\n\n## Download HyperExecute CLI\n\nHyperExecute CLI is the CLI for interacting and running the tests on the HyperExecute Grid. The CLI provides a host of other useful Tests that accelerate test execution. In order to trigger tests using the CLI, you need to download the HyperExecute CLI binary corresponding to the platform (or OS) from where the tests are triggered:\n\nAlso, it is recommended to download the binary in the project's parent directory. Shown below is the location from where you can download the HyperExecute CLI binary:\n\n* Mac: https://downloads.lambdatest.com/hyperexecute/darwin/hyperexecute\n* Linux: https://downloads.lambdatest.com/hyperexecute/linux/hyperexecute\n* Windows: https://downloads.lambdatest.com/hyperexecute/windows/hyperexecute.exe\n\n## Configure Environment Variables\n\nBefore the tests are run, please set the environment variables LT_USERNAME \u0026 LT_ACCESS_KEY from the terminal. The account details are available on your [LambdaTest Profile](https://accounts.lambdatest.com/detail/profile) page.\n\nFor macOS:\n\n```bash\nexport LT_USERNAME=LT_USERNAME\nexport LT_ACCESS_KEY=LT_ACCESS_KEY\n```\n\nFor Linux:\n\n```bash\nexport LT_USERNAME=LT_USERNAME\nexport LT_ACCESS_KEY=LT_ACCESS_KEY\n```\n\nFor Windows:\n\n```bash\nset LT_USERNAME=LT_USERNAME\nset LT_ACCESS_KEY=LT_ACCESS_KEY\n```\n\n## Auto-Split Execution with Playwright-JS\n\nAuto-split execution mechanism lets you run tests at predefined concurrency and distribute the tests over the available infrastructure. Concurrency can be achieved at different levels - file, module, test suite, test, scenario, etc.\n\nFor more information about auto-split execution, check out the [Auto-Split Getting Started Guide](https://www.lambdatest.com/support/docs/getting-started-with-hyperexecute/#smart-auto-test-splitting)\n\n### Core\n\nAuto-split YAML file (*yaml/win/.hyperexecute_autosplits.yaml*) in the repo contains the following configuration:\n\n```yaml\nglobalTimeout: 90\ntestSuiteTimeout: 90\ntestSuiteStep: 90\n```\n\nGlobal timeout, testSuite timeout, and testSuite timeout are set to 90 minutes.\n \nThe *runson* key determines the platform (or operating system) on which the tests are executed. Here we have set the target OS as Windows.\n\n```yaml\nrunson: win\n```\n\nAuto-split is set to true in the YAML file.\n\n```yaml\n autosplit: true\n```\n\n*retryOnFailure* is set to true, instructing HyperExecute to retry failed command(s). The retry operation is carried out till the number of retries mentioned in *maxRetries* are exhausted or the command execution results in a *Pass*. In addition, the concurrency (i.e. number of parallel sessions) is set to 2.\n\n```yaml\nretryOnFailure: true\nrunson: win\nmaxRetries: 2\n```\n\n## Pre Steps and Dependency Caching\n\nTo leverage the advantage offered by *Dependency Caching* in HyperExecute, the integrity of *package-lock.json* is checked using the checksum functionality.\n\n```yaml\ncacheKey: '{{ checksum \"package-lock.json\" }}'\n```\n\nThe caching advantage offered by *NPM* can be leveraged in HyperExecute, whereby the downloaded packages can be stored (or cached) in a secure server for future executions. The packages available in the cache will only be used if the checksum stage results in a Pass.\n\n\n\n```yaml\ncacheDirectories:\n  - node_modules\n```\n\nThe *testDiscovery* directive contains the command that gives details of the mode of execution, along with detailing the command that is used for test execution. Here, we are fetching the list of Test file scenario that would be further executed using the *value* passed in the *testRunnerCommand*\n\n```yaml\ntestDiscovery:\n  type: raw\n  mode: dynamic\n  command: grep -nri 'describe' tests  | sed 's/:test.*//'\ntestRunnerCommand: npx playwright test $test\n```\n\nRunning the above command on the terminal will give a list of Test Scenario lines that are located in the Project folder:\n\nTest Discovery Output:\ntests/test_4.spec.js:4\ntests/test_3.spec.js:4\ntests/test_2.spec.js:4\ntests/test_1.spec.js:4\n\nThe *testRunnerCommand* contains the command that is used for triggering the test. The output fetched from the *testDiscoverer* command acts as an input to the *testRunner* command.\n\n```yaml\ntestRunnerCommand: npx playwright test $test\n```\n\n\n### Artifacts Management\n\nThe *mergeArtifacts* directive (which is by default *false*) is set to *true* for merging the artifacts and combing artifacts generated under each task.\n\nThe *uploadArtefacts* directive informs HyperExecute to upload artifacts [files, reports, etc.] generated after task completion.  In the example, *path* consists of a regex for parsing the directory (i.e. *reports* that contains the test reports).\n\n```yaml\nmergeArtifacts: true\n\nuploadArtefacts:\n  [{\n    \"name\": \"Reports\",\n    \"path\": [\"Reports\\\\\"]\n  }]\n\n```\nHyperExecute also facilitates the provision to download the artifacts on your local machine. To download the artifacts, click on *Artifacts* button corresponding to the associated TestID.\n\n### Test Execution\n\nThe CLI option *--config* is used for providing the custom HyperExecute YAML file (i.e. *yaml/.hyperexecute_autosplits.yaml*). Run the following command on the terminal to trigger the tests in JS files on the HyperExecute grid. The *--download-artifacts* option is used to inform HyperExecute to download the artifacts for the job.\n\n```bash\n./hyperexecute --config --verbose yaml/win/.hyperexecute_autosplits.yaml\n```\n\nVisit [HyperExecute Automation Dashboard](https://automation.lambdatest.com/hyperexecute) to check the status of execution\n\n# Matrix Execution with Playwright-JS\n\nMatrix-based test execution is used for running the same tests across different test (or input) combinations. The Matrix directive in HyperExecute YAML file is a *key:value* pair where value is an array of strings.\n\nAlso, the *key:value* pairs are opaque strings for HyperExecute. For more information about matrix multiplexing, check out the [Matrix Getting Started Guide](https://www.lambdatest.com/support/docs/getting-started-with-hyperexecute/#matrix-based-build-multiplexing)\n\n### Core\n\nIn the current example, matrix YAML file (*yaml/hyperexecute_matrix_sample.yaml*) in the repo contains the following configuration:\n\n```yaml\nglobalTimeout: 90\ntestSuiteTimeout: 90\ntestSuiteStep: 90\n```\n\nGlobal timeout, testSuite timeout, and testSuite timeout are set to 90 minutes.\n \nThe target platform is set to Windows. Please set the *[runson]* key to *[mac]* if the tests have to be executed on the macOS platform.\n\n```yaml\nrunson: win\n```\n\nPlaywright-JS js files in the 'Tests' folder contain the Test Scenario run on the HyperExecute grid. In the example, the Test file *tests/test_4.spec.js* run in parallel on the basis of scenario by using the specified input combinations.\n\n```yaml\nmatrix:\n  os: [linux]\n  methods: ['tests/test_4.spec.js:4','tests/test_3.spec.js:4','tests/test_2.spec.js:4','tests/test_1.spec.js:4']\n\n```\n\nThe *testSuites* object contains a list of commands (that can be presented in an array). In the current YAML file, commands for executing the tests are put in an array (with a '-' preceding each item). The npx command is used to run tests in *.js* files. The tags are mentioned as an array to the *methods* key that is a part of the matrix.\n\n```yaml\ntestSuites:\n  - npx playwright test $methods\n```\n\n### Pre Steps and Dependency Caching\n\nDependency caching is enabled in the YAML file to ensure that the package dependencies are not downloaded in subsequent runs. The first step is to set the Key used to cache directories.\n\n```yaml\ncacheKey: '{{ checksum \"package-lock.json\" }}'\n```\n\nSet the array of files \u0026 directories to be cached. In the example, all the packages will be cached in the *CacheDir* directory.\n\n```yaml\ncacheDirectories:\n  - node_modules\n```\n\nSteps (or commands) that must run before the test execution are listed in the *pre* run step. In the example, the packages listed in *requirements.txt* are installed using the *npm install* command.\n\n```yaml\npre:\n  - npm install\n```\n\n### Artifacts Management\n\nThe *mergeArtifacts* directive (which is by default *false*) is set to *true* for merging the artifacts and combing artifacts generated under each task.\n\nThe *uploadArtefacts* directive informs HyperExecute to upload artifacts [files, reports, etc.] generated after task completion. In the example, *path* consists of a regex for parsing the directory (i.e. *reports* that contains the test reports).\n\n```yaml\nmergeArtifacts: true\n\nuploadArtefacts:\n  [{\n    \"name\": \"Reports\",\n    \"path\": [\"Reports\\\\\"]\n  }]\n```\n\nHyperExecute also facilitates the provision to download the artifacts on your local machine. To download the artifacts, click on Artifacts button corresponding to the associated TestID.\n\n\n## Test Execution\n\nThe CLI option *--config* is used for providing the custom HyperExecute YAML file (i.e. *yaml/win/.hyperexecute_matrix.yaml*). Run the following command on the terminal to trigger the tests in Test file Scenario on the HyperExecute grid.\n\n```bash\n./hyperexecute --config --verbose yaml/win/.hyperexecute_matrix.yaml\n```\n\nVisit [HyperExecute Automation Dashboard](https://automation.lambdatest.com/hyperexecute) to check the status of execution:\n\n## Run Playwright-JS tests on Windows and Linux platforms\n\nThe CLI option *--config* is used for providing the custom HyperExecute YAML file (i.e. *yaml/win/.hyperexecute_autosplits.yaml* for Windows and *yaml/linux/.hyperexecute_autosplits.yaml* for Linux).\n\nRun the following command on the terminal to trigger tests on Windows platform:\n\n```bash\n./hyperexecute --config --verbose yaml/win/.hyperexecute_autosplits.yaml\n```\n\nRun the following command on the terminal to trigger tests on Linux platform:\n\n```bash\n./hyperexecute --config --verbose yaml/win/.hyperexecute_autosplits.yaml\n```\n\n## Secrets Management\n\nIn case you want to use any secret keys in the YAML file, the same can be set by clicking on the *Secrets* button the dashboard.\n\n\nAll you need to do is create an environment variable that uses the secret key:\n\n```yaml\nenv:\n  AccessKey: ${{.secrets.AccessKey}}\n```\n\n## Navigation in Automation Dashboard\n\nHyperExecute lets you navigate from/to *Test Logs* in Automation Dashboard from/to *HyperExecute Logs*. You also get relevant get relevant Playwright test details like video, network log, commands, Exceptions \u0026 more in the Dashboard. Effortlessly navigate from the automation dashboard to HyperExecute logs (and vice-versa) to get more details of the test execution.\n\n\n## We are here to help you :)\n* LambdaTest Support: [support@lambdatest.com](mailto:support@lambdatest.com)\n* HyperExecute HomePage: https://www.lambdatest.com/support/docs/getting-started-with-hyperexecute/\n* Lambdatest HomePage: https://www.lambdatest.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flambdatest%2Fhyperexecute-playwright-vanilla-javascript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flambdatest%2Fhyperexecute-playwright-vanilla-javascript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flambdatest%2Fhyperexecute-playwright-vanilla-javascript/lists"}