{"id":22362913,"url":"https://github.com/lambdatest/protractor-hyperexecute-sample","last_synced_at":"2025-09-10T04:35:07.312Z","repository":{"id":39746805,"uuid":"472364140","full_name":"LambdaTest/Protractor-HyperExecute-Sample","owner":"LambdaTest","description":"Demonstration of Protractor Selenium testing on HyperExecute Grid","archived":false,"fork":false,"pushed_at":"2024-02-02T11:08:32.000Z","size":366,"stargazers_count":7,"open_issues_count":0,"forks_count":8,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-02-02T12:25:40.417Z","etag":null,"topics":["cross-browser","cross-platform","hyperexecute","hypertest","javascript","lambdatest","protractor","selenium-javascript","selenium-webdriver"],"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":"mit","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":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-03-21T14:03:50.000Z","updated_at":"2023-01-08T21:48:58.000Z","dependencies_parsed_at":"2023-11-21T20:47:25.861Z","dependency_job_id":null,"html_url":"https://github.com/LambdaTest/Protractor-HyperExecute-Sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LambdaTest%2FProtractor-HyperExecute-Sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LambdaTest%2FProtractor-HyperExecute-Sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LambdaTest%2FProtractor-HyperExecute-Sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LambdaTest%2FProtractor-HyperExecute-Sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LambdaTest","download_url":"https://codeload.github.com/LambdaTest/Protractor-HyperExecute-Sample/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228154024,"owners_count":17877704,"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":["cross-browser","cross-platform","hyperexecute","hypertest","javascript","lambdatest","protractor","selenium-javascript","selenium-webdriver"],"created_at":"2024-12-04T17:12:33.444Z","updated_at":"2024-12-04T17:12:34.255Z","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 Selenium 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=protractor)\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=Protractor)\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 Selenium automation tests on HyperExecute (using protractor 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 protractor](#auto-split-execution-with-protractor)\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 protractor](#matrix-execution-with-protractor)\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 Protractor tests on Windows and Linux platforms](#run-protractor-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 features 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 Protractor\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 (*HyperExecute-Yaml\\.hyperexecuteStatic.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 Feature file scenario that would be further executed using the *value* passed in the *testRunnerCommand*\n\n```yaml\ntestDiscovery:\n  type: raw\n  mode: static\n  command: grep -nri 'describe' specs -ir --include=\\*.js | sed 's/:.*//'\n\ntestRunnerCommand: protractor conf/single.conf.js --specs=$test --browser=chrome\n```\n\nRunning the above command on the terminal will give a list of Feature Scenario lines that are located in the Project folder:\n\nTest Discovery Output:\nspecs/fileupload.js\nspecs/single.js\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: protractor conf/single.conf.js --specs=$test --browser=chrome\n```\n![image](https://user-images.githubusercontent.com/47247309/160448577-cecd6f22-d5a7-49f3-9166-8f239fe133fc.png)\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  - name: Reports\n    path:\n      - ProtractorTestReport.html\n      - xmlresults.xml\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. *.hyperExecute_autoSplit.yaml*). Run the following command on the terminal to trigger the tests in Python 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 -i .hyperexecute_autoSplit.yaml\n```\n\nVisit [HyperExecute Automation Dashboard](https://automation.lambdatest.com/hyperexecute) to check the status of execution\n\n# Matrix Execution with Protractor\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 (*hyperExecute_matrix.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\nProtractor Spec files in the contain the Test Scenario run on the HyperExecute grid. In the example, the Test file *specs/fileupload.js* run in parallel on the basis of scenario by using the specified input combinations.\n\n```yaml\nmatrix:\n  os: [linux]\n  browser: [\"chrome\",\"firefox\",\"edge\"]\n  Specs: [\"specs/fileupload.js\",\"specs/single.js\"]\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 *spec* files. The tags are mentioned as an array to the *tags* key that is a part of the matrix.\n\n```yaml\ntestSuites:\n  - protractor conf/single.conf.js --specs=$Specs --browser=$browser\n```\n![image](https://user-images.githubusercontent.com/47247309/160449629-19886b8b-c07e-448f-9bc8-09a350d5b53e.png)\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 -g protractor\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  - name: Reports\n    path:\n      - ProtractorTestReport.html\n      - xmlresults.xml\n```\n![image](https://user-images.githubusercontent.com/47247309/160449743-ab99951d-dba9-49da-9347-85c19ec4ede9.png)\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. *hyperExecute_Matrix.yaml*). Run the following command on the terminal to trigger the tests in Feature file Scenario on the HyperExecute grid.\n\n```bash\n./hyperexecute --config --verbose -i .hyperExecute_matrix.yaml\n```\n![image](https://user-images.githubusercontent.com/47247309/160449910-99361d98-f2e9-47d7-b3a0-a4fbc81e9557.png)\n\n\nVisit [HyperExecute Automation Dashboard](https://automation.lambdatest.com/hyperexecute) to check the status of execution:\n\n## Run Protractor tests on Windows and Linux platforms\n\nThe CLI option *--config* is used for providing the custom HyperExecute YAML file (i.e. *yaml/.hyperexecute_simple_win.yaml* for Windows and *yaml/.hyperexecute_simple_linux.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/.hyperexecute_simple_win.yaml\n```\n\nRun the following command on the terminal to trigger tests on Linux platform:\n\n```bash\n./hyperexecute --config --verbose yaml/.hyperexecute_simple_linux.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  LT_ACCESS_KEY: ${{.secrets.LT_ACCESS_KEY}}\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 Selenium 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## LambdaTest Community :busts_in_silhouette:\n\nThe [LambdaTest Community](https://community.lambdatest.com/) allows people to interact with tech enthusiasts. Connect, ask questions, and learn from tech-savvy people. Discuss best practises in web development, testing, and DevOps with professionals from across the globe.\n\n## Documentation \u0026 Resources :books:\n   \nIf you want to learn more about the LambdaTest's features, setup, and usage, visit the [LambdaTest documentation](https://www.lambdatest.com/support/docs/). You can also find in-depth tutorials around test automation, mobile app testing, responsive testing, manual testing on [LambdaTest Blog](https://www.lambdatest.com/blog/) and [LambdaTest Learning Hub](https://www.lambdatest.com/learning-hub/).     \n      \n ## About LambdaTest\n\n[LambdaTest](https://www.lambdatest.com) is a leading test execution and orchestration platform that is fast, reliable, scalable, and secure. It allows users to run both manual and automated testing of web and mobile apps across 3000+ different browsers, operating systems, and real device combinations. Using LambdaTest, businesses can ensure quicker developer feedback and hence achieve faster go to market. Over 500 enterprises and 1 Million + users across 130+ countries rely on LambdaTest for their testing needs.\n\n[\u003cimg height=\"70\" src=\"https://user-images.githubusercontent.com/70570645/169649126-ed61f6de-49b5-4593-80cf-3391ca40d665.PNG\"\u003e](https://accounts.lambdatest.com/register)\n      \n## We are here to help you :headphones:\n\n* Got a query? we are available 24x7 to help. [Contact Us](mailto:support@lambdatest.com)\n* For more info, visit - https://www.lambdatest.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flambdatest%2Fprotractor-hyperexecute-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flambdatest%2Fprotractor-hyperexecute-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flambdatest%2Fprotractor-hyperexecute-sample/lists"}