Skip to content

Commit

Permalink
try appium 2
Browse files Browse the repository at this point in the history
try timeouts

try driver version

test  avoidProxy: true

.
  • Loading branch information
denysoblohin-okta committed Jul 4, 2024
1 parent 3a7f387 commit 558dc82
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 37 deletions.
7 changes: 7 additions & 0 deletions .bacon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ test_suites:
script_name: e2e-saucelabs-mobile
criteria: OPTIONAL
queue_name: small
- name: e2e-saucelabs-mobile-v3
script_path: /root/okta/okta-signin-widget/scripts
sort_order: '13'
timeout: '20'
script_name: e2e-saucelabs-mobile-v3
criteria: OPTIONAL
queue_name: small
- name: tsd
script_path: /root/okta/okta-signin-widget/scripts
sort_order: '14'
Expand Down
51 changes: 51 additions & 0 deletions scripts/e2e-saucelabs-mobile-v3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash
export CI=true

source $OKTA_HOME/$REPO/scripts/setup.sh

setup_service java 1.8.222
setup_service google-chrome-stable 89.0.4389.72-1

export RUN_SAUCE_TESTS=mobile
export SAUCE_USERNAME=OktaSignInWidget
get_vault_secret_key devex/sauce-labs accessKey SAUCE_ACCESS_KEY
export TEST_SUITE_TYPE="junit"
export TEST_RESULT_FILE_DIR="${REPO}/build2"
echo ${TEST_SUITE_TYPE} > ${TEST_SUITE_TYPE_FILE}
echo ${TEST_RESULT_FILE_DIR} > ${TEST_RESULT_FILE_DIR_FILE}

# We use the below OIE enabled org and clients for OIE tests
export WIDGET_TEST_SERVER=https://oie-signin-widget.okta.com
export WIDGET_SPA_CLIENT_ID=0oa8lrg7ojTsbJgRQ696
export WIDGET_WEB_CLIENT_ID=0oa8ls36zUZj7oFJ2696
export WIDGET_BASIC_USER=testuser
get_vault_secret_key devex/okta-signin-widget widget_basic_password WIDGET_BASIC_PASSWORD

export ORG_OIE_ENABLED=true
get_vault_secret_key devex/auth-js-sdk-vars a18n_api_key A18N_API_KEY
get_vault_secret_key devex/okta-signin-widget test_org_okta_api_key OKTA_CLIENT_TOKEN

# Build
if ! yarn workspace v3 build:release; then
echo "build failed! Exiting..."
exit ${TEST_FAILURE}
fi

if ! setup_service node v14.18.2 &> /dev/null; then
echo "Failed to install node"
exit ${FAILED_SETUP}
fi

# Run tests
export DISABLE_CSP=1
export CDN_ONLY=1
export BUNDLE="next"
export TARGET="CROSS_BROWSER"
export USE_MIN=1

if ! yarn test:e2e; then
echo "e2e saucelabs test failed! Exiting..."
exit ${PUBLISH_TYPE_AND_RESULT_DIR_BUT_ALWAYS_FAIL}
fi

exit ${PUBLISH_TYPE_AND_RESULT_DIR}
3 changes: 1 addition & 2 deletions scripts/e2e-saucelabs-mobile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ source $OKTA_HOME/$REPO/scripts/setup.sh
setup_service java 1.8.222
setup_service google-chrome-stable 89.0.4389.72-1

export RUN_SAUCE_TESTS=true
export MOBILE_BROWSER_TESTS=true
export RUN_SAUCE_TESTS=mobile
export SAUCE_USERNAME=OktaSignInWidget
get_vault_secret_key devex/sauce-labs accessKey SAUCE_ACCESS_KEY
export TEST_SUITE_TYPE="junit"
Expand Down
3 changes: 2 additions & 1 deletion scripts/e2e-saucelabs-v3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ source $OKTA_HOME/$REPO/scripts/setup.sh
setup_service java 1.8.222
setup_service google-chrome-stable 89.0.4389.72-1

export RUN_SAUCE_TESTS=true
export RUN_SAUCE_TESTS=ie11
export SAUCE_USERNAME=OktaSignInWidget
get_vault_secret_key devex/sauce-labs accessKey SAUCE_ACCESS_KEY
export TEST_SUITE_TYPE="junit"
Expand Down Expand Up @@ -36,6 +36,7 @@ if ! setup_service node v14.18.2 &> /dev/null; then
exit ${FAILED_SETUP}
fi

