Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Remove unused E2E test helpers #55711

Merged
merged 4 commits into from
Nov 2, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions packages/react-native-editor/__device-tests__/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -682,42 +682,6 @@ const clickIfClickable = async (
}
};

// Only for Android
const waitIfAndroid = async () => {
if ( isAndroid() ) {
await editorPage.driver.sleep( 1000 );
}
};

/**
* Content type definitions.
* Note: Android only supports plaintext.
*
* @typedef {"plaintext" | "image" | "url"} ClipboardContentType
*/

/**
* Helper to set content in the clipboard.
*
* @param {Object} driver Driver
* @param {string} content Content to set in the clipboard
* @param {ClipboardContentType} contentType Type of the content
*/
const setClipboard = async ( driver, content, contentType = 'plaintext' ) => {
const base64String = Buffer.from( content ).toString( 'base64' );
await driver.setClipboard( base64String, contentType );
};

/**
* Helper to clear the clipboard
*
* @param {Object} driver Driver
* @param {ClipboardContentType} contentType Type of the content
*/
const clearClipboard = async ( driver, contentType = 'plaintext' ) => {
dcalhoun marked this conversation as resolved.
Show resolved Hide resolved
await driver.setClipboard( '', contentType );
};

const launchApp = async ( driver, initialProps = {} ) => {
if ( isAndroid() ) {
await driver.execute( 'mobile: startActivity', {
Expand All @@ -744,7 +708,6 @@ const launchApp = async ( driver, initialProps = {} ) => {

module.exports = {
backspace,
clearClipboard,
clickBeginningOfElement,
clickIfClickable,
clickMiddleOfElement,
Expand All @@ -756,7 +719,6 @@ module.exports = {
launchApp,
longPressMiddleOfElement,
selectTextFromElement,
setClipboard,
setupDriver,
stopDriver,
swipeDown,
Expand All @@ -770,5 +732,4 @@ module.exports = {
typeString,
waitForMediaLibrary,
waitForVisible,
waitIfAndroid,
};
Loading