Skip to content

Commit

Permalink
Update capabilities to fix SauceLabs
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerardo committed Oct 5, 2023
1 parent 5c1412b commit 2777c20
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions packages/react-native-editor/__device-tests__/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
const childProcess = require( 'child_process' );
// eslint-disable-next-line import/no-extraneous-dependencies, import/named
import { remote } from 'webdriverio';
const crypto = require( 'crypto' );
const path = require( 'path' );
/**
* Internal dependencies
Expand Down Expand Up @@ -121,13 +120,13 @@ const setupDriver = async () => {
// Ignore error.
}
} else {
desiredCaps.app = `sauce-storage:Gutenberg-${ safeBranchName }.apk`; // App should be preloaded to sauce storage, this can also be a URL.
desiredCaps.app = `storage:filename=Gutenberg-${ safeBranchName }.apk`; // App should be preloaded to sauce storage, this can also be a URL.
desiredCaps.newCommandTimeout = 240;
}
} else {
desiredCaps = iosServer( { iPadDevice } );
desiredCaps.newCommandTimeout = 240;
desiredCaps.app = `sauce-storage:Gutenberg-${ safeBranchName }.app.zip`; // App should be preloaded to sauce storage, this can also be a URL.
desiredCaps.app = `storage:filename=Gutenberg-${ safeBranchName }.app.zip`; // App should be preloaded to sauce storage, this can also be a URL.
if ( isLocalEnvironment() ) {
desiredCaps = iosLocal( { iPadDevice } );

Expand Down Expand Up @@ -165,7 +164,7 @@ const setupDriver = async () => {
...sauceOptions,
name: `Gutenberg Editor Tests[${ rnPlatform }]-${ branch }`,
tags: [ 'Gutenberg', branch ],
idleTimeout: 180,
idleTimeout: 240,
},
}
: {};
Expand All @@ -175,7 +174,6 @@ const setupDriver = async () => {

const driver = await remote( {
...serverConfig,
waitforTimeout: 60000,
logLevel: 'error',
capabilities: {
platformName: PLATFORM_NAME,
Expand All @@ -184,24 +182,14 @@ const setupDriver = async () => {
},
} );

const status = await driver.status();
// Display the driver status
// eslint-disable-next-line no-console
console.log( status );

await driver.setOrientation( 'PORTRAIT' );
return driver;
};

const stopDriver = async ( driver ) => {
if ( ! isLocalEnvironment() ) {
const jobID = driver.sessionID;

const hash = crypto
.createHmac( 'md5', jobID )
.update( serverConfigs.sauce.auth )
.digest( 'hex' );
const jobURL = `https://saucelabs.com/jobs/${ jobID }?auth=${ hash }`;
const jobID = driver.sessionId;
const jobURL = `https://saucelabs.com/jobs/${ jobID }`;
// eslint-disable-next-line no-console
console.log( `You can view the video of this test run at ${ jobURL }` );
}
Expand Down Expand Up @@ -647,7 +635,7 @@ const isEditorVisible = async ( driver ) => {
? `//android.widget.EditText[contains(@content-desc, "Post title")]`
: `(//XCUIElementTypeScrollView/XCUIElementTypeOther/XCUIElementTypeOther[contains(@name, "Post title")])`;

await driver.$( postTitleLocator ).waitForDisplayed();
await driver.$( postTitleLocator ).waitForDisplayed( { timeout: 30000 } );
};

const waitForMediaLibrary = async ( driver ) => {
Expand Down

0 comments on commit 2777c20

Please sign in to comment.