-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from muuklabs/pw-suport-and-selenium-refactor
[semver:major] Introduce mkpw job and refactor mkcli job
- Loading branch information
Showing
15 changed files
with
219 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
version: 2.1 | ||
|
||
description: | | ||
MuukTest is a codeless test automation platform designed to make software testing 20x faster, since first day. | ||
MuukTest CircleCI Orb provides a simple configuration to enable test execution from your muuktest.com organization within your CircleCI CI/CD process, easily. | ||
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" | ||
source_url: "https://github.com/muuklabs/circleci-orb/tree/alpha" |
5 changes: 3 additions & 2 deletions
5
src/examples/basic_run.yml → src/examples/mkcli_basic_run.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
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 muuk_key environment variable under your CircleCi project settings with your organization key. | ||
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@1.0.1 | ||
muuktest: muuklabs/muuktest@2.0.0 | ||
workflows: | ||
execute: | ||
jobs: | ||
- muuktest/mkcli: | ||
t: TC0001 | ||
muuk_key: MUUK_KEY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
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: | ||
t: TC0001 | ||
browser: firefox | ||
muuk_key: MUUK_KEY |
5 changes: 3 additions & 2 deletions
5
src/examples/run_test_by_hashtag.yml → src/examples/mkcli_run_test_by_hashtag.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
description: | | ||
This example executes all the tests with the hashtag '#deployment' (notice the # char should not be included on the command). | ||
Prerequisites: set muuk_key environment variable under your CircleCi project settings with your organization key. | ||
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@1.0.1 | ||
muuktest: muuklabs/muuktest@2.0.0 | ||
workflows: | ||
execute: | ||
jobs: | ||
- muuktest/mkcli: | ||
p: hashtag | ||
t: deployment | ||
browser: firefox | ||
muuk_key: MUUK_KEY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
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: | ||
t: TC0001 | ||
muuk_key: MUUK_KEY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
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: | ||
t: deployment | ||
p: hashtag | ||
muuk_key: MUUK_KEY |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
description: > | ||
MuukTest Playwright executor with Circle CI on Github. | ||
docker: | ||
- image: cimg/node:20.9 | ||
environment: | ||
MUUKTEST_TAG_PROPERTY: << parameters.p >> | ||
MUUKTEST_TAG_VALUE: << parameters.t >> | ||
MUUKTEST_BROWSER: << parameters.browser >> | ||
|
||
parameters: | ||
|
||
t: | ||
type: string | ||
description: "Test case id or hashtag name." | ||
|
||
p: | ||
type: enum | ||
default: tag | ||
enum: [tag, hashtag] | ||
description: "Set either tag or hastag according value on t parameter." | ||
|
||
browser: | ||
type: enum | ||
default: chromium | ||
enum: [chromium, firefox] | ||
description: "Set either from chrome or firefox to run the script on." | ||
|
||
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 | ||
|
||
steps: | ||
- run: | ||
name: Init | ||
command: | | ||
mkdir -p executor | ||
cd executor | ||
MUUKTEST_KEY_INTERNAL=${<< parameters.muuk_key >>} | ||
printf '{ "key": "%s"}' "$MUUKTEST_KEY_INTERNAL" > file.json | ||
cat file.json | ||
- run: | ||
name: Installing libraries dependencies | ||
command: sudo apt-get update && sudo apt-get install -y unzip | ||
|
||
- run: | ||
name: Retrieve MuukTest config files and Test scripts | ||
command: <<include(scripts/get_pw_config_and_tests.sh)>> | ||
|
||
- run: | ||
name: Installing PW and required packages | ||
command: <<include(scripts/install_pw_and_requirements.sh)>> | ||
|
||
|
||
- run: | ||
name: Execute MuukTest E2E | ||
command: | | ||
cd executor || { echo "Failure: executor directory not found!"; exit 1; } | ||
npx playwright test --workers=3 --project=$MUUKTEST_BROWSER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
pip install requests | ||
pip install Pillow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
cd executor || { echo "Failure: executor directory not found!"; exit 1; } | ||
sudo apt-get update && sudo apt-get install -y ca-certificates curl gnupg | ||
sudo mkdir -p /etc/apt/keyrings | ||
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg | ||
NODE_MAJOR=20 | ||
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list | ||
sudo apt-get update && sudo apt-get install nodejs -y | ||
echo "node -v" && node -v | ||
sudo apt-get update && sudo apt-get install gcc g++ make | ||
sudo apt-get update && sudo apt-get install npm | ||
echo "npm -v" && npm -v | ||
sudo apt-get update && sudo apt-get install -y unzip |