1. muuklabs/muuktest@2.0.0

muuklabs/muuktest@2.0.0

Partner
Sections
Easily execute tests from MuukTest on CircleCI integration. Provides jobs for executing on Selenium (using our mkcli python script) or Playwright.
Created: March 23, 2022Version Published: December 14, 2023Releases: 5
Org Usage:
< 25
Categories:

Orb Quick Start Guide

Use CircleCI version 2.1 at the top of your .circleci/config.yml file.

1 version: 2.1

Add the orbs stanza below your version, invoking the orb:

1 2 orbs: muuktest: muuklabs/muuktest@2.0.0

Use muuktest elements in your existing workflows and jobs.

Opt-in to use of uncertified orbs on your organization’s Security settings page.

Usage Examples

mkcli_basic_run

This example runs the test with tag TC0001. Change tag to the right value in order to run any test from your organization. Prerequisites: set an environment variable under your CircleCi project settings with your organization key. Hence use the variable name for the muuk_key parameter, if the name of your variable is MUUK_KEY then you don't need set muuk_key paramter as that variable name is used by default. Please see the following link for reference: https://circleci.com/docs/2.0/env-vars/#setting-an-environment-variable-in-a-project Want to know which is your organization key? No problem, see the next link for reference: https://muuklabs.zendesk.com/hc/en-us/articles/4408400288787-Portal-Account

1 2 3 4 5 6 7 8 9 version: '2.1' orbs: muuktest: muuklabs/muuktest@2.0.0 workflows: execute: jobs: - muuktest/mkcli: muuk_key: MUUK_KEY t: TC0001

mkcli_run_on_firefox

By default, test are run on chrome, this example instead runs the test with tag TC0001 on firefox according to the browser's parameter. Prerequisites: set an environment variable under your CircleCi project settings with your organization key. Hence use the variable name for the muuk_key parameter, if the name of your variable is MUUK_KEY then you don't need set muuk_key paramter as that variable name is used by default. Please see the following link for reference: https://circleci.com/docs/2.0/env-vars/#setting-an-environment-variable-in-a-project Want to know which is your organization key? No problem, see the next link for reference: https://muuklabs.zendesk.com/hc/en-us/articles/4408400288787-Portal-Account

1 2 3 4 5 6 7 8 9 10 version: '2.1' orbs: muuktest: muuklabs/muuktest@2.0.0 workflows: execute: jobs: - muuktest/mkcli: browser: firefox muuk_key: MUUK_KEY t: TC0001

mkcli_run_test_by_hashtag