# Run tests
export DISABLE_CSP=1
export CDN_ONLY=1
export BUNDLE="next"
Expand Down
2 changes: 1 addition & 1 deletion scripts/e2e-saucelabs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ source $OKTA_HOME/$REPO/scripts/setup.sh
setup_service java 1.8.222
setup_service google-chrome-stable 89.0.4389.72-1

export RUN_SAUCE_TESTS=true
export RUN_SAUCE_TESTS=ie11,edge
export SAUCE_USERNAME=OktaSignInWidget
get_vault_secret_key devex/sauce-labs accessKey SAUCE_ACCESS_KEY
export TEST_SUITE_TYPE="junit"
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const getTask = ({ bundle }) => {
console.log('RUN_FEATURE_TESTS is true, using configuration: cucumber.wdio.conf.ts');
wdioConfig = path.resolve(__dirname, 'cucumber.wdio.conf.ts');
} else if (process.env.RUN_SAUCE_TESTS) {
console.log('RUN_SAUCE_TESTS is true, using configuration: sauce.wdio.conf.ts');
console.log(`RUN_SAUCE_TESTS is ${process.env.RUN_SAUCE_TESTS}, using configuration: sauce.wdio.conf.ts`);
wdioConfig = path.resolve(__dirname, 'sauce.wdio.conf.ts');
} else {
console.log('Using default wdio configuration: wdio.conf.js');
Expand Down
68 changes: 36 additions & 32 deletions test/e2e/wdio.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,11 @@ if (process.env.TEST_LANG) {
}

// overrides for saucelabs test
if (process.env.MOBILE_BROWSER_TESTS) {
conf.capabilities = [
if (process.env.RUN_SAUCE_TESTS) {
conf.capabilities = [];
const testTypes = process.env.RUN_SAUCE_TESTS.split(',');
if (testTypes.includes('mobile')) {
conf.capabilities.push(...[
{
platformName: 'iOS',
browserName: 'Safari',
Expand All @@ -258,41 +261,42 @@ if (process.env.MOBILE_BROWSER_TESTS) {
// name: "Android-Widget-Test",
// }
// }
];
} else if (process.env.RUN_SAUCE_TESTS) {
conf.capabilities = [
{
maxInstances: 1, // all tests use the same user and local storage. they must run in series
browserName: 'internet explorer',
browserVersion: 'latest',
platformName: 'Windows 10',
"se:ieOptions": {
acceptUntrustedCertificates: true,
"ie.ensureCleanSession": true
},
timeouts: { "implicit": 20_000 }
]);
}
if (testTypes.includes('ie11')) {
conf.capabilities.push({
maxInstances: 1, // all tests use the same user and local storage. they must run in series
browserName: 'internet explorer',
browserVersion: 'latest',
platformName: 'Windows 10',
"se:ieOptions": {
acceptUntrustedCertificates: true,
"ie.ensureCleanSession": true
},
{
platformName: 'iOS',
browserName: 'Safari',
'appium:deviceName': 'iPad Pro (12.9 inch) (5th generation) Simulator',
'appium:platformVersion': '15.4',
'sauce:options': {
appiumVersion: '1.22.3',
build: "iOS-Widget-Build",
name: "iOS-Widget-Test",
}
timeouts: {
implicit: 20_000,
script: 40_000,
pageLoad: 300_000,
},
{
maxInstances: 1, // all tests use the same user and local storage. they must run in series
browserName: 'MicrosoftEdge',
browserVersion: 'latest',
platformName: 'Windows 10',
"ms:edgeOptions": {} // don't delete this line, edge tests won't run
});
}
if (testTypes.includes('edge')) {
conf.capabilities.push({
maxInstances: 1, // all tests use the same user and local storage. they must run in series
browserName: 'MicrosoftEdge',
browserVersion: 'latest',
platformName: 'Windows 10',
"ms:edgeOptions": {}, // don't delete this line, edge tests won't run
timeouts: {
implicit: 20_000,
script: 40_000,
pageLoad: 300_000,
},
];
});
}
}


// Enable skipping certain tests when running against local monolith
// Can be removed when epic is complete: https://oktainc.atlassian.net/browse/OKTA-528454
if (process.env.LOCAL_MONOLITH) {
Expand Down

0 comments on commit 558dc82

Please sign in to comment.