Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jan 19, 2021. It is now read-only.

magellan test executor for saucelabs

License

NotificationsYou must be signed in to change notification settings

TestArmada/magellan-saucelabs-executor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project, and it's related TestArmada projects, will no longer be supported. No further work from the owners will be done, and no PRs will be reviewed.

Magellan-Saucelabs-Executor

Build Statuscodecov

Executor forMagellan to runnightwatchjs tests inSaucelabs environment.

Pleast Note: in version 5 releaselocks integration is removed from executor and moved intomagellan repo. Magellan@11 release manageslocks and other test resources via resource strategy.

Important Notes About Versions

Magellan Version Compatibility

Important:testarmada-magellan-saucelabs-executor is only supported by magellan version10.0.0 or higher.

What does this executor do

  1. It managesSauce Connect if your tests need it.
  2. It talksGuacamole so that the desiredCapabilities shrinks down to a string, which makes managing your browser selection easier.
  3. It reports test result to Saucelabs automatically.
  4. It runs tests by forking the test framework (i.e. Nightwatch, etc) it asmagellan child process.

How To Use

Please follow the following steps:

  1. npm install testarmada-magellan-saucelabs-executor --save
  2. Add following the block to yourmagellan.json (if there isn't amagellan.json please create one under your folder root):
"executors":["testarmada-magellan-saucelabs-executor"]
  1. Set environment variables:
export SAUCE_CONNECT_VERSION=${VERSION}export SAUCE_USERNAME=${USERNAME}export SAUCE_ACCESS_KEY=${TOKEN}# Set this to disable the autodetection of proxy settings when using sauce connectexport SC_NO_AUTODETECT=true
  1. ./node_modules/.bin/magellan --help to see if you can see the following content printed out
 Executor-specific (testarmada-magellan-sauce-executor)  --sauce_browser=browsername          Run tests in chrome, firefox, etc (default: phantomjs).  --sauce_browsers=b1,b2,..            Run multiple browsers in parallel.  --sauce_list_browsers                List the available browsers configured (Guacamole integrated).  --sauce_create_tunnels               undefined  --sauce_tunnel_id=testtunnel123123   Use an existing secure tunnel (exclusive with --sauce_create_tunnels)  --sauce_app=sauce-storage:your_app.apSpecify the app name in sauce temporary storage  --sauce_app_capabilities_config=sauceSpecify a configuration file containing customized appium desiredCapabilities for saucelabs VM  --shared_sauce_parent_account=testsauSpecify parent account name if existing shared secure tunnel is  in use (exclusive with --sauce_create_tunnels)

Congratulations, you're all set.

Customize sauce tunnel flags

testarmada-magellan-saucelabs-executor supports customized sauce tunnel flags since1.0.2. You can put customized flags into a.json file and use--sauce_tunnel_config to load the file.

tunnelconfigjsonexample{"fastFailRegexps":"p.typekit.net","directDomains":"google.com","noSslBumpDomains":"google.com"}

For all supported flags please refer tohere.

Customize appium desiredCapabilities (for app and mobile web test only)

testarmada-magellan-saucelabs-executor supports customizedappium desiredCapabilies. A user can directly put all the desiredappium capabilities in aprofile as shown below:

"chrome-android": [{    "browser": "Android_GoogleAPI_Emulator_Android_7_0_Android",    "orientation": "portrait",    "appium": {        "browserName": "Chrome",        "appiumVersion": "1.6.5",        "platformName": "Android",        "platformVersion": "7.0"    }}]

Also, a user can define the desired capabilities in ajson orjs file specified byappiumCapabilitiesConfig as shown below.

"chrome-android": [{    "browser": "Android_GoogleAPI_Emulator_Android_7_0_Android",    "orientation": "portrait",    "appCapabilitiesConfig": "./config/appium-capabilities.json"    "appium": {        "browserName": "Chrome",        "appiumVersion": "1.6.5",        "platformName": "Android",        "platformVersion": "7.0"    }}]

Example ofappium-capabilities.json

{"Android_GoogleAPI_Emulator_Android_7_0_Android":{"automationName":"XCUITest","sendKeyStrategy":"setValue","waitForAppScript":"true","locationServicesAuthorized":"false"},"Android_GoogleAPI_Emulator_Android_7_1_Android":{"automationName":"XCUITest","sendKeyStrategy":"setValue","waitForAppScript":"false","locationServicesAuthorized":"true"}}

Example ofappium-capabilities.js

'use strict';constAPPIUM_VERSION=process.env.APPIUM_VERSION;module.exports={"Android_GoogleAPI_Emulator_Android_7_0_Android":{"appiumVersion":`${APPIUM_VERSION}`"automationName":"XCUITest","sendKeyStrategy":"setValue","waitForAppScript":"true","locationServicesAuthorized":"false"},"Android_GoogleAPI_Emulator_Android_7_1_Android":{"appiumVersion":`${APPIUM_VERSION}`"automationName":"XCUITest","sendKeyStrategy":"setValue","waitForAppScript":"false","locationServicesAuthorized":"true"}}

Using ajs file is especially useful when you want to add a dynamic value to a property. e.g from an environment variable

Note that the desired capabilities for the browser should be placed under its key e.gAndroid_GoogleAPI_Emulator_Android_7_0_Android. The file can contain more than one browsers as shown in the example.

You can further merge the customized appium desired capabilities via--sauce_app_capabilities_config. Any content in the.json file will be merged into desiredCapabilities directly.

customized appium desired capabilities

"Android_GoogleAPI_Emulator_Android_7_0_Android" :{{"appiumVersion":"1.6.5","automationName":"XCUITest","sendKeyStrategy":"setValue"}}

If the browser key is not found in the configuration files (appCapabilitiesConfig or--sauce_app_capabilities_config), no capabilities are merged from the configuration files.

Note that the desired capabilities from--sauce_app_capabilities_config andappCapabilities are merged into the localappium capabilities with--sauce_app_capabilities_config taking precedence over the capabilities fromappCapabilitiesConfig which in turn takes precedence over the localappium capabilities.

Loading rules for env variables and customized flags

Some parameters can be passed in from both env variables and customized flags (such asSAUCE_USERNAME from env variables andusername from flags). It is very important to understand which one will take effect if set up both.

  1. env variable always has top priority.
  2. customized flags only work when no corresponding env variable set

Loading rules for command line args, profile and configuration file content

Some arguments can be passed in to excutor from both command line args, profile and configuration files, for example the temporary app location on saucelabs. The rule for deciding the final value of such argument is ordered as following

  1. configuration file content
  2. profile
  3. command line args (except--sauce_app, command line value of--sauce_app has the top priority)

Example

To run test in latest chrome on Windows10 without a tunnel

$./node_modules/.bin/magellan --sauce_browser chrome_latest_Windows_10_Desktop --test xxx

To run test in latest chrome on Windows10 with a new tunnel

$./node_modules/.bin/magellan --sauce_browser chrome_latest_Windows_10_Desktop --sauce_create_tunnels --test xxx

To run test in latest chrome on Windows10 with an exiting tunnel

$./node_modules/.bin/magellan --sauce_browser chrome_latest_Windows_10_Desktop --sauce_tunnel_id xxx --test xxx

To run test in latest chrome, latest firefox on Windows10 and safari 9 on MacOS 10.11

$./node_modules/.bin/magellan --sauce_browsers chrome_latest_Windows_10_Desktop,firefox_latest_Windows_10_Desktop,safari_9_OS_X_10_11_Desktop --test xxx

To create sauce tunnel connection with customized flags from./tunnel.json

$./node_modules/.bin/magellan --sauce_browsers chrome_latest_Windows_10_Desktop --sauce_create_tunnels --sauce_tunnel_config ./tunnel.json

License

Documentation in this project is licensed under Creative Commons Attribution 4.0 International License. Full details available athttps://creativecommons.org/licenses/by/4.0

About

magellan test executor for saucelabs

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors8


[8]ページ先頭

©2009-2025 Movatter.jp