This example executes all the tests with the hashtag '#deployment' (notice the # char should not be included on the command). Prerequisites: set an environment variable under your CircleCi project settings with your organization key. Hence use the variable name for the muuk_key parameter, if the name of your variable is MUUK_KEY then you don't need set muuk_key paramter as that variable name is used by default. Please see the following link for reference: https://circleci.com/docs/2.0/env-vars/#setting-an-environment-variable-in-a-project Want to know which is your organization key? No problem, see the next link for reference: https://muuklabs.zendesk.com/hc/en-us/articles/4408400288787-Portal-Account

1 2 3 4 5 6 7 8 9 10 11 version: '2.1' orbs: muuktest: muuklabs/muuktest@2.0.0 workflows: execute: jobs: - muuktest/mkcli: browser: firefox muuk_key: MUUK_KEY p: hashtag t: deployment

mkpw_basic_run

This example runs the test with tag TC0001 on Playwright executor. Change tag to the right value in order to run any test from your organization. Prerequisites: set an environment variable under your CircleCi project settings with your organization key. Hence use the variable name for the muuk_key parameter, if the name of your variable is MUUK_KEY then you don't need set muuk_key paramter as that variable name is used by default. Please see the following link for reference: https://circleci.com/docs/2.0/env-vars/#setting-an-environment-variable-in-a-project Want to know which is your organization key? No problem, see the next link for reference: https://muuklabs.zendesk.com/hc/en-us/articles/4408400288787-Portal-Account

1 2 3 4 5 6 7 8 9 version: '2.1' orbs: muuktest: muuklabs/muuktest@2.0.0 workflows: execute: jobs: - muuktest/mkpw: muuk_key: MUUK_KEY t: TC0001

mkpw_test_by_hashtag

This example executes all the tests with the hashtag '#deployment' on Playwright executor (the # char could either be included or not on the value). Prerequisites: set an environment variable under your CircleCi project settings with your organization key. Hence use the variable name for the muuk_key parameter, if the name of your variable is MUUK_KEY then you don't need set muuk_key paramter as that variable name is used by default. Please see the following link for reference: https://circleci.com/docs/2.0/env-vars/#setting-an-environment-variable-in-a-project Want to know which is your organization key? No problem, see the next link for reference: https://muuklabs.zendesk.com/hc/en-us/articles/4408400288787-Portal-Account

1 2 3 4 5 6 7 8 9 10 version: '2.1' orbs: muuktest: muuklabs/muuktest@2.0.0 workflows: execute: jobs: - muuktest/mkpw: muuk_key: MUUK_KEY p: hashtag t: deployment

Jobs

mkcli

MuukTest Selenium executor with Circle CI on Github.

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
browser
Set either from chrome or firefox to run the script on.
No
chrome
enum
muuk_key
Name of the env var with your MuukTest key.pub account value. This var should be set on CircleCi settings.
No
MUUKTEST_KEY
env_var_name
p
Set either tag or hastag according value on t parameter.
No
tag
enum
t
Test case id or hashtag name.
Yes
-
string

mkpw

MuukTest Playwright executor with Circle CI on Github.

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
browser
Set either from chrome or firefox to run the script on.
No
chromium
enum
muuk_key
Name of the env var with your MuukTest key.pub account value. This var should be set on CircleCi settings.
No
MUUKTEST_KEY
env_var_name
p
Set either tag or hastag according value on t parameter.
No
tag
enum
t
Test case id or hashtag name.
Yes
-
string

Orb Source

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 # This code is licensed from CircleCI to the user under the MIT license. # See here for details: https://circleci.com/developer/orbs/licensing version: 2.1 description: | Easily execute tests from MuukTest on CircleCI integration. Provides jobs for executing on Selenium (using our mkcli python script) or Playwright. display: home_url: https://www.muuktest.com source_url: https://github.com/muuklabs/circleci-orb/tree/alpha jobs: mkcli: description: | MuukTest Selenium executor with Circle CI on Github. docker: - environment: GRADLE_OPTS: -Xmx1024m -XX:MaxMetaspaceSize=256m GRADLE_USER_HOME: .gradle-home image: cimg/python:3.7-browsers parameters: browser: default: chrome description: Set either from chrome or firefox to run the script on. enum: - chrome - firefox type: enum muuk_key: default: MUUKTEST_KEY description: Name of the env var with your MuukTest key.pub account value. This var should be set on CircleCi settings. type: env_var_name p: default: tag description: Set either tag or hastag according value on t parameter. enum: - tag - hashtag type: enum t: description: Test case id or hashtag name. type: string resource_class: medium+ steps: - run: command: | MUUKTEST_KEY_INTERNAL=${<< parameters.muuk_key >>} printf "%s" "$MUUKTEST_KEY_INTERNAL" > key.pub cat key.pub name: Init - run: command: |- #!/bin/bash pip install requests pip install Pillow name: Install required libraries - run: command: | #!/bin/bash Xvfb :99 -screen 0 1366x768x16 & DISPLAY=:99 ps -ef | grep Xvfb [ -d "./executor" ] && rm -r executor git clone https://github.com/muuklabs/executor.git mv ./key.pub ./executor cd executor || { echo "Failure: executor directory not found!"; exit 1; } git checkout videoEnabled chmod 755 gradlew chmod 755 key.pub sed -i 's/79.0.3945.36/114.0.5735.90/g' build.gradle sed -i 's/0.23.0/0.33.0/g' build.gradle cat build.gradle name: Get MuukTest executor and run tests - run: command: | cd executor/ python3 mkcli.py -p << parameters.p >> -t << parameters.t >> -browser << parameters.browser >> name: Execute E2E tests and report results to MuukTest mkpw: description: | MuukTest Playwright executor with Circle CI on Github. docker: - environment: MUUKTEST_BROWSER: << parameters.browser >> MUUKTEST_TAG_PROPERTY: << parameters.p >> MUUKTEST_TAG_VALUE: << parameters.t >> image: cimg/node:20.9 parameters: browser: default: chromium description: Set either from chrome or firefox to run the script on. enum: - chromium - firefox type: enum muuk_key: default: MUUKTEST_KEY description: Name of the env var with your MuukTest key.pub account value. This var should be set on CircleCi settings. type: env_var_name p: default: tag description: Set either tag or hastag according value on t parameter. enum: - tag - hashtag type: enum t: description: Test case id or hashtag name. type: string steps: - run: command: | mkdir -p executor cd executor MUUKTEST_KEY_INTERNAL=${<< parameters.muuk_key >>} printf '{ "key": "%s"}' "$MUUKTEST_KEY_INTERNAL" > file.json cat file.json name: Init - run: command: sudo apt-get update && sudo apt-get install -y unzip name: Installing libraries dependencies - run: command: | #!/bin/bash cd executor || { echo "Failure: executor directory not found!"; exit 1; } curl -H "Content-Type: application/json" -X POST -d @file.json 'https://portal.muuktest.com:8081/generate_token_executer' -o "token.json" curl -X POST https://portal.muuktest.com:8081/api/v1/downloadpwfiles -k -d @file.json -H "Content-Type: application/json" -o ./config.zip unzip -o config.zip -d . MUUK1_TOKEN=$(jq --raw-output .token token.json) printf "Authorization: Bearer %s" "$MUUK1_TOKEN" > header.txt MUUK_USERID_TOKEN=$(jq --raw-output .userId token.json) FIXED_TAG_VALUE=$MUUKTEST_TAG_VALUE [[ $FIXED_TAG_VALUE != "#"* ]] && FIXED_TAG_VALUE="#$FIXED_TAG_VALUE" printf '{"property": "%s", "value": ["%s"], "platform": "pw", "userId": "%s"}' "$MUUKTEST_TAG_PROPERTY" "$FIXED_TAG_VALUE" "$MUUK_USERID_TOKEN" > body.json curl -X POST https://portal.muuktest.com:8081/download_byproperty -H @header.txt -d @body.json -H "Content-Type: application/json" -o ./test.zip [ -d "./test" ] && rm -r test unzip -o test.zip -d ./test ls -l name: Retrieve MuukTest config files and Test scripts - run: command: |- #!/bin/bash cd executor || { echo "Failure: executor directory not found!"; exit 1; } npm install -D @playwright/test npx playwright install --with-deps "$MUUKTEST_BROWSER" npm install axios npm install archiver npm install cheerio npm install xpath npm install @xmldom/xmldom npm install @faker-js/faker name: Installing PW and required packages - run: command: | cd executor || { echo "Failure: executor directory not found!"; exit 1; } npx playwright test --workers=3 --project=$MUUKTEST_BROWSER name: Execute MuukTest E2E examples: mkcli_basic_run: description: | This example runs the test with tag TC0001. Change tag to the right value in order to run any test from your organization. Prerequisites: set an environment variable under your CircleCi project settings with your organization key. Hence use the variable name for the muuk_key parameter, if the name of your variable is MUUK_KEY then you don't need set muuk_key paramter as that variable name is used by default. Please see the following link for reference: https://circleci.com/docs/2.0/env-vars/#setting-an-environment-variable-in-a-project Want to know which is your organization key? No problem, see the next link for reference: https://muuklabs.zendesk.com/hc/en-us/articles/4408400288787-Portal-Account usage: version: "2.1" orbs: muuktest: muuklabs/muuktest@2.0.0 workflows: execute: jobs: - muuktest/mkcli: muuk_key: MUUK_KEY t: TC0001 mkcli_run_on_firefox: description: | By default, test are run on chrome, this example instead runs the test with tag TC0001 on firefox according to the browser's parameter. Prerequisites: set an environment variable under your CircleCi project settings with your organization key. Hence use the variable name for the muuk_key parameter, if the name of your variable is MUUK_KEY then you don't need set muuk_key paramter as that variable name is used by default. Please see the following link for reference: https://circleci.com/docs/2.0/env-vars/#setting-an-environment-variable-in-a-project Want to know which is your organization key? No problem, see the next link for reference: https://muuklabs.zendesk.com/hc/en-us/articles/4408400288787-Portal-Account usage: version: "2.1" orbs: muuktest: muuklabs/muuktest@2.0.0 workflows: execute: jobs: - muuktest/mkcli: browser: firefox muuk_key: MUUK_KEY t: TC0001 mkcli_run_test_by_hashtag: description: | This example executes all the tests with the hashtag '#deployment' (notice the # char should not be included on the command). Prerequisites: set an environment variable under your CircleCi project settings with your organization key. Hence use the variable name for the muuk_key parameter, if the name of your variable is MUUK_KEY then you don't need set muuk_key paramter as that variable name is used by default. Please see the following link for reference: https://circleci.com/docs/2.0/env-vars/#setting-an-environment-variable-in-a-project Want to know which is your organization key? No problem, see the next link for reference: https://muuklabs.zendesk.com/hc/en-us/articles/4408400288787-Portal-Account usage: version: "2.1" orbs: muuktest: muuklabs/muuktest@2.0.0 workflows: execute: jobs: - muuktest/mkcli: browser: firefox muuk_key: MUUK_KEY p: hashtag t: deployment mkpw_basic_run: description: | This example runs the test with tag TC0001 on Playwright executor. Change tag to the right value in order to run any test from your organization. Prerequisites: set an environment variable under your CircleCi project settings with your organization key. Hence use the variable name for the muuk_key parameter, if the name of your variable is MUUK_KEY then you don't need set muuk_key paramter as that variable name is used by default. Please see the following link for reference: https://circleci.com/docs/2.0/env-vars/#setting-an-environment-variable-in-a-project Want to know which is your organization key? No problem, see the next link for reference: https://muuklabs.zendesk.com/hc/en-us/articles/4408400288787-Portal-Account usage: version: "2.1" orbs: muuktest: muuklabs/muuktest@2.0.0 workflows: execute: jobs: - muuktest/mkpw: muuk_key: MUUK_KEY t: TC0001 mkpw_test_by_hashtag: description: | This example executes all the tests with the hashtag '#deployment' on Playwright executor (the # char could either be included or not on the value). Prerequisites: set an environment variable under your CircleCi project settings with your organization key. Hence use the variable name for the muuk_key parameter, if the name of your variable is MUUK_KEY then you don't need set muuk_key paramter as that variable name is used by default. Please see the following link for reference: https://circleci.com/docs/2.0/env-vars/#setting-an-environment-variable-in-a-project Want to know which is your organization key? No problem, see the next link for reference: https://muuklabs.zendesk.com/hc/en-us/articles/4408400288787-Portal-Account usage: version: "2.1" orbs: muuktest: muuklabs/muuktest@2.0.0 workflows: execute: jobs: - muuktest/mkpw: muuk_key: MUUK_KEY p: hashtag t: deployment
Developer Updates
Get tips to optimize your builds
Or join our research panel and give feedback
By submitting this form, you are agreeing to ourTerms of UseandPrivacy Policy